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);
}
}
Aggregations