org.apache.directory.shared.dsmlv2.engine
Class Dsmlv2Engine

java.lang.Object
  extended by org.apache.directory.shared.dsmlv2.engine.Dsmlv2Engine

public class Dsmlv2Engine
extends java.lang.Object

This is the DSMLv2Engine. It can be use to execute operations on a LDAP Server and get the results of these operations. The format used for request and responses is the DSMLv2 format.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Constructor Summary
Dsmlv2Engine(java.lang.String host, int port, java.lang.String user, java.lang.String password)
          Creates a new instance of Dsmlv2Engine.
 
Method Summary
 java.lang.String processDSML(java.io.InputStream inputStream, java.lang.String inputEncoding)
          Processes the file given and return the result of the operations
 java.lang.String processDSML(java.lang.String dsmlInput)
          Processes the file given and return the result of the operations
 java.lang.String processDSMLFile(java.lang.String fileName)
          Processes the file given and return the result of the operations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dsmlv2Engine

public Dsmlv2Engine(java.lang.String host,
                    int port,
                    java.lang.String user,
                    java.lang.String password)
Creates a new instance of Dsmlv2Engine.

Parameters:
host - the server host
port - the server port
user - the server admin DN
password - the server admin's password
Method Detail

processDSML

public java.lang.String processDSML(java.lang.String dsmlInput)
                             throws org.xmlpull.v1.XmlPullParserException
Processes the file given and return the result of the operations

Parameters:
dsmlInput - the DSMLv2 formatted request input
Returns:
the XML response in DSMLv2 Format
Throws:
org.xmlpull.v1.XmlPullParserException - if an error occurs in the parser

processDSMLFile

public java.lang.String processDSMLFile(java.lang.String fileName)
                                 throws org.xmlpull.v1.XmlPullParserException,
                                        java.io.FileNotFoundException
Processes the file given and return the result of the operations

Parameters:
fileName - the path to the file
Returns:
the XML response in DSMLv2 Format
Throws:
org.xmlpull.v1.XmlPullParserException - if an error occurs in the parser
java.io.FileNotFoundException - if the file does not exist

processDSML

public java.lang.String processDSML(java.io.InputStream inputStream,
                                    java.lang.String inputEncoding)
                             throws org.xmlpull.v1.XmlPullParserException
Processes the file given and return the result of the operations

Parameters:
inputStream - contains a raw byte input stream of possibly unknown encoding (when inputEncoding is null).
inputEncoding - if not null it MUST be used as encoding for inputStream
Returns:
the XML response in DSMLv2 Format
Throws:
org.xmlpull.v1.XmlPullParserException - if an error occurs in the parser


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.