use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.GetMappingWithXtrIdOutputBuilder in project lispflowmapping by opendaylight.
the class MappingService method getMappingWithXtrId.
@Override
public Future<RpcResult<GetMappingWithXtrIdOutput>> getMappingWithXtrId(GetMappingWithXtrIdInput input) {
Preconditions.checkNotNull(input, "get-mapping RPC input must be not null!");
LOG.trace("RPC received to get the following mapping: " + input.toString());
RpcResultBuilder<GetMappingWithXtrIdOutput> rpcResultBuilder;
MappingData reply = mappingSystem.getMapping(null, convertToBinaryIfNecessary(input.getEid()), input.getXtrId());
if (reply == null) {
String message = "No mapping was found in the mapping database";
rpcResultBuilder = RpcResultBuilder.<GetMappingWithXtrIdOutput>failed().withError(RpcError.ErrorType.APPLICATION, NOT_FOUND_TAG, message);
} else {
final MappingRecord convertedReply = convertFromBinaryIfNecessary(reply.getRecord());
rpcResultBuilder = RpcResultBuilder.success(new GetMappingWithXtrIdOutputBuilder().setMappingRecord(convertedReply));
}
return Futures.immediateFuture(rpcResultBuilder.build());
}
Aggregations