Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Maybe we dont need this because we dont have complex data attributes

We have 6 /NodeperistenceStoreChange Data SPI to DataStore - methods to add data.  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 sets


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

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))

5When 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 DataNode7
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)
  1. CpsAdmin Interface will handle the dataspaces and anchors
  2. 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

...


Name


Definition

 Capabilities

1DataStoreObjectDataStoreServiceProvides 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
2PersistenceStoreAdding 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.

  • 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:

  1. it verifies all mandatory attributes have been supplied

  2. it initializes all non-supplied attributes to their default value where relevant

  3. 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:

  1. were supplied at creation of the object or

  2. had default values applied during creation or

  3. 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.

  • getByCpsPath
  • createDataNode
  • associateDataNodeToAnchor
  • associateAnchorToDataspace
  • getDataNode(cpsPath)
  • getDataNode(cpsPath,outputSpecification)
  • count(CpsPath)
  • addDataNode(anchorName,dataNode)
  • addChild(cpsPathParent,dataNode)
  • addChildren(cpsPathParent,dataNode...)
  • updateDataNode(anchorName,dataNode)
  • setAttribute(cpsPath,attributeName,value)
  • deleteDataNode(cpsPath)
2DataNode Object
  • createDataNode()
  • getCpsPath()
  • getAttributes()
  • getAttribute(name)
  • getModule()

CpsAdmin SPI


Name


Definition

 Capabilities

1

DataspacePersistenceService



  • createDataspace
  • GetDataspace(dataspaceName)
  • GetDataspaces(GetDataspaces)CpsAdmin

The below are currently in our SPI

  • findByName
  • getByName
  • existsByName
2AnchorPersistenceService
  • createAnchor
  • getAnchors
  • getAnchor
  • deleteAnchor
  • associateAnchorToModuleSet
  • associateDataNodeToAnchor
  • associateAnchorToDataspace
3Dataspace Object
  • createDataSpace()
  • getCpsPath()
  • getAttributes()
  • getAttribute(name)
  • getModule()
4Anchor Object
  • createAnchor()
  • getCpsPath()
  • getAttributes()
  • getAttribute(name)
  • getModule()

Module SPI


Name


Definition

 Capabilities

1

ModulePersistenceService


Adding functionality for handling attributes

  • createModule
  • getChildrencreateModuleSet
  • 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
    • getChild
    • getChildren

    • getNamespace
    • storeModule
    • deleteModule
    • getModuleEntity
    • getDataspace
    2BasicModuleObjectCreate a simple CPS Module Object
    • getModule
    • getNamespace
    • getType
    • getName
    • getVersion
    • equals
    • hashCode

    ...