Search in sources :

Example 1 with TapiContextHandler

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;
}
Also used : TapiConnectivityService(org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.TapiConnectivityService) TapiConnectivityServiceHandler(org.onosproject.odtn.utils.tapi.TapiConnectivityServiceHandler) LoggerFactory(org.slf4j.LoggerFactory) Collections.disjoint(java.util.Collections.disjoint) TapiCreateConnectivityInputHandler(org.onosproject.odtn.utils.tapi.TapiCreateConnectivityInputHandler) ArrayList(java.util.ArrayList) TapiDeleteConnectivityInputHandler(org.onosproject.odtn.utils.tapi.TapiDeleteConnectivityInputHandler) TapiSepHandler(org.onosproject.odtn.utils.tapi.TapiSepHandler) TapiConnectionHandler(org.onosproject.odtn.utils.tapi.TapiConnectionHandler) DynamicConfigService(org.onosproject.config.DynamicConfigService) TapiNepPair(org.onosproject.odtn.utils.tapi.TapiNepPair) DefaultServiceDirectory.getService(org.onlab.osgi.DefaultServiceDirectory.getService) RpcInput(org.onosproject.yang.model.RpcInput) Logger(org.slf4j.Logger) TapiCreateConnectivityOutputHandler(org.onosproject.odtn.utils.tapi.TapiCreateConnectivityOutputHandler) TapiResolver(org.onosproject.odtn.TapiResolver) ModelConverter(org.onosproject.yang.model.ModelConverter) TapiObjectHandler(org.onosproject.odtn.utils.tapi.TapiObjectHandler) DefaultConnectivityService(org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivitycontext.DefaultConnectivityService) Collectors(java.util.stream.Collectors) TapiNepRef(org.onosproject.odtn.utils.tapi.TapiNepRef) RpcOutput(org.onosproject.yang.model.RpcOutput) TapiGetConnectivityListOutputHandler(org.onosproject.odtn.utils.tapi.TapiGetConnectivityListOutputHandler) Uuid(org.onosproject.yang.gen.v1.tapicommon.rev20181210.tapicommon.Uuid) TapiGetConnectivityDetailsOutputHandler(org.onosproject.odtn.utils.tapi.TapiGetConnectivityDetailsOutputHandler) TapiGetConnectivityDetailsInputHandler(org.onosproject.odtn.utils.tapi.TapiGetConnectivityDetailsInputHandler) List(java.util.List) TapiContextHandler(org.onosproject.odtn.utils.tapi.TapiContextHandler) TapiContextHandler(org.onosproject.odtn.utils.tapi.TapiContextHandler) ArrayList(java.util.ArrayList)

Example 2 with TapiContextHandler

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);
    }
}
Also used : TapiGetConnectivityListOutputHandler(org.onosproject.odtn.utils.tapi.TapiGetConnectivityListOutputHandler) TapiContextHandler(org.onosproject.odtn.utils.tapi.TapiContextHandler) RpcOutput(org.onosproject.yang.model.RpcOutput)

Example 3 with TapiContextHandler

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();
}
Also used : TapiContextHandler(org.onosproject.odtn.utils.tapi.TapiContextHandler)

Aggregations

TapiContextHandler (org.onosproject.odtn.utils.tapi.TapiContextHandler)3 TapiGetConnectivityListOutputHandler (org.onosproject.odtn.utils.tapi.TapiGetConnectivityListOutputHandler)2 RpcOutput (org.onosproject.yang.model.RpcOutput)2 ArrayList (java.util.ArrayList)1 Collections.disjoint (java.util.Collections.disjoint)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 DefaultServiceDirectory.getService (org.onlab.osgi.DefaultServiceDirectory.getService)1 DynamicConfigService (org.onosproject.config.DynamicConfigService)1 TapiResolver (org.onosproject.odtn.TapiResolver)1 TapiConnectionHandler (org.onosproject.odtn.utils.tapi.TapiConnectionHandler)1 TapiConnectivityServiceHandler (org.onosproject.odtn.utils.tapi.TapiConnectivityServiceHandler)1 TapiCreateConnectivityInputHandler (org.onosproject.odtn.utils.tapi.TapiCreateConnectivityInputHandler)1 TapiCreateConnectivityOutputHandler (org.onosproject.odtn.utils.tapi.TapiCreateConnectivityOutputHandler)1 TapiDeleteConnectivityInputHandler (org.onosproject.odtn.utils.tapi.TapiDeleteConnectivityInputHandler)1 TapiGetConnectivityDetailsInputHandler (org.onosproject.odtn.utils.tapi.TapiGetConnectivityDetailsInputHandler)1 TapiGetConnectivityDetailsOutputHandler (org.onosproject.odtn.utils.tapi.TapiGetConnectivityDetailsOutputHandler)1 TapiNepPair (org.onosproject.odtn.utils.tapi.TapiNepPair)1 TapiNepRef (org.onosproject.odtn.utils.tapi.TapiNepRef)1 TapiObjectHandler (org.onosproject.odtn.utils.tapi.TapiObjectHandler)1