...
| Description | Details | Decisions |
---|
1 | Assume flat attributes (no complex data types) but data could be stored as json object in SPI impl. for convenience/PoC |
|
|
2 | SPI Implementation NOT using Model (service) current ENM SPI does! |
|
|
3 | Are 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 as a based but maybe supplement with a xpath-builder
|
|
4 | Having a fluent interface in my opinion would be way more intuitive and practical. E.g.
//AND of two restrictions
Restriction and(Restriction firstRestriction, Restriction secondRestriction)
//OR of two restrictions
Restriction or(Restriction firstRestriction, Restriction secondRestriction)
//NOT of a restriction
Restriction not(Restriction restriction)
This will give any user of the API an intuitive way to build a complex query and the developer a tree to navigate and translate to SQL (or any other query language). A developer could do something the likes of myQuery.setRestriction(restriction1.and(restrcition2).and(restriction3)) | 5 | When do we get attributes? | How do control how many attributes we get back? | Maybe we dont need this because we dont have complex data attributes | We will have an (optional) output specification with the following options - Default is no attributes
- All Attributes
- Specify attributes - output specification (filter)
|
65 | Should we use the name node or fragment? |
| We decided on the name DataNode | /Node | 7
6 | Do we want to split the interface? | Maybe we could just have a 3 Alternatives - all in one interface
- Limited number of interfaces e.g Data Objects/ Data Persistence/Query
- Very fine grained (see below)
| peristenceStore- DataStore SPI - methods to add data.
e.g dataStore.addChild(parentDataObject, childDataObject)
| Change Data SPI to DataStore - methods to add data. - CpsAdmin Interface will handle the dataspaces and anchors
- 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 | query.API - construct the CPS path
SPI - deconstruct it and convert it into a query
From an end user perspective anchor and fragment are different - we should separate them
CpsAdmin Interface will handle the datastore and anchor
access control? extend the CpsAdmin
Module SPI - responsible for handling modules and module setscpsPath. The java API will use a builder pattern to create a cpsPath |
7 | Do we need objects for very simple concept like dataspaceName which are just a string? |
| - We will not use objects for name fields. We will just use Strings.
- We may need an object for AnchorName
|
8 | Should we share common objects between the Java API and SPI? | Alternatives - API depends on model objects defined in SPI
- SPI depends on model objects defined in API
- Extract common model API in separate module (deliverable)
- Use separate models with slightly different names e.g Anchor in API and AnchorDetails in SPI (CPService will transfer when needed)
|
|
ENM SPI Study
Details about the ENM SPI can be found here: ENM Study
Interface Proposal
can be found at : SpikeInterface Proposal for CPS
Proposed Future Implementation of CPS SPI
DataStore SPI
| Name Definition
| Capabilities |
---|
1 | DataStoreObject | Provides the basic information needed to access an object. | - getCpsPath
- getNamespace (see open issue no. 4)
- getRevision (see open issue no. 4)
- getSchemaNodeIdentifier (Type)
- equals
- hashCode
|
2 | PersistenceStore | Adding functionality for handling attributes | - checkUserSuppliedAttributesAtCreation
Passes the attributes supplied by the user for a new persistence object so that they may be verified as required. Initializes the attributes for a new persistence object. This method should be invoked when creating a new persistence object rather than using setAttributes() as it will have different behavior, namely: it verifies all mandatory attributes have been supplied it initializes all non-supplied attributes to their default value where relevant no notifications will be sent as a result of this method being called
Gets the values for the attributes which have been specifically set on this object. This includes attributes which: were supplied at creation of the object or had default values applied during creation or were specifically set after creation by invoking one of the setAttribute(s) methods.
Note that an attribute may have been specifically set to null so the values returned in the map may contain nulls. Determines if the supplied attribute has been specifically set (includes attributes which were set to null). Gets all of the attribute names available in this persistence object. Unsets the values of the supplied attributes. - getByCpsPath
- createDataNode
- associateDataNodeToAnchor
- associateAnchorToDataspace
|
CpsAdmin SPI
...
Definition
...
Capabilities
...
DataspacePersistenceService
...
- createDataspace
- GetDataspace
- (GetDataspaces)
- CpsAdmin
- findByName
- getByName
- existsByName
...
- createAnchor
- getAnchors
- getAnchor
- deleteAnchor
Module SPI
...
Definition
...
Capabilities
...
ModulePersistenceService
...
Adding functionality for handling attributes
...
getChildren
removeAllAssociations
Remove all associations of this persistence object.
Retrieves the namespace of the type of object the type query is to target.
- storeModule
- createModuleSet
- deleteModule
- getModulesForDataspace
- getModuleRevisions
- findByNamespaceAndRevisionAndDataspace
- associateAnchorToModuleSet
- getModuleEntity
- getDataspace
DataStoreService | - String addDataNode(String dataspaceName, String anchorName, DataNode dataNode);
- String addDataNode(String dataspaceName, String anchorName, String xPath, DataNode dataNode);
- String getCpsPath(String dataspaceName, String anchorName, DataNode dataNode);
- String getCpsPath(String dataspaceName, String anchorName, DataNode dataNode);
- DataNode getDataNode(String dataspaceName, String anchorName, String xPathId);
- Collection<DataNode> queryDataNodes(String dataspaceName, String anchorName, String cpsPath);
- Collection<DataNode> queryDataNodes(String dataspaceName, String anchorName, String cpsPath, String outputSpecification);
- Integer count(String dataspaceName, String anchorName, String cpsPath);
- Integer count(String dataspaceName, String cpsPath);
- void updateDataNode(String dataspaceName, String anchorName, DataNode dataNode);
- void setLeaf(String dataspaceName, String anchorName, String xPathId, String leafName, Object leafValue);
- Void deleteDataNode(String dataspaceName, String anchorName, String xPathId);
|
2 | DataNode Object | - DataNode createDataNode(DataNode)
- String getCpsPath()
- DataNode getAttributes()
- DataNode getAttribute(name)
- Void setAttributes()
- Void setAttribute(name)
- Module getModule(moduleName)
|
CpsAdmin SPI
| Name
| Capabilities |
---|
1 | CpsAdminService | - String createDataspace(String dataspaceName);
- String createAnchor(String dataspaceName, String anchorName);
- List<String> getDataspaces();
- Collection<Anchor> getAnchors(String dataspaceName);
- Anchor getAnchor(String dataspaceName, String anchorName);
- void deleteAnchor(String dataspaceName, String anchorName);
- void associateAnchorToModuleSet(String dataspaceName, String moduleSetName, String anchorName);
- boolean exists(String dataspaceName);
|
2 | DataspacePersistenceService
| Void createDataspace(dataspaceName)Void getDataspace(dataspaceName)Void getDataspaces()boolean exists(dataspaceName)
|
3 | AnchorPersistenceService | Void createAnchor(dataspaceName, anchorName)Anchor getAnchors()Anchor getAnchor(anchorName)Void deleteAnchor(anchorName)Void associateAnchor(anchorName, moduleSetName)Void associateAnchor(anchorName, moduleRef)Void addDataNode(anchorName, dataNode)
|
4 | Dataspace (object) | Void createDataspace(dataspaceName)String getName(Dataspace)
|
5 | Anchor Object | - Void createAnchor(anchorName)
- String getName(Anchor)
|
Module SPI
| Name
| Capabilities |
---|
1 | ModuleStoreService | - Collection<String> getModules(String dataspaceName, String moduleSetName);
- Collection<ModuleRef> getModuleRefs(String dataspaceName, String moduleSetName);
- Void deleteModuleSet(String dataspaceName, String moduleSetName);
|
2 | ModulePersistenceService
| YangModule getModule(moduleRef)Collection<YangModule> getModules(moduleSetName)
|
3 | YangModule | ModuleRef getModuleRef(moduleRef)String getModuleContent(moduleRef)
|
4 | ModuleRef | String getNamespace(moduleRef)String getRevision(moduleRef)
|
5 | ModuleSet | - String getName(moduleRef)
- Collection<ModuleRef> getModuleRefs()
|
Javadoc
...