You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ka...@apache.org on 2011/03/30 12:30:40 UTC
svn commit: r1086897 -
/directory/shared/trunk/dsml/engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java
Author: kayyagari
Date: Wed Mar 30 10:30:39 2011
New Revision: 1086897
URL: http://svn.apache.org/viewvc?rev=1086897&view=rev
Log:
o overloaded processDsml() with some convenient options to stream the response
Modified:
directory/shared/trunk/dsml/engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java
Modified: directory/shared/trunk/dsml/engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml/engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java?rev=1086897&r1=1086896&r2=1086897&view=diff
==============================================================================
--- directory/shared/trunk/dsml/engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java (original)
+++ directory/shared/trunk/dsml/engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java Wed Mar 30 10:30:39 2011
@@ -204,27 +204,36 @@ public class Dsmlv2Engine
processDSML( respStream );
}
+
/**
- * Processes the file given and return the result of the operations
+ * uses the default UTF-8 encoding for processing the DSML
*
- * @param inputStream
- * contains a raw byte input stream of possibly unknown encoding (when inputEncoding is null).
- * @param inputEncoding
- * if not null it MUST be used as encoding for inputStream
- * @return
- * the XML response in DSMLv2 Format
- * @throws XmlPullParserException
- * if an error occurs in the parser
+ * @see #processDSML(InputStream, String, OutputStream)
*/
- public String processDSML( InputStream inputStream, String inputEncoding ) throws XmlPullParserException
+ public void processDSML( InputStream inputStream, OutputStream out ) throws Exception
{
- parser = new Dsmlv2Parser( grammar );
- parser.setInput( inputStream, inputEncoding );
- return processDSML();
+ processDSML( inputStream, "UTF-8", out );
}
/**
+ * process the DSML request(s) from the given input stream with the specified encoding
+ * and writes the response to the output stream
+ *
+ * @param inputStream the input stream for DSML batch request
+ * @param inputEncoding encoding to be used while reading the DSML request data
+ * @param out the output stream to which DSML response will be written
+ * @throws Exception
+ */
+ public void processDSML( InputStream inputStream, String inputEncoding, OutputStream out ) throws Exception
+ {
+ parser = new Dsmlv2Parser();
+ parser.setInput( inputStream, inputEncoding );
+ processDSML( out );
+ }
+
+
+ /**
* Processes the Request document
*
* @return the XML response in DSMLv2 Format