Search in sources :

Example 1 with TapiGetSipListOutputHandler

use of org.onosproject.odtn.utils.tapi.TapiGetSipListOutputHandler in project onos by opennetworkinglab.

the class DcsBasedTapiCommonRpc method getServiceInterfacePointList.

/**
 * Service interface of getServiceInterfacePointList.
 *
 * @param rpcInput input of service interface getServiceInterfacePointList
 * @return rpcOutput output of service interface getServiceInterfacePointList
 */
@Override
public RpcOutput getServiceInterfacePointList(RpcInput rpcInput) {
    try {
        TapiGetSipListOutputHandler output = TapiGetSipListOutputHandler.create();
        resolver.getNepRefs().stream().filter(nepRef -> nepRef.getSipId() != null).forEach(nepRef -> {
            output.addSip(Uuid.fromString(nepRef.getSipId()));
        });
        return new RpcOutput(RpcOutput.Status.RPC_SUCCESS, output.getDataNode());
    } catch (Throwable e) {
        log.error("Error:", e);
        return new RpcOutput(RpcOutput.Status.RPC_FAILURE, null);
    }
}
Also used : DynamicConfigService(org.onosproject.config.DynamicConfigService) DefaultServiceDirectory.getService(org.onlab.osgi.DefaultServiceDirectory.getService) RpcInput(org.onosproject.yang.model.RpcInput) Logger(org.slf4j.Logger) TapiResolver(org.onosproject.odtn.TapiResolver) ModelConverter(org.onosproject.yang.model.ModelConverter) LoggerFactory(org.slf4j.LoggerFactory) TapiCommonService(org.onosproject.yang.gen.v1.tapicommon.rev20181210.TapiCommonService) TapiGetSipListOutputHandler(org.onosproject.odtn.utils.tapi.TapiGetSipListOutputHandler) RpcOutput(org.onosproject.yang.model.RpcOutput) Uuid(org.onosproject.yang.gen.v1.tapicommon.rev20181210.tapicommon.Uuid) RpcOutput(org.onosproject.yang.model.RpcOutput) TapiGetSipListOutputHandler(org.onosproject.odtn.utils.tapi.TapiGetSipListOutputHandler)

Aggregations

DefaultServiceDirectory.getService (org.onlab.osgi.DefaultServiceDirectory.getService)1 DynamicConfigService (org.onosproject.config.DynamicConfigService)1 TapiResolver (org.onosproject.odtn.TapiResolver)1 TapiGetSipListOutputHandler (org.onosproject.odtn.utils.tapi.TapiGetSipListOutputHandler)1 TapiCommonService (org.onosproject.yang.gen.v1.tapicommon.rev20181210.TapiCommonService)1 Uuid (org.onosproject.yang.gen.v1.tapicommon.rev20181210.tapicommon.Uuid)1 ModelConverter (org.onosproject.yang.model.ModelConverter)1 RpcInput (org.onosproject.yang.model.RpcInput)1 RpcOutput (org.onosproject.yang.model.RpcOutput)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1