- /**
- * Retrieves the acl matching the key from the data store.
- *
- * @param broker the data broker
- * @param aclKey the acl key
- * @return the acl
- */
- public static Acl getAcl(DataBroker broker, String aclKey) {
- return read(broker, LogicalDatastoreType.CONFIGURATION, getAclInstanceIdentifier(aclKey)).orNull();
- }
-
- /** Creates the Acl instance identifier.
- *
- * @param aclKey the acl key
- * @return the instance identifier
- */
- public static InstanceIdentifier<Acl> getAclInstanceIdentifier(String aclKey) {
- return InstanceIdentifier.builder(AccessLists.class).child(Acl.class, new AclKey(aclKey, Ipv4Acl.class))
- .build();
- }
-
- /**
- * Get the data path number for the interface.
- * @param interfaceManagerRpcService interfaceManagerRpcService instance.
- * @param ifName the interface name.
- * @return the dpn.
- */
- public static BigInteger getDpnForInterface(OdlInterfaceRpcService interfaceManagerRpcService, String ifName) {
- BigInteger nodeId = BigInteger.ZERO;
- try {
- GetDpidFromInterfaceInput dpIdInput =
- new GetDpidFromInterfaceInputBuilder().setIntfName(ifName).build();
- Future<RpcResult<GetDpidFromInterfaceOutput>> dpIdOutput =
- interfaceManagerRpcService.getDpidFromInterface(dpIdInput);
- RpcResult<GetDpidFromInterfaceOutput> dpIdResult = dpIdOutput.get();
- if (dpIdResult.isSuccessful()) {
- nodeId = dpIdResult.getResult().getDpid();
- } else {
- LOG.error("Could not retrieve DPN Id for interface {}", ifName);
- }
- } catch (NullPointerException | InterruptedException | ExecutionException e) {
- LOG.error("Exception when getting dpn for interface {}", ifName, e);
- }
- return nodeId;
- }
-