private static final Logger LOG = LoggerFactory.getLogger(EvcUtils.class);
- private EvcUtils() {
- throw new AssertionError("Instantiating utility class.");
- }
-
/**
- * Delete EVC data from configuration datastore
+ * Delete EVC data from configuration datastore.
* @param dataBroker The dataBroker instance to create transactions
* @param optionalUni Optional Uni Node
*/
- public static void deleteEvcData(DataBroker dataBroker, Optional<Node> optionalUni) {
+ public static void deleteEvcData(final DataBroker dataBroker, final Optional<Node> optionalUni) {
if (optionalUni.isPresent()) {
final UniAugmentation uniAugmentation =
optionalUni
ovsdbNodeIid);
if (optionalOvsdNode.isPresent()) {
final Node ovsdbNode = optionalOvsdNode.get();
- final OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
+ final OvsdbNodeAugmentation ovsdbNodeAugmentation =
+ ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
for (final ManagedNodeEntry managedNodeEntry: ovsdbNodeAugmentation.getManagedNodeEntry()) {
final InstanceIdentifier<Node> bridgeIid = managedNodeEntry
.getBridgeRef()
final Optional<Node> optBridgeNode = MdsalUtils.readNode(dataBroker, bridgeIid);
if (optBridgeNode.isPresent()) {
final Node bridgeNode = optBridgeNode.get();
- final InstanceIdentifier<TerminationPoint> iidGreTermPoint = UnimgrMapper.getTerminationPointIid(bridgeNode,
- UnimgrConstants.DEFAULT_GRE_TUNNEL_NAME);
- final InstanceIdentifier<TerminationPoint> iidEthTermPoint = UnimgrMapper.getTerminationPointIid(bridgeNode,
- UnimgrConstants.DEFAULT_TUNNEL_IFACE);
+ final InstanceIdentifier<TerminationPoint> iidGreTermPoint =
+ UnimgrMapper.getTerminationPointIid(bridgeNode,
+ UnimgrConstants.DEFAULT_GRE_TUNNEL_NAME);
+ final InstanceIdentifier<TerminationPoint> iidEthTermPoint =
+ UnimgrMapper.getTerminationPointIid(bridgeNode,
+ UnimgrConstants.DEFAULT_TUNNEL_IFACE);
MdsalUtils.deleteNode(dataBroker, iidGreTermPoint, LogicalDatastoreType.CONFIGURATION);
MdsalUtils.deleteNode(dataBroker, iidEthTermPoint, LogicalDatastoreType.CONFIGURATION);
}
}
/**
- * Retrieve the list of links in the Operational DataStore
+ * Retrieve the list of links in the Operational DataStore.
* @param dataBroker The dataBroker instance to create transactions
* @return A list of Links retrieved from the Operational DataStore
*/
- public static List<Link> getEvcLinks(DataBroker dataBroker) {
+ public static List<Link> getEvcLinks(final DataBroker dataBroker) {
final List<Link> evcLinks = new ArrayList<>();
final InstanceIdentifier<Topology> evcTopology = UnimgrMapper.getEvcTopologyIid();
final Topology topology = MdsalUtils.read(dataBroker,
}
/**
- * Updates a specific EVC into a specific DataStore type
+ * Updates a specific EVC into a specific DataStore type.
* @param dataStore The datastore type
* @param evcKey The EVC key
* @param evcAugmentation The EVC's data
* @param dataBroker The dataBroker instance to create transactions
* @return true if evc is updated
*/
- public static boolean updateEvcNode(LogicalDatastoreType dataStore,
- InstanceIdentifier<?> evcKey,
- EvcAugmentation evcAugmentation,
- InstanceIdentifier<?> sourceUniIid,
- InstanceIdentifier<?> destinationUniIid,
- DataBroker dataBroker) {
+ public static boolean updateEvcNode(final LogicalDatastoreType dataStore,
+ final InstanceIdentifier<?> evcKey,
+ final EvcAugmentation evcAugmentation,
+ final InstanceIdentifier<?> sourceUniIid,
+ final InstanceIdentifier<?> destinationUniIid,
+ final DataBroker dataBroker) {
final EvcAugmentationBuilder updatedEvcBuilder = new EvcAugmentationBuilder(evcAugmentation);
if ((sourceUniIid != null) && (destinationUniIid != null)) {
final List<UniSource> sourceList = new ArrayList<UniSource>();
- final UniSourceKey sourceKey = evcAugmentation.getUniSource().iterator().next().getKey();
- final short sourceOrder = evcAugmentation.getUniSource().iterator().next().getOrder();
- final IpAddress sourceIp = evcAugmentation.getUniSource().iterator().next().getIpAddress();
+ final UniSource evcUniSource = evcAugmentation.getUniSource().iterator().next();
+ final UniSourceKey sourceKey = evcUniSource.getKey();
+ final short sourceOrder = evcUniSource.getOrder();
+ final IpAddress sourceIp = evcUniSource.getIpAddress();
final UniSource uniSource = new UniSourceBuilder()
.setOrder(sourceOrder)
.setKey(sourceKey)
updatedEvcBuilder.setUniSource(sourceList);
final List<UniDest> destinationList = new ArrayList<UniDest>();
- final UniDestKey destKey = evcAugmentation.getUniDest().iterator().next().getKey();
- final short destOrder = evcAugmentation.getUniDest().iterator().next().getOrder();
- final IpAddress destIp = evcAugmentation.getUniDest().iterator().next().getIpAddress();
+ final UniDest evcUniDest = evcAugmentation.getUniDest().iterator().next();
+ final UniDestKey destKey = evcUniDest.getKey();
+ final short destOrder = evcUniDest.getOrder();
+ final IpAddress destIp = evcUniDest.getIpAddress();
final UniDest uniDest = new UniDestBuilder()
.setIpAddress(destIp)
.setOrder(destOrder)
}
return false;
}
+
+ private EvcUtils() {
+ throw new AssertionError("Instantiating utility class.");
+ }
}