use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.cloud.servicechain.state.rev160711.elan.to.pseudo.port.data.list.ElanToPseudoPortDataBuilder in project netvirt by opendaylight.
the class ElanServiceChainUtils method updateElanToLportTagMap.
/**
* Stores the relation between ElanLport and scfTag.
*
* @param broker dataBroker service reference
* @param elanInstanceName Name of the ELAN. Typically its UUID
* @param lportTag Dataplane identifier of the ElanPseudoPort
* @param scfTag Dataplane identifier of the SCF
* @param addOrRemove States if flows must be added or removed
*/
public static void updateElanToLportTagMap(final DataBroker broker, final String elanInstanceName, final int lportTag, final long scfTag, final int addOrRemove) {
Long portTag = Long.valueOf(lportTag);
ElanToPseudoPortDataKey key = new ElanToPseudoPortDataKey(portTag, scfTag);
InstanceIdentifier<ElanToPseudoPortData> path = InstanceIdentifier.builder(ElanInstances.class).child(ElanInstance.class, new ElanInstanceKey(elanInstanceName)).augmentation(ElanServiceChainState.class).child(ElanToPseudoPortData.class, key).build();
if (addOrRemove == NwConstants.ADD_FLOW) {
ElanToPseudoPortData newValue = new ElanToPseudoPortDataBuilder().setKey(key).setElanLportTag(portTag).setScfTag(scfTag).build();
MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, path, newValue);
} else {
MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, path);
}
}
Aggregations