Table of Contents | ||
---|---|---|
|
...
Jira Legacy | ||||||||
---|---|---|---|---|---|---|---|---|
|
Decisions/Open Issues
Warning | ||
---|---|---|
| ||
It is very important that the SPI doesn't expose any database implementation for example database ID's |
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? |
|
| |
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 of the API 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))
When do we get attributes? | How do control how many attributes we get back? | We will have an (optional) output specification with the following options
|
5 | Should we use the name node or fragment? |
We decided on the name DataNode | ||
6 | Do we want to split the interface? | Maybe we could just have a 3 Alternatives
|
ENM SPI Study
Details about the ENM SPI can be found here: https://wiki.onap.org/pages/resumedraft.action?draftId=92998891&draftShareId=2f0190f4-bc97-47b7-bd82-6561f3606575&
NOTES
Proposed Future Implementation of CPS SPI
Data SPI
...
Definition
...
Capabilities
...
- getCpsPath
- getNamespace (see open issue no. 4)
- getRevision (see open issue no. 4)
- getSchemaNodeIdentifier (Type)
- equals
- hashCode
...
- getPersistenceObject
Gets the persistence layer object without any layers of decoration.
If the innermost object is not a persistence layer object then a suitable exception will be thrown.
- checkUserSuppliedAttributesAtCreation
Passes the attributes supplied by the user for a new persistence object so that they may be verified as required.
initializeAttributes
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
getAttributesSpecificallySet
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.
isAttributeSet
Determines if the supplied attribute has been specifically set (includes attributes which were set to null).
getAttributeNames
Gets all of the attribute names available in this persistence object.
unsetAttributes
Unsets the values of the supplied attributes.
- createDataspace
- getDataspaces
- getDataspace
- deleteDataspace
...
- findByName
- getByName
- existsByName
Dataspace SPI
...
Definition
...
Capabilities
...
DataspacePersistenceService
...
- createDataspace
- GetDataspace
- (GetDataspaces)
Fragment SPI
...
Definition
...
Capabilities
...
FragmentPersistenceService
...
- getByCpsPath
- createNode
- associateNodeToAnchor
- associateAnchorToDataspace
Module SPI
...
Definition
...
Capabilities
...
ModulePersistenceService
...
Adding functionality for handling attributes
...
getChildren
removeAllAssociations
Remove all associations of this persistence object.
- getNamespace
Retrieves the namespace of the type of object the type query is to target.
- storeModule
- createModuleSet
- deleteModule
- getModulesForDataspace
- getModuleRevisions
- findByNamespaceAndRevisionAndDataspace
- associateAnchorToModuleSet
- createAnchor
- getAnchors
- getAnchor
- deleteAnchor
- getModuleEntity
- getDataspace
...
- getModule
- getNamespace
- getType
- getName
- getVersion
- equals
- hashCode
Query SPI
Definition | Capabilities | 1 | QueryService |
Executes the query and presents the result as an iterator of objects queried for.
Executes the query and presents the result as a count of how many instances are matched against the query.
Deletes all matching objects and where appropriate deletes any children.
Retrieves the type of object that the type query is to target. | ||||
---|---|---|---|---|---|---|---|---|
2 | QueryPathService | Service responsible for dealing with path query related features |
executes the path query against the db. returns a list of type Object.
Executes the query ands gets the result as an iterable of 'full' objects queried. | |||||
3 | QueryBuilderService | Create queries using CPS query builder |
| |||||
4 | CpsRestriction | Creates a simple CPS restriction |
Gets the restriction used in the query criteria, including any internal restrictions added in addition to those set by the user.
Retrieves the name of the attribute that the restriction is. | |||||
5 | SimpleRestriction |
| 6 |
| 7 | LogicalRestriction | Implement logical restriction (AND/OR) and the negation of this logical restriction. |
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 |
7 | Do we need objects for very simple concept like dataspaceName which are just a string? |
| ||||||
8 | Should we share common objects between the Java API and SPI? | Alternatives
|
ENM SPI Study
Details about the ENM SPI can be found here: ENM Study
Interface Proposal
can be found at : Interface Proposal for CPS
Proposed Future Implementation of CPS SPI
DataStore SPI
Name | Capabilities | |
---|---|---|
1 | DataStoreService |
|
2 | DataNode Object |
|
CpsAdmin SPI
Name | Capabilities | |
---|---|---|
1 | CpsAdminService |
|
2 |
|
|
3 |
| |
4 |
| |
5 | Anchor Object |
|
Module SPI
Name | Capabilities | |
---|---|---|
1 | ModuleStoreService |
|
2 |
|
|
3 |
| |
4 |
| |
5 | ModuleSet |
|
Javadoc
View file | ||||
---|---|---|---|---|
|