Hi folks,
I am suspecting there are some constraints on AddressGroup which could most include one IPV4 and(or) one IPV6. The processing
code in RFC2ModelEndpointAddressGroupCoventer.java seems only could cope with most one IPV4 and(or) one IPV6.
@Override
protected Object _convert() {
List<ModelEndpointAddressGroup> out =
new LinkedList<ModelEndpointAddressGroup>();
if ((in().ipv4 !=
null) && (!in().ipv4.isEmpty())) {
ModelEndpointAddressGroup v4 =
new ModelEndpointAddressGroup();
v4.setJSONAddressType(ModelEndpointAddressGroup.IPV4);
v4.setJSONEndpointPrefix(in().ipv4);
out.add(v4);
}
if ((in().ipv6 !=
null) && (!in().ipv6.isEmpty())) {
ModelEndpointAddressGroup v6 =
new ModelEndpointAddressGroup();
v6.setJSONAddressType(ModelEndpointAddressGroup.IPV6);
v6.setJSONEndpointPrefix(in().ipv6);
out.add(v6);
}
return out;
}
It is reseanable that one EP has multiple IPV4 addresses or multiple IPV6 addresses.
Did I misunderstand something .
BR
Robert
-------------------------------------------------------------------------------------------------------------------------------------
Chen Guohai (Robert),
陈国海. Network Research Department, Huawei Technologies Co., Ltd. Telephone: 0086-25-56624606;
华为技术有限公司 ,地址:深圳市龙岗区坂田华为基地 邮编:518129
http://www.huawei.com
-------------------------------------------------------------------------------------------------------------------------------------
本邮件及其附件含有华为公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他 人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件 通知发件人并删除本邮件!
This e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above.
Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please
notify the sender by phone or email immediately and delete it!
----------------------------------------------------------------------------------------------------------------------------------------
Hi folks,
I am reading the code under ALTO@ODL. And here are my two comments.
1:File named
‘AltoProviderImplBuilder’under alto-provider/……./modules/module/configuration :in function named 'toString',first is defined to judge a common should be inserted, i recommend writting
as following
@Override
public java.lang.String toString() {
java.lang.StringBuilder builder =
new java.lang.StringBuilder ("AltoProviderImpl
[");
//boolean
first = true;
if
(_dataBroker != null) {
//if
(first) {
// first =
false;
//}
else {
// builder.append(", ");
//}
builder.append("_dataBroker=");
builder.append(_dataBroker);
builder.append(", ");//new
added
}
if (_rpcRegistry !=
null) {
//if
(first) {
// first =
false;
//}
else {
// builder.append(", ");
//}
builder.append("_rpcRegistry=");
builder.append(_rpcRegistry);
builder.append(", ");//new
added
}
//if
(first) {
// first =
false;
//}
else {
// builder.append(", ");
//}
builder.append("augmentation=");
builder.append(augmentation.values());
return builder.append(']').toString();
}
}
Fewer judgement, fewer jumpes and simplified,
consistent code,Make sense.
There are similar something in file named RpcRegistryBuilder.java under alto-provider/……../modules/module/configuration/alto/provider/impl
2: File named
‘YangModuleInfoImpl’ line36 there are duplicated something between $YangModuleInfoImpl method(line 30 to line 33) and getModuleSourceStream.YangModuleInfoImpl can call
getModuleSourceStream
to get a stream.
private $YangModuleInfoImpl() {
Set<YangModuleInfo> set =
new HashSet<>();
set.add(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.binding.rev131028.$YangModuleInfoImpl.getInstance());
set.add(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.$YangModuleInfoImpl.getInstance());
set.add(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.rpc.context.rev130617.$YangModuleInfoImpl.getInstance());
importedModules = ImmutableSet.copyOf(set);
//InputStream stream = $YangModuleInfoImpl.class.getResourceAsStream(resourcePath);
//if
(stream == null) {
//
throw
new IllegalStateException("Resource '"
+ resourcePath + "' is missing");
//}
InputStream stream =
getModuleSourceStream
();// new added one
try {
stream.close();
}
catch (IOException e) {
// Resource leak, but there is nothing we can do
}
}
BR
Robert
-------------------------------------------------------------------------------------------------------------------------------------
Chen Guohai (Robert),
陈国海. Network Research Department, Huawei Technologies Co., Ltd. Telephone: 0086-25-56624606;
华 为技术有限公司 ,地址:深圳市龙岗区坂田华为基地 邮编:518129
http://www.huawei.com
-------------------------------------------------------------------------------------------------------------------------------------
本 邮件及其附件含有华为公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全 部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件!
This e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of
the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the
sender by phone or email immediately and delete it!
----------------------------------------------------------------------------------------------------------------------------------------
_______________________________________________
alto-dev mailing list
alto-dev@...
https://lists.opendaylight.org/mailman/listinfo/alto-dev