- public CompositeNode readFrom(Class<CompositeNode> type, Type genericType, Annotation[] annotations,
- MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
- throws IOException, WebApplicationException {
- // TODO Auto-generated method stub
- return null;
+ public CompositeNode readFrom(final Class<CompositeNode> type, final Type genericType,
+ final Annotation[] annotations, final MediaType mediaType,
+ final MultivaluedMap<String, String> httpHeaders,
+ final InputStream entityStream)
+ throws IOException, WebApplicationException {
+ try {
+ return JsonToCompositeNodeReader.read(entityStream);
+ } catch (Exception e) {
+ LOG.debug( "Error parsing json input", e);
+
+ throw new RestconfDocumentedException(
+ "Error parsing input: " + e.getMessage(),
+ ErrorType.PROTOCOL, ErrorTag.MALFORMED_MESSAGE);
+ }