- /**
- * To check given dpId is already present in Elan instance. This can be used
- * to program flow entry in external tunnel table when a new access port
- * added for first time into the ELAN instance
- *
- * @param dpId
- * the dp id
- * @param elanInstanceName
- * the elan instance name
- * @return true if dpId is already present, otherwise return false
- */
- public boolean isDpnAlreadyPresentInElanInstance(BigInteger dpId, String elanInstanceName) {
- InstanceIdentifier<ElanDpnInterfacesList> elanDpnInterfaceId = getElanDpnOperationDataPath(elanInstanceName);
- Optional<ElanDpnInterfacesList> existingElanDpnInterfaces = read(broker,
- LogicalDatastoreType.OPERATIONAL, elanDpnInterfaceId);
- if (!existingElanDpnInterfaces.isPresent()) {
- return false;
- }
- List<DpnInterfaces> dpnInterfaces = existingElanDpnInterfaces.get().getDpnInterfaces();
- for (DpnInterfaces dpnInterface : dpnInterfaces) {
- if (dpnInterface.getDpId().equals(dpId)) {
- return true;
- }
- }
- return false;
- }
-
- public ElanForwardingTables getElanForwardingList() {
- InstanceIdentifier<ElanForwardingTables> elanForwardingTableId = InstanceIdentifier
- .builder(ElanForwardingTables.class).build();
- return read(broker, LogicalDatastoreType.OPERATIONAL, elanForwardingTableId).orNull();
- }
-