← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15562: minor fixes to nodeService

 

------------------------------------------------------------
revno: 15562
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-06-05 13:56:44 +0200
message:
  minor fixes to nodeService
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/NodeService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/node/DefaultNodeService.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/NodeService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/NodeService.java	2014-06-04 16:22:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/NodeService.java	2014-06-05 11:56:44 +0000
@@ -39,11 +39,37 @@
  */
 public interface NodeService
 {
+    /**
+     * Find a nodeSerializer that supports contentType or return null.
+     *
+     * @param contentType NodeSerializer contentType
+     * @return NodeSerializer that support contentType, or null if not match was found
+     * @see org.hisp.dhis.node.NodeSerializer
+     */
     NodeSerializer getNodeSerializer( String contentType );
 
+    /**
+     * Write out rootNode to a nodeSerializer that matches the contentType.
+     *
+     * @param rootNode     RootNode to write
+     * @param contentType  NodeSerializer contentType
+     * @param outputStream Write to this outputStream
+     */
     void serialize( RootNode rootNode, String contentType, OutputStream outputStream ) throws IOException;
 
+    /**
+     * Find a nodeDeserializer that supports contentType or return null.
+     *
+     * @param contentType NodeDeserializer contentType
+     * @return NodeDeserializer that support contentType, or null if not match was found
+     * @see org.hisp.dhis.node.NodeDeserializer
+     */
     NodeDeserializer getNodeDeserializer( String contentType );
 
-    RootNode deserialize( RootNode rootNode, String contentType, InputStream inputStream ) throws IOException;
+    /**
+     * @param contentType NodeDeserializer contentType
+     * @param inputStream Read RootNode from this stream
+     * @return RootNode deserialized from inputStream
+     */
+    RootNode deserialize( String contentType, InputStream inputStream ) throws IOException;
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/node/DefaultNodeService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/node/DefaultNodeService.java	2014-06-05 08:36:58 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/node/DefaultNodeService.java	2014-06-05 11:56:44 +0000
@@ -111,7 +111,7 @@
     }
 
     @Override
-    public RootNode deserialize( RootNode rootNode, String contentType, InputStream inputStream ) throws IOException
+    public RootNode deserialize( String contentType, InputStream inputStream ) throws IOException
     {
         NodeDeserializer nodeDeserializer = getNodeDeserializer( contentType );