> On Aug. 9, 2013, 5:23 p.m., Toshiaki Hatano wrote: > > api/src/com/cloud/network/Networks.java, line 172 > > <https://reviews.apache.org/r/12849/diff/9/?file=338752#file338752line172> > > > > Why don't we merge getValueFrom() and getValue()? > > > > public String getValue(URI uri) { > > if(uri.isOpaque()) { > > return uri.getSchemeSpecificPart(); > > } else { > > return uri.getHost(); > > } > > }
Or, maybe make getValueFrom private. I think it will make confuse if we provide 2 public method to get value of URI. - Toshiaki ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/12849/#review24925 ----------------------------------------------------------- On Aug. 8, 2013, 11:51 a.m., daan Hoogland wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/12849/ > ----------------------------------------------------------- > > (Updated Aug. 8, 2013, 11:51 a.m.) > > > Review request for cloudstack, Chiradeep Vittal, Dave Cahill, Koushik Das, > and Sheng Yang. > > > Repository: cloudstack-git > > > Description > ------- > > Both BroadcastDomainType and IsolationType needed some extra code for > backwards compatibility. > > All over the code calls are done to URI.getHost() to retrieve ids of > broadcastdomains. These id obviously are not hosts so this call is confusing > and requires maintenance all over the code base. Also for different types the > value returned by getHost has different meaning. vlan://1 is id 1 of course > but others might be ranges of vlans or colon separated values. To make things > worse a NiciraNvp has an uri of the form lswitch:<uuid> without the forward > slashes. > > To make the system more maintainable in this perspect the changes in this > patch were made. It is my intention to replace the calls to getHost by the > member call getValueFrom or the static method getValue in time. In this way > maintenance is centralized and an overview of differnces and quirks is easily > found > > > Diffs > ----- > > api/src/com/cloud/network/Networks.java c76c3d4 > api/test/com/cloud/network/NetworksTest.java 31114e8 > > Diff: https://reviews.apache.org/r/12849/diff/ > > > Testing > ------- > > unit tests for different kind of BroadcastDomainType.values > > > Thanks, > > daan Hoogland > >