use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.GetDpidFromInterfaceInputBuilder in project genius by opendaylight.
the class InterfacemgrProvider method getDpnForInterface.
@Override
public BigInteger getDpnForInterface(String ifName) {
GetDpidFromInterfaceInput input = new GetDpidFromInterfaceInputBuilder().setIntfName(ifName).build();
Future<RpcResult<GetDpidFromInterfaceOutput>> output = interfaceManagerRpcService.getDpidFromInterface(input);
try {
RpcResult<GetDpidFromInterfaceOutput> dpn = output.get();
if (dpn.isSuccessful()) {
return dpn.getResult().getDpid();
}
} catch (NullPointerException | InterruptedException | ExecutionException e) {
LOG.warn("Exception when getting port for interface", e);
}
return null;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.GetDpidFromInterfaceInputBuilder in project netvirt by opendaylight.
the class InterfaceUtils method getDpnForInterface.
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.info("getDpnForInterface: Could not retrieve DPN Id for interface {}", ifName);
}
} catch (NullPointerException | InterruptedException | ExecutionException e) {
LOG.error("getDpnForInterface: Exception when getting dpn for interface {}", ifName, e);
}
return nodeId;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.GetDpidFromInterfaceInputBuilder in project netvirt by opendaylight.
the class NatUtil method getDpnForInterface.
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.debug("removeFromDpnRoutersMap : Could not retrieve DPN Id for interface {}", ifName);
}
} catch (NullPointerException | InterruptedException | ExecutionException e) {
LOG.error("removeFromDpnRoutersMap : Exception when getting dpn for interface {}", ifName, e);
}
return nodeId;
}
Aggregations