Search in sources :

Example 1 with DefaultConnection

use of org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivityservice.DefaultConnection in project onos by opennetworkinglab.

the class TapiConnectivityServiceHandler method getChildModelObjectData.

@Override
public ModelObjectData getChildModelObjectData() {
    ConnectivityServiceKeys key = new ConnectivityServiceKeys();
    key.uuid(getId());
    DefaultConnection mObj = new DefaultConnection();
    ModelObjectId mId = ModelObjectId.builder().addChild(DefaultContext.class).addChild(DefaultConnectivityContext.class).addChild(DefaultConnectivityService.class, key).build();
    return DefaultModelObjectData.builder().addModelObject(mObj).identifier(mId).build();
}
Also used : DefaultConnection(org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivityservice.DefaultConnection) DefaultConnectivityService(org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivitycontext.DefaultConnectivityService) DefaultContext(org.onosproject.yang.gen.v1.tapicommon.rev20181210.tapicommon.DefaultContext) ConnectivityServiceKeys(org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivitycontext.ConnectivityServiceKeys) ModelObjectId(org.onosproject.yang.model.ModelObjectId)

Example 2 with DefaultConnection

use of org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivityservice.DefaultConnection in project onos by opennetworkinglab.

the class OdtnTapiHandlersTestCommand method setupTapiContext.

private void setupTapiContext() {
    DeviceId did1 = DeviceId.deviceId("netconf:127.0.0.1:11001");
    DeviceId did2 = DeviceId.deviceId("netconf:127.0.0.1:11002");
    ConnectPoint cp11 = new ConnectPoint(did1, PortNumber.portNumber(1, "TRANSCEIVER"));
    ConnectPoint cp12 = new ConnectPoint(did1, PortNumber.portNumber(2, "TRANSCEIVER"));
    ConnectPoint cp21 = new ConnectPoint(did2, PortNumber.portNumber(1, "TRANSCEIVER"));
    ConnectPoint cp22 = new ConnectPoint(did2, PortNumber.portNumber(2, "TRANSCEIVER"));
    // context
    contextHandler = TapiContextHandler.create();
    DefaultContext context = contextHandler.getModelObject();
    // context augmentation
    Augmentable augmentableContext = context;
    // context augmentation with topologyContext
    org.onosproject.yang.gen.v1.tapitopology.rev20181210.tapitopology.context.DefaultAugmentedTapiCommonContext augmentedTopologyContext = new org.onosproject.yang.gen.v1.tapitopology.rev20181210.tapitopology.context.DefaultAugmentedTapiCommonContext();
    augmentableContext.addAugmentation(augmentedTopologyContext);
    // context augmentation with connectivityServiceContext
    org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.context.DefaultAugmentedTapiCommonContext augmentedConnectivityContext = new org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.context.DefaultAugmentedTapiCommonContext();
    augmentableContext.addAugmentation(augmentedConnectivityContext);
    // topology context
    DefaultTopologyContext topologyContext = TapiTopologyContextHandler.create().getModelObject();
    augmentedTopologyContext.topologyContext(topologyContext);
    // topology
    TapiTopologyHandler topologyHandler = TapiTopologyHandler.create();
    topologyHandler.setId(Uuid.of("00000000-0000-0000-0000-000000000001"));
    DefaultTopology topology = topologyHandler.getModelObject();
    topologyContext.addToTopology(topology);
    // nodes
    TapiNodeHandler nodeHandler1 = TapiNodeHandler.create();
    nodeHandler1.setId(Uuid.of("00000000-0000-0000-0001-000000000001"));
    DefaultNode node1 = nodeHandler1.setTopologyUuid(topology.uuid()).setDeviceId(did1).getModelObject();
    topology.addToNode(node1);
    TapiNodeHandler nodeHandler2 = TapiNodeHandler.create();
    nodeHandler2.setId(Uuid.of("00000000-0000-0000-0001-000000000002"));
    DefaultNode node2 = nodeHandler2.setTopologyUuid(topology.uuid()).setDeviceId(did2).getModelObject();
    topology.addToNode(node2);
    // sips
    TapiSipHandler sipHandler1 = TapiSipHandler.create();
    sipHandler1.setId(Uuid.of("00000000-0000-0000-0002-000000000001"));
    DefaultServiceInterfacePoint sip1 = sipHandler1.setConnectPoint(cp11).getModelObject();
    context.addToServiceInterfacePoint(sip1);
    TapiSipHandler sipHandler2 = TapiSipHandler.create();
    sipHandler2.setId(Uuid.of("00000000-0000-0000-0002-000000000002"));
    DefaultServiceInterfacePoint sip2 = sipHandler2.setConnectPoint(cp21).getModelObject();
    context.addToServiceInterfacePoint(sip2);
    // neps
    TapiNepHandler nepHandler11 = TapiNepHandler.create();
    nepHandler11.setId(Uuid.of("00000000-0000-0000-0003-000000000011"));
    DefaultOwnedNodeEdgePoint nep11 = nepHandler11.setTopologyUuid(topology.uuid()).setNodeUuid(node1.uuid()).setConnectPoint(cp11).addSip(sip1.uuid()).getModelObject();
    nodeHandler1.addNep(nep11);
    TapiNepHandler nepHandler12 = TapiNepHandler.create();
    nepHandler12.setId(Uuid.of("00000000-0000-0000-0003-000000000012"));
    DefaultOwnedNodeEdgePoint nep12 = nepHandler12.setTopologyUuid(topology.uuid()).setNodeUuid(node1.uuid()).setConnectPoint(cp12).getModelObject();
    nodeHandler1.addNep(nep12);
    TapiNepHandler nepHandler21 = TapiNepHandler.create();
    nepHandler21.setId(Uuid.of("00000000-0000-0000-0003-000000000021"));
    DefaultOwnedNodeEdgePoint nep21 = nepHandler21.setTopologyUuid(topology.uuid()).setNodeUuid(node2.uuid()).setConnectPoint(cp21).addSip(sip2.uuid()).getModelObject();
    nodeHandler2.addNep(nep21);
    TapiNepHandler nepHandler22 = TapiNepHandler.create();
    nepHandler22.setId(Uuid.of("00000000-0000-0000-0003-000000000022"));
    DefaultOwnedNodeEdgePoint nep22 = nepHandler22.setTopologyUuid(topology.uuid()).setNodeUuid(node2.uuid()).setConnectPoint(cp22).getModelObject();
    nodeHandler2.addNep(nep22);
    // connectivity context
    DefaultConnectivityContext connectivityContext = TapiConnectivityContextHandler.create().getModelObject();
    augmentedConnectivityContext.connectivityContext(connectivityContext);
    // connectivityService
    TapiConnectivityServiceHandler connectivityServiceHandler = TapiConnectivityServiceHandler.create();
    connectivityServiceHandler.setId(Uuid.of("00000000-0000-0000-0004-000000000001"));
    DefaultConnectivityService connectivityService = connectivityServiceHandler.getModelObject();
    connectivityContext.addToConnectivityService(connectivityService);
    // connection
    TapiConnectionHandler connectionHandler = TapiConnectionHandler.create();
    connectionHandler.setId(Uuid.of("00000000-0000-0000-0005-000000000001"));
    DefaultConnection connection1 = connectionHandler.getModelObject();
    connectivityServiceHandler.addConnection(connection1.uuid());
    connectivityContext.addToConnection(connection1);
    // seps
    TapiSepHandler sepHandler1 = TapiSepHandler.create();
    sepHandler1.setId(Uuid.of("00000000-0000-0000-0006-000000000001"));
    DefaultEndPoint sep1 = sepHandler1.getModelObject();
    connectivityServiceHandler.addSep(sep1);
    TapiSepHandler sepHandler2 = TapiSepHandler.create();
    sepHandler2.setId(Uuid.of("00000000-0000-0000-0006-000000000002"));
    DefaultEndPoint sep2 = sepHandler2.getModelObject();
    connectivityServiceHandler.addSep(sep2);
    // ceps
    TapiCepHandler cepHandler11 = TapiCepHandler.create();
    cepHandler11.setId(Uuid.of("00000000-0000-0000-0007-000000000011"));
    org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.ceplist.DefaultConnectionEndPoint cep11 = cepHandler11.setTopologyUuid(topology.uuid()).setNodeUuid(node1.uuid()).setNepUuid(nep11.uuid()).setParentNep().getModelObject();
    nepHandler11.addCep(cep11);
    org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connection.DefaultConnectionEndPoint cepRef11 = TapiCepRefHandler.create().setCep(cep11).getModelObject();
    connectionHandler.addCep(cepRef11);
    TapiCepHandler cepHandler21 = TapiCepHandler.create();
    cepHandler21.setId(Uuid.of("00000000-0000-0000-0007-000000000021"));
    org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.ceplist.DefaultConnectionEndPoint cep21 = cepHandler21.setTopologyUuid(topology.uuid()).setNodeUuid(node1.uuid()).setNepUuid(nep21.uuid()).setParentNep().getModelObject();
    nepHandler21.addCep(cep21);
    org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connection.DefaultConnectionEndPoint cepRef21 = TapiCepRefHandler.create().setCep(cep21).getModelObject();
    connectionHandler.addCep(cepRef21);
}
Also used : DefaultTopology(org.onosproject.yang.gen.v1.tapitopology.rev20181210.tapitopology.topologycontext.DefaultTopology) DeviceId(org.onosproject.net.DeviceId) TapiConnectivityServiceHandler(org.onosproject.odtn.utils.tapi.TapiConnectivityServiceHandler) DefaultTopologyContext(org.onosproject.yang.gen.v1.tapitopology.rev20181210.tapitopology.context.augmentedtapicommoncontext.DefaultTopologyContext) TapiNepHandler(org.onosproject.odtn.utils.tapi.TapiNepHandler) TapiTopologyHandler(org.onosproject.odtn.utils.tapi.TapiTopologyHandler) DefaultOwnedNodeEdgePoint(org.onosproject.yang.gen.v1.tapitopology.rev20181210.tapitopology.node.DefaultOwnedNodeEdgePoint) TapiNodeHandler(org.onosproject.odtn.utils.tapi.TapiNodeHandler) DefaultNode(org.onosproject.yang.gen.v1.tapitopology.rev20181210.tapitopology.topology.DefaultNode) DefaultEndPoint(org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivityservice.DefaultEndPoint) DefaultConnectivityService(org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivitycontext.DefaultConnectivityService) TapiConnectionHandler(org.onosproject.odtn.utils.tapi.TapiConnectionHandler) DefaultServiceInterfacePoint(org.onosproject.yang.gen.v1.tapicommon.rev20181210.tapicommon.tapicontext.DefaultServiceInterfacePoint) TapiSipHandler(org.onosproject.odtn.utils.tapi.TapiSipHandler) ConnectPoint(org.onosproject.net.ConnectPoint) Augmentable(org.onosproject.yang.model.Augmentable) DefaultConnection(org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivitycontext.DefaultConnection) TapiCepHandler(org.onosproject.odtn.utils.tapi.TapiCepHandler) TapiSepHandler(org.onosproject.odtn.utils.tapi.TapiSepHandler) DefaultConnectivityContext(org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.context.augmentedtapicommoncontext.DefaultConnectivityContext) DefaultContext(org.onosproject.yang.gen.v1.tapicommon.rev20181210.tapicommon.DefaultContext)

Example 3 with DefaultConnection

use of org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivityservice.DefaultConnection in project onos by opennetworkinglab.

the class DcsBasedTapiConnectionManager method deleteConnection.

@Override
public void deleteConnection(TapiConnectionHandler connectionHandler) {
    // Retrieve the target to be deleted (right now we have the uuid)
    connectionHandler.read();
    // Remove Intent if exists
    if (connectionHandler.getLowerConnections().isEmpty()) {
        // Connection object
        DefaultConnection connection = connectionHandler.getModelObject();
        // These are two connection.ConnectionEndpoint (Actually Refs, mainly UUID)
        ConnectionEndPoint cepLeft = connection.connectionEndPoint().get(0);
        ConnectionEndPoint cepRight = connection.connectionEndPoint().get(1);
        TapiNepRef left = TapiNepRef.create(cepLeft.topologyUuid().toString(), cepLeft.nodeUuid().toString(), cepLeft.nodeEdgePointUuid().toString());
        TapiNepRef right = TapiNepRef.create(cepRight.topologyUuid().toString(), cepRight.nodeUuid().toString(), cepRight.nodeEdgePointUuid().toString());
        // update with latest data in DCS
        left = resolver.getNepRef(left);
        right = resolver.getNepRef(right);
        log.debug("Removing intent connection: {}", connection);
        notifyTapiConnectivityChange(connectionHandler.getId().toString(), left.getConnectPoint(), right.getConnectPoint(), false);
    }
    deleteConnectionRecursively(connectionHandler);
}
Also used : ConnectionEndPoint(org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connection.ConnectionEndPoint) DefaultConnection(org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivitycontext.DefaultConnection) TapiNepRef(org.onosproject.odtn.utils.tapi.TapiNepRef)

Example 4 with DefaultConnection

use of org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivityservice.DefaultConnection in project onos by opennetworkinglab.

the class TapiConnectionHandler method addLowerConnection.

public TapiConnectionHandler addLowerConnection(DefaultConnection connection) {
    DefaultLowerConnection lowerConnection = new DefaultLowerConnection();
    lowerConnection.connectionUuid(connection.uuid());
    obj.addToLowerConnection(lowerConnection);
    return this;
}
Also used : DefaultLowerConnection(org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connection.DefaultLowerConnection)

Example 5 with DefaultConnection

use of org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivityservice.DefaultConnection in project onos by opennetworkinglab.

the class TapiConnectivityServiceHandler method addConnection.

public TapiConnectivityServiceHandler addConnection(Uuid connectionUuid) {
    DefaultConnection connection = new DefaultConnection();
    connection.connectionUuid(connectionUuid.toString());
    obj.addToConnection(connection);
    return this;
}
Also used : DefaultConnection(org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivityservice.DefaultConnection)

Aggregations

DefaultContext (org.onosproject.yang.gen.v1.tapicommon.rev20181210.tapicommon.DefaultContext)2 DefaultConnection (org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivitycontext.DefaultConnection)2 DefaultConnectivityService (org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivitycontext.DefaultConnectivityService)2 DefaultConnection (org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivityservice.DefaultConnection)2 ConnectPoint (org.onosproject.net.ConnectPoint)1 DeviceId (org.onosproject.net.DeviceId)1 TapiCepHandler (org.onosproject.odtn.utils.tapi.TapiCepHandler)1 TapiConnectionHandler (org.onosproject.odtn.utils.tapi.TapiConnectionHandler)1 TapiConnectivityServiceHandler (org.onosproject.odtn.utils.tapi.TapiConnectivityServiceHandler)1 TapiNepHandler (org.onosproject.odtn.utils.tapi.TapiNepHandler)1 TapiNepRef (org.onosproject.odtn.utils.tapi.TapiNepRef)1 TapiNodeHandler (org.onosproject.odtn.utils.tapi.TapiNodeHandler)1 TapiSepHandler (org.onosproject.odtn.utils.tapi.TapiSepHandler)1 TapiSipHandler (org.onosproject.odtn.utils.tapi.TapiSipHandler)1 TapiTopologyHandler (org.onosproject.odtn.utils.tapi.TapiTopologyHandler)1 DefaultServiceInterfacePoint (org.onosproject.yang.gen.v1.tapicommon.rev20181210.tapicommon.tapicontext.DefaultServiceInterfacePoint)1 ConnectionEndPoint (org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connection.ConnectionEndPoint)1 DefaultLowerConnection (org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connection.DefaultLowerConnection)1 ConnectivityServiceKeys (org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivitycontext.ConnectivityServiceKeys)1 DefaultEndPoint (org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivityservice.DefaultEndPoint)1