use of org.onosproject.odtn.utils.tapi.TapiContextHandler in project onos by opennetworkinglab.
the class DcsBasedTapiConnectivityRpc method getUsedSips.
/**
* Get used SIPs.
*
* @return list of used SIPs
*/
private List<String> getUsedSips() {
TapiContextHandler handler = TapiContextHandler.create();
handler.read();
List<String> usedSips = new ArrayList();
handler.getConnectivityServices().stream().forEach(connectivityService -> connectivityService.getEndPoint().stream().forEach(endPoint -> usedSips.add(endPoint.serviceInterfacePoint().serviceInterfacePointUuid().toString())));
log.debug("usedSips: {}", usedSips);
return usedSips;
}
use of org.onosproject.odtn.utils.tapi.TapiContextHandler 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);
}
}
use of org.onosproject.odtn.utils.tapi.TapiContextHandler in project onos by opennetworkinglab.
the class DcsBasedTapiTopologyManager method initDcsTapiContext.
/**
* Add Tapi Context to Dcs store.
*/
private void initDcsTapiContext() {
TapiContextHandler contextHandler = TapiContextHandler.create();
context = contextHandler.getModelObject();
contextHandler.add();
}
Aggregations