You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 17 Next »

Jira Ticket:

CPS-37 - Getting issue details... STATUS


Decisions/Open Issues

Decoupling

It is very important that the SPI doesn't expose any database implementation for example database ID's


Description

Details

Decisions

1Assume flat attributes (no complex data types) but data could be stored as json object in SPI impl. for convenience/PoC

2SPI Implementation NOT using Model (service) current ENM SPI does!

3Are we going to have XPath/query builder?
  • We should decide based on what the users want to use/is easy to use
  • We don't want a query builder that eventually mimics XPaths functionality, use what is defined already XPATH sa a based but maybe supplement with a xpath-builder

4When do we get attributes?

How do control how many attributes we get back?

We will have an (optional) output specification with the following options

  1. Default is no attributes 
  2. All Attributes
  3. Specify attributes - output specification (filter)
5Should we use the name node or fragment?
We decided on the name DataNode
6Do we want to split the interface? 

Maybe we could just have a 

3 Alternatives 

  1. all in one interface
  2. Limited number of interfaces e.g Data Objects/ Data Persistence/Query
  3. Very fine grained (see below)
  1. DataStore SPI - methods to add data. 
    e.g dataStore.addChild(parentDataObject, childDataObject)
  2. CpsAdmin Interface will handle the dataspaces and anchors
  3. Module SPI - responsible for handling modules and module sets

The above will be in separate maven modules. Any data object they need will be in the same module.

We will not have a querybuilder in SPI but the SPI will have to understand the cpsPath. The java API will use a builder pattern to create a cpsPath

ENM SPI Study

Details about the ENM SPI can be found here: Spike


Proposed Future Implementation of CPS SPI

DataStore SPI


Name


 Capabilities

1DataStoreService
  • DataNode getDataNode(cpsPath)
  • Collection<DataNode> queryDataNodes(cpsPathQuery)
  • DataNode getDataNode(cpsPath,outputSpecification)
  • int count(cpsPath)
  • Void addDataNode(anchorName,dataNode)
  • Void addChild(cpsPathParent,dataNode)
  • Void addChildren(cpsPathParent,dataNode...)
  • Void updateDataNode(anchorName,dataNode)
  • Void setAttribute(cpsPath,attributeName,value)
  • Void deleteDataNode(cpsPath)
2DataNode Object
  • DataNode createDataNode(DataNode)
  • String getCpsPath()
  • DataNode getAttributes()
  • DataNode getAttribute(name)
  • Void setAttributes()
  • Void setAttribute(name)
  • Module getModule(moduleName)

CpsAdmin SPI


Name


 Capabilities

1

DataspacePersistenceService


  • Void createDataspace(dataspaceName)
  • Void getDataspace(dataspaceName)
  • Void getDataspaces()
  • boolean exists(dataspaceName)
2AnchorPersistenceService
  • Void createAnchor(dataspaceName, anchorName)
  • Anchor getAnchors()
  • Anchor getAnchor(anchorName)
  • Void deleteAnchor(anchorName)
  • Void associateAnchor(anchorName, moduleSetName)
  • Void associateAnchor(anchorName, moduleRef)
  • Void addDataNode(anchorName, dataNode)
3Dataspace (object)
  • Void createDataspace(dataspaceName)
  • String getName(Dataspace)
4Anchor Object
  • Void createAnchor(anchorName)
  • String getName(Anchor)

Module SPI


Name


 Capabilities

1

ModulePersistenceService


  • Void createModuleSet(file)
  • Void addModule(moduleRef, content)
  • Void addModule(moduleSetName, moduleRef, content)
  • Void deleteModule(moduleRef)
  • YangModule getModule(moduleRef)
  • Collection<YangModule> getModules(moduleSetName)
2YangModule
  • ModuleRef getModuleRef(moduleRef)
  • String getModuleContent(moduleRef)
3ModuleRef
  • String getNamespace(moduleRef)
  • String getRevision(moduleRef)
4ModuleSet
  • String getName(moduleRef)
  • Collection<ModuleRef> getModuleRefs()
  • No labels