Added Json to CompositeNode translation 36/2736/2
authormsunal <msunal@cisco.com>
Thu, 14 Nov 2013 13:50:51 +0000 (14:50 +0100)
committermsunal <msunal@cisco.com>
Thu, 14 Nov 2013 16:29:50 +0000 (17:29 +0100)
commit1c2a0d378926c94951387932f5b98fc35b22fa66
treeab590ef65770a7257fafddf78bc7d11c0a02ad35
parent83291dd59ee117454596081f09e1248e89551020
Added Json to CompositeNode translation

- added JsonReader.java to provide translation from Json (InputStream) to CompositeNode
- Json has to be in one of these two formats:
  {"foo":{....}} for Container foo
  {"foo":[{....}]} for List foo
- added preconditions to translation from Node to Json:
  Data of Container and List has to be represented as CompositeNode
  Data of LeafList and Leaf has to be represented as SimpleNode
- request for unexisting data has response - not found 404

Change-Id: I9f2a07a0d333b09803606e0e4275bdf39d2cdce5
Signed-off-by: Martin Sunal <msunal@cisco.com>
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/JsonMapper.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/JsonReader.java [new file with mode: 0644]
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/JsonToCompositeNodeProvider.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/StructuredDataToJsonProvider.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/StructuredDataToXmlProvider.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/UnsupportedJsonFormatException.java [new file with mode: 0644]
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/CompositeNodeWrapper.java [new file with mode: 0644]
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/NodeWrapper.java [new file with mode: 0644]
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestconfImpl.xtend
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/SimpleNodeWrapper.java [new file with mode: 0644]