use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.List1 in project netvirt by opendaylight.
the class NeutronvpnUtils method getFixedIpsDelta.
/**
* Gets the fixed ips delta.
*
* @param port1FixedIps the port 1 fixed ips
* @param port2FixedIps the port 2 fixed ips
* @return the fixed ips delta
*/
protected static List<FixedIps> getFixedIpsDelta(List<FixedIps> port1FixedIps, List<FixedIps> port2FixedIps) {
if (port1FixedIps == null) {
return null;
}
if (port2FixedIps == null) {
return port1FixedIps;
}
List<FixedIps> list1 = new ArrayList<>(port1FixedIps);
List<FixedIps> list2 = new ArrayList<>(port2FixedIps);
for (Iterator<FixedIps> iterator = list1.iterator(); iterator.hasNext(); ) {
FixedIps fixedIps1 = iterator.next();
for (FixedIps fixedIps2 : list2) {
if (fixedIps1.getIpAddress().equals(fixedIps2.getIpAddress())) {
iterator.remove();
break;
}
}
}
return list1;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.List1 in project netvirt by opendaylight.
the class NeutronvpnUtils method getSecurityGroupsDelta.
/**
* Gets security group UUIDs delta .
*
* @param port1SecurityGroups the port 1 security groups
* @param port2SecurityGroups the port 2 security groups
* @return the security groups delta
*/
protected static List<Uuid> getSecurityGroupsDelta(List<Uuid> port1SecurityGroups, List<Uuid> port2SecurityGroups) {
if (port1SecurityGroups == null) {
return null;
}
if (port2SecurityGroups == null) {
return port1SecurityGroups;
}
List<Uuid> list1 = new ArrayList<>(port1SecurityGroups);
List<Uuid> list2 = new ArrayList<>(port2SecurityGroups);
for (Iterator<Uuid> iterator = list1.iterator(); iterator.hasNext(); ) {
Uuid securityGroup1 = iterator.next();
for (Uuid securityGroup2 : list2) {
if (securityGroup1.getValue().equals(securityGroup2.getValue())) {
iterator.remove();
break;
}
}
}
return list1;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.List1 in project controller by opendaylight.
the class WriteParentReadChildTest method writeParentReadChild.
/**
* The scenario tests writing parent node, which also contains child items
* and then reading child directly, by specifying path to the child.
* Expected behaviour is child is returned.
*/
@Test
public void writeParentReadChild() throws Exception {
DataBroker dataBroker = testContext.getDataBroker();
final WriteTransaction transaction = dataBroker.newWriteOnlyTransaction();
List11 list11 = //
new List11Builder().setKey(//
LIST11_KEY).setAttrStr("primary").build();
List1 list1 = new List1Builder().setKey(LIST1_KEY).setList11(ImmutableList.of(list11)).build();
transaction.put(LogicalDatastoreType.OPERATIONAL, LIST1_INSTANCE_ID_BA, list1, true);
transaction.submit().get(5, TimeUnit.SECONDS);
Optional<List1> readList1 = dataBroker.newReadOnlyTransaction().read(LogicalDatastoreType.OPERATIONAL, LIST1_INSTANCE_ID_BA).get(1000, TimeUnit.MILLISECONDS);
assertTrue(readList1.isPresent());
Optional<? extends DataObject> readList11 = dataBroker.newReadOnlyTransaction().read(LogicalDatastoreType.OPERATIONAL, LIST11_INSTANCE_ID_BA).get(5, TimeUnit.SECONDS);
assertNotNull("Readed flow should not be null.", readList11);
assertTrue(readList11.isPresent());
assertEquals(list11, readList11.get());
}
Aggregations