Search in sources :

Example 1 with ModelObjectId

use of org.onosproject.yang.model.ModelObjectId in project onos by opennetworkinglab.

the class DcsBasedTapiDataProducer method readContextModelObject.

/**
 * Get Tapi context modelObject from Dcs.
 *
 * @return Tapi context modelObject in Dcs store
 */
// FIXME update this method using TapiContextHandler
private DefaultContext readContextModelObject() {
    // read DataNode from DCS
    ModelObjectId mid = ModelObjectId.builder().addChild(DefaultContext.class).build();
    DataNode node = dcs.readNode(getResourceId(mid), Filter.builder().build());
    // convert to ModelObject
    ResourceData data = DefaultResourceData.builder().addDataNode(node).resourceId(ResourceId.builder().build()).build();
    ModelObjectData modelData = modelConverter.createModel(data);
    DefaultContext context = (DefaultContext) modelData.modelObjects().get(0);
    return context;
}
Also used : ResourceData(org.onosproject.yang.model.ResourceData) DefaultResourceData(org.onosproject.yang.model.DefaultResourceData) DataNode(org.onosproject.yang.model.DataNode) DefaultModelObjectData(org.onosproject.yang.model.DefaultModelObjectData) ModelObjectData(org.onosproject.yang.model.ModelObjectData) DefaultContext(org.onosproject.yang.gen.v1.tapicommon.rev20181210.tapicommon.DefaultContext) ModelObjectId(org.onosproject.yang.model.ModelObjectId)

Example 2 with ModelObjectId

use of org.onosproject.yang.model.ModelObjectId in project onos by opennetworkinglab.

the class TapiConnectionHandler method getChildModelObjectData.

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

Example 3 with ModelObjectId

use of org.onosproject.yang.model.ModelObjectId 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 4 with ModelObjectId

use of org.onosproject.yang.model.ModelObjectId in project onos by opennetworkinglab.

the class TapiContextHandler method getChildModelObjectData.

@Override
public ModelObjectData getChildModelObjectData() {
    ModelObjectId mId = ModelObjectId.builder().addChild(DefaultContext.class).build();
    DefaultTopologyContext mObj = new DefaultTopologyContext();
    return DefaultModelObjectData.builder().addModelObject(mObj).identifier(mId).build();
}
Also used : DefaultTopologyContext(org.onosproject.yang.gen.v1.tapitopology.rev20181210.tapitopology.context.augmentedtapicommoncontext.DefaultTopologyContext) DefaultContext(org.onosproject.yang.gen.v1.tapicommon.rev20181210.tapicommon.DefaultContext) ModelObjectId(org.onosproject.yang.model.ModelObjectId)

Example 5 with ModelObjectId

use of org.onosproject.yang.model.ModelObjectId in project onos by opennetworkinglab.

the class OdtnDcsModelCheckCommand method dumpDcsStore.

private <T extends InnerModelObject> void dumpDcsStore(Class<T> cls) {
    ModelObjectId mid = ModelObjectId.builder().addChild(cls).build();
    DataNode all = dcs.readNode(getResourceId(mid), Filter.builder().build());
    ResourceId empty = ResourceId.builder().build();
    CharSequence strNode = toCharSequence(toXmlCompositeStream(toCompositeData(toResourceData(empty, all))));
    printlog("XML:\n{}", XmlString.prettifyXml(strNode));
}
Also used : ResourceId(org.onosproject.yang.model.ResourceId) DataNode(org.onosproject.yang.model.DataNode) YangToolUtil.toCharSequence(org.onosproject.odtn.utils.YangToolUtil.toCharSequence) ModelObjectId(org.onosproject.yang.model.ModelObjectId)

Aggregations

ModelObjectId (org.onosproject.yang.model.ModelObjectId)6 DefaultContext (org.onosproject.yang.gen.v1.tapicommon.rev20181210.tapicommon.DefaultContext)4 DataNode (org.onosproject.yang.model.DataNode)2 YangToolUtil.toCharSequence (org.onosproject.odtn.utils.YangToolUtil.toCharSequence)1 DefaultConnectionEndPoint (org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connection.DefaultConnectionEndPoint)1 ConnectionKeys (org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivitycontext.ConnectionKeys)1 ConnectivityServiceKeys (org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivitycontext.ConnectivityServiceKeys)1 DefaultConnection (org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivitycontext.DefaultConnection)1 DefaultConnectivityService (org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivitycontext.DefaultConnectivityService)1 DefaultConnection (org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.tapiconnectivity.connectivityservice.DefaultConnection)1 DefaultTopologyContext (org.onosproject.yang.gen.v1.tapitopology.rev20181210.tapitopology.context.augmentedtapicommoncontext.DefaultTopologyContext)1 DefaultModelObjectData (org.onosproject.yang.model.DefaultModelObjectData)1 DefaultResourceData (org.onosproject.yang.model.DefaultResourceData)1 ModelObject (org.onosproject.yang.model.ModelObject)1 ModelObjectData (org.onosproject.yang.model.ModelObjectData)1 ResourceData (org.onosproject.yang.model.ResourceData)1 ResourceId (org.onosproject.yang.model.ResourceId)1