Versions Compared

Key

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

...

The payload will be represented as Generic objects/documents. For more reasoning and discussion, see Data Representation

In java, the CPSDataObject will be a 'glorified' map -- not a basic map, but one level more concrete (in terms of abstractions). I.e. at the language level
Sample methods:The sample java code below illustrates ubiquitous use of the CPSDataObject.

Code Block
languagejava
public class CPSDataObject extends Map {...}

CPSDataObject tree = cps.getTree(obj, level, filter)
List<CPSDataObject> refs = cps.getRefs(obj)
CPSDataObject parent = cps.getParent(obj)
List<CPSDataObject> children = cps.getChildren(obj)

Filters will be encoded as XPath expressions.

YANG <-> Java type mapping will be inherited from the selection of YANG parser

For javaREST, the payload will be a document complying to a generic JSON schema.

The style of the interface will be such that access methods are associated with the CPS. Data is provided as context. For more reasoning and discussion, see Interface style.

The pseudo Java code below illustrates this style by showing how complementary relationships could be navigated.

Code Block
languagejava
CPSDataObject cpsRootObject = CPS.getRootObject(uuid_to_identify_inventory_item);
System.out.println(cpsRootObject);
List<CPSDataObject> kids = CPS.getChildren(cpsRootObject);
for (CPSDataObject kid: kids) {
	System.out.println(CPS.getParent(kid));
}
REST payload structure
Java payload structure

...