use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.GetPortFromInterfaceInputBuilder in project genius by opendaylight.
the class InterfacemgrProvider method getPortForInterface.
@Override
public Long getPortForInterface(Interface intf) {
GetPortFromInterfaceInput input = new GetPortFromInterfaceInputBuilder().setIntfName(intf.getName()).build();
Future<RpcResult<GetPortFromInterfaceOutput>> output = interfaceManagerRpcService.getPortFromInterface(input);
try {
RpcResult<GetPortFromInterfaceOutput> port = output.get();
if (port.isSuccessful()) {
return port.getResult().getPortno();
}
} catch (NullPointerException | InterruptedException | ExecutionException e) {
LOG.warn("Exception when getting port for interface", e);
}
return null;
}
Aggregations