Search in sources :

Example 1 with TapiGetConnectivityListOutputHandler

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

the class DcsBasedTapiConnectivityRpc method getConnectivityServiceList.

/**
 * Service interface of getConnectivityServiceList.
 *
 * @param inputVar input of service interface getConnectivityServiceList
 * @return output of service interface getConnectivityServiceList
 */
@Override
public RpcOutput getConnectivityServiceList(RpcInput inputVar) {
    try {
        TapiGetConnectivityListOutputHandler output = TapiGetConnectivityListOutputHandler.create();
        log.info("get list called");
        TapiContextHandler handler = TapiContextHandler.create();
        handler.read();
        log.info("model : {}", handler.getModelObject());
        log.info("conserv : {}", handler.getConnectivityServices());
        handler.getConnectivityServices().stream().map(TapiObjectHandler::getModelObject).forEach(output::addService);
        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 : TapiGetConnectivityListOutputHandler(org.onosproject.odtn.utils.tapi.TapiGetConnectivityListOutputHandler) TapiContextHandler(org.onosproject.odtn.utils.tapi.TapiContextHandler) RpcOutput(org.onosproject.yang.model.RpcOutput)

Aggregations

TapiContextHandler (org.onosproject.odtn.utils.tapi.TapiContextHandler)1 TapiGetConnectivityListOutputHandler (org.onosproject.odtn.utils.tapi.TapiGetConnectivityListOutputHandler)1 RpcOutput (org.onosproject.yang.model.RpcOutput)1