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