private void processDeletedEN(EndpointNetwork en, WriteTransaction wtx) { for (AddressEndpoint endpoint : endpoints) { if (endpoint.getContextType().isAssignableFrom(L3Context.class) && endpoint.getContextId().equals(en.getL3ContextId()) && endpoint.getAddressType().isAssignableFrom(IpPrefixType.class) && NetUtils.samePrefix(new IpPrefix(endpoint.getAddress().toCharArray()), en.getIpPrefix())) { InstanceIdentifier<AbsoluteLocation> iid = IidFactory .providerAddressEndpointLocationIid(NE_LOCATION_PROVIDER_NAME, IpPrefixType.class, endpoint.getAddress(), endpoint.getContextType(), endpoint.getContextId()) .child(AbsoluteLocation.class); wtx.delete(LogicalDatastoreType.CONFIGURATION, iid); LOG.debug("Location deleted for endpoint {}", endpoint); } } return; }
private void processCreatedEN(EndpointNetwork en, InstanceIdentifier<?> nodeIID, String connectorIID, WriteTransaction wtx) { for (AddressEndpoint endpoint : endpoints) { if (endpoint.getContextType().isAssignableFrom(L3Context.class) && endpoint.getContextId().equals(en.getL3ContextId()) && endpoint.getAddressType().isAssignableFrom(IpPrefixType.class) && NetUtils.samePrefix(new IpPrefix(endpoint.getAddress().toCharArray()), en.getIpPrefix())) { InstanceIdentifier<AbsoluteLocation> iid = IidFactory .providerAddressEndpointLocationIid(NE_LOCATION_PROVIDER_NAME, IpPrefixType.class, endpoint.getAddress(), endpoint.getContextType(), endpoint.getContextId()) .child(AbsoluteLocation.class); wtx.put(LogicalDatastoreType.CONFIGURATION, iid, createRealLocation(nodeIID, connectorIID), true); LOG.debug("New location created for endpoint {}", endpoint); } } return; }
} else if (!contextId.equals(consSubnet.getParent())) { LOG.error("Flood domain is not the same for all Network domains in the Consumer EPG "); return null; } else if (!contextId.equals(provSubnet.getParent())) { LOG.error("Flood domain is not the same for all Network domains in the Provider EPG "); return null;
private void removeLocationForEndpoint(AddressEndpoint endpoint, WriteTransaction wtx) { for (NetworkElement ne : nullToEmpty(networkElements.getNetworkElement())) { for (Interface iface : nullToEmpty(ne.getInterface())) { for (EndpointNetwork en : nullToEmpty(iface.getEndpointNetwork())) { if (endpoint.getContextType().isAssignableFrom(L3Context.class) && endpoint.getContextId().equals(en.getL3ContextId()) && endpoint.getAddressType().isAssignableFrom(IpPrefixType.class) && NetUtils .samePrefix(new IpPrefix(endpoint.getAddress().toCharArray()), en.getIpPrefix())) { InstanceIdentifier<AbsoluteLocation> iid = IidFactory .providerAddressEndpointLocationIid(NE_LOCATION_PROVIDER_NAME, IpPrefixType.class, endpoint.getAddress(), endpoint.getContextType(), endpoint.getContextId()) .child(AbsoluteLocation.class); wtx.delete(LogicalDatastoreType.CONFIGURATION, iid); LOG.debug("Location deleted for endpoint {}", endpoint); return; } } } } }
private void createLocationForEndpoint(AddressEndpoint endpoint, WriteTransaction wtx) { for (NetworkElement ne : nullToEmpty(networkElements.getNetworkElement())) { for (Interface iface : nullToEmpty(ne.getInterface())) { for (EndpointNetwork en : nullToEmpty(iface.getEndpointNetwork())) { if (endpoint.getContextType().isAssignableFrom(L3Context.class) && endpoint.getContextId().equals(en.getL3ContextId()) && endpoint.getAddressType().isAssignableFrom(IpPrefixType.class) && NetUtils .samePrefix(new IpPrefix(endpoint.getAddress().toCharArray()), en.getIpPrefix())) { InstanceIdentifier<AbsoluteLocation> iid = IidFactory .providerAddressEndpointLocationIid(NE_LOCATION_PROVIDER_NAME, IpPrefixType.class, endpoint.getAddress(), endpoint.getContextType(), endpoint.getContextId()) .child(AbsoluteLocation.class); wtx.put(LogicalDatastoreType.CONFIGURATION, iid, createRealLocation(ne.getIid(), iface.getIid()), true); LOG.debug("New location created for endpoint {}", endpoint); return; } } } } }