com.ibm.di.parser
Class Dsmlv2Parser

java.lang.Object
  extended by com.ibm.di.parser.ParserImpl
      extended by com.ibm.di.parser.Dsmlv2Parser
All Implemented Interfaces:
ParserInterface, VersionInfoInterface

public class Dsmlv2Parser
extends ParserImpl

A TDI Parser class for reading and writing Entries in DSMLv2 format


Field Summary
static String ATTR_DSML_NS
          DSML namespace attribute.
static String ATTR_NAME_ACUMULATOR
          resultEntries config parameter name.
static String ATTR_NAME_DN
          Attribute name for distinguish number.
static String ATTR_NAME_DSML_ABANDON_ID
          Attribute name for abandonID attribute.
static String ATTR_NAME_DSML_ATTRIBUTES
          Attribute name for attributes attribute.
static String ATTR_NAME_DSML_BASE
          Name of the DSML base attribute.
static String ATTR_NAME_DSML_COMPARE_NAME
          Attribute name for compare_name attribute.
static String ATTR_NAME_DSML_COMPARE_RESULT
          Attribute name for compare_value attribute.
static String ATTR_NAME_DSML_COMPARE_VALUE
          Attribute name for compare_value attribute.
static String ATTR_NAME_DSML_CONTROLS
          Attribute name for controls attribute.
static String ATTR_NAME_DSML_DELETEOLDRDN
          Attribute name for deleteOldRDN attribute.
static String ATTR_NAME_DSML_DEREFALIASES
          Attribute name for derefAliases attribute.
static String ATTR_NAME_DSML_DETAILS
          Attribute name for details attribute.
static String ATTR_NAME_DSML_ERROR_MESSAGE
          Attribute name for error attribute.
static String ATTR_NAME_DSML_ERRORTYPE
          Attribute name for errorType attribute.
static String ATTR_NAME_DSML_EXCEPTION
          Attribute name for exception attribute.
static String ATTR_NAME_DSML_FILTER
          Attribute name for filter attribute.
static String ATTR_NAME_DSML_MESSAGE
          Attribute name for message attribute.
static String ATTR_NAME_DSML_NEWSUPERIOR
          Attribute name for newSuperior attribute.
static String ATTR_NAME_DSML_OPERATION
          Name of the DSML operation attribute.
static String ATTR_NAME_DSML_PRINCIPAL
          Attribute name for principal attribute.
static String ATTR_NAME_DSML_REFFERAL
          Attribute name for referral attribute.
static String ATTR_NAME_DSML_REQUEST_ID
          Attribute name for requestID attribute.
static String ATTR_NAME_DSML_REQUEST_NAME
          Attribute name for extended.requestname attribute.
static String ATTR_NAME_DSML_REQUEST_VALUE
          Attribute name for extended.requestvalue attribute.
static String ATTR_NAME_DSML_RESPONSE
          Attribute name for response attribute.
static String ATTR_NAME_DSML_RESPONSE_NAME
          Attribute name for responseName attribute.
static String ATTR_NAME_DSML_RESULTCODE
          Attribute name for resultcode attribute.
static String ATTR_NAME_DSML_RESULTDESC
          Attribute name for resultdescr attribute.
static String ATTR_NAME_DSML_SCOPE
          Attribute name for scope attribute.
static String ATTR_NAME_DSML_SIZELIMIT
          Attribute name for sizeLimit attribute.
static String ATTR_NAME_DSML_TIMELIMIT
          Attribute name for timeLimit attribute.
static String ATTR_NAME_DSML_TYPESONLY
          Attribute name for typesOnly attribute.
static String ATTR_NAME_NEWRDN
          Attribute name for new RDN.
static String ATTR_SOAP_NS
          SOAP namespace attribute.
static String DEREF_NEVER
          Default value used for search request.
static String NS_URI_SOAP_ENV
          Namespace URI for SOAP.
static String OPERATION_ABANDON_REQUEST
          Name of the abandon request.
static String OPERATION_ADD_REQUEST
          Name of the add request.
static String OPERATION_ADD_RESPONSE
          Name of the add response.
static String OPERATION_AUTH_REQUEST
          Name of the authorization request.
static String OPERATION_AUTH_RESPONSE
          Name of the authorization response.
static String OPERATION_COMPARE_REQUEST
          Name of the compare request.
static String OPERATION_COMPARE_RESPONSE
          Name of the compare response.
static String OPERATION_DELETE_REQUEST
          Name of the delete request.
static String OPERATION_DELETE_RESPONSE
          Name of the delete response.
static String OPERATION_ERROR_RESPONSE
          Name of the error response.
static String OPERATION_EXTENDED_REQUEST
          Name of the extended request.
static String OPERATION_EXTENDED_RESPONSE
          Name of the extended response.
static String OPERATION_MODIFY_REQUEST
          Name of the modify request.
static String OPERATION_MODIFY_RESPONSE
          Name of the modify response.
static String OPERATION_MODIFYDN_REQUEST
          Name of the modify distinguish number request.
static String OPERATION_MODIFYDN_RESPONSE
          Name of the modify distinguish number response.
static String OPERATION_SEARCH_REQUEST
          Name of the search request.
static String OPERATION_SEARCH_RESPONSE
          Name of the search response.
static String PARAMETER_BINARY_ATTRIBUTES
          binaryAttributes config parameter name.
static String PARAMETER_MODE
          Parameter mode.
static String SOAP_BODY_QN
          SOAP body attribute.
static String SOAP_ENV_QN
          Indicates SOAP envelope.
static String WHOLE_SUBTREE
          Indicates search scope - whole tree.
static String XMLNS_NS
          XML namespace URI.
 
Fields inherited from class com.ibm.di.parser.ParserImpl
_debug, myConfiguration
 
Constructor Summary
Dsmlv2Parser()
           
 
Method Summary
 void closeParser()
          Closes the parser
static Element dsmlMessageToElement(com.ibm.ldap.dsml.DsmlMessage aDsmlMessage)
          Converts DSML message to Element.
 void flush()
          Flushes the parser's outputstream or writer
static String getResponseOperation(String aRequestOperation)
          This method maps request and response operations Used from DSMLv2 EventHandler
static com.ibm.ldap.dsml.LdapResult getSearchResultDoneFromEntry(Entry aEntry)
          Retrieves search result done.
static com.ibm.ldap.dsml.SearchResultEntry getSearchResultEntry(Entry aEntry)
          Retrieves single search result only.
 Node getSingleNode()
          Retrieves inner node from the output xml document.
 String getVersion()
          Version information.
 void initParser()
          Initializes the parser.
 Entry readEntry()
          Reads a request or response from BatchMessage.
 void writeEntry(Entry aEntry)
          Writes a request or response to the batch message.
 String xmlNodeToString(Node aNode, boolean aIndentOutput)
          Gives meaningful string representation of a XML node.
 
Methods inherited from class com.ibm.di.parser.ParserImpl
debug, debugMode, getClassInstance, getContext, getDebug, getInputStream, getOutputStream, getParam, getParser, getReader, getWriter, isDeltaSupported, logmsg, querySchema, registerScriptBeans, setConfiguration, setContext, setDebug, setInputStream, setInputStream, setInputStream, setOutputStream, setOutputStream, setParam, setParser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMETER_MODE

public static final String PARAMETER_MODE
Parameter mode.

See Also:
Constant Field Values

PARAMETER_BINARY_ATTRIBUTES

public static final String PARAMETER_BINARY_ATTRIBUTES
binaryAttributes config parameter name.

See Also:
Constant Field Values

ATTR_NAME_ACUMULATOR

public static final String ATTR_NAME_ACUMULATOR
resultEntries config parameter name.

See Also:
Constant Field Values

ATTR_NAME_DN

public static final String ATTR_NAME_DN
Attribute name for distinguish number.

See Also:
Constant Field Values

ATTR_NAME_NEWRDN

public static final String ATTR_NAME_NEWRDN
Attribute name for new RDN.

See Also:
Constant Field Values

ATTR_NAME_DSML_BASE

public static final String ATTR_NAME_DSML_BASE
Name of the DSML base attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_OPERATION

public static final String ATTR_NAME_DSML_OPERATION
Name of the DSML operation attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_COMPARE_NAME

public static final String ATTR_NAME_DSML_COMPARE_NAME
Attribute name for compare_name attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_COMPARE_VALUE

public static final String ATTR_NAME_DSML_COMPARE_VALUE
Attribute name for compare_value attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_COMPARE_RESULT

public static final String ATTR_NAME_DSML_COMPARE_RESULT
Attribute name for compare_value attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_ERROR_MESSAGE

public static final String ATTR_NAME_DSML_ERROR_MESSAGE
Attribute name for error attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_RESULTCODE

public static final String ATTR_NAME_DSML_RESULTCODE
Attribute name for resultcode attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_RESULTDESC

public static final String ATTR_NAME_DSML_RESULTDESC
Attribute name for resultdescr attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_FILTER

public static final String ATTR_NAME_DSML_FILTER
Attribute name for filter attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_ATTRIBUTES

public static final String ATTR_NAME_DSML_ATTRIBUTES
Attribute name for attributes attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_SCOPE

public static final String ATTR_NAME_DSML_SCOPE
Attribute name for scope attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_REQUEST_ID

public static final String ATTR_NAME_DSML_REQUEST_ID
Attribute name for requestID attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_CONTROLS

public static final String ATTR_NAME_DSML_CONTROLS
Attribute name for controls attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_EXCEPTION

public static final String ATTR_NAME_DSML_EXCEPTION
Attribute name for exception attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_NEWSUPERIOR

public static final String ATTR_NAME_DSML_NEWSUPERIOR
Attribute name for newSuperior attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_DELETEOLDRDN

public static final String ATTR_NAME_DSML_DELETEOLDRDN
Attribute name for deleteOldRDN attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_DEREFALIASES

public static final String ATTR_NAME_DSML_DEREFALIASES
Attribute name for derefAliases attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_SIZELIMIT

public static final String ATTR_NAME_DSML_SIZELIMIT
Attribute name for sizeLimit attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_TIMELIMIT

public static final String ATTR_NAME_DSML_TIMELIMIT
Attribute name for timeLimit attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_TYPESONLY

public static final String ATTR_NAME_DSML_TYPESONLY
Attribute name for typesOnly attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_REFFERAL

public static final String ATTR_NAME_DSML_REFFERAL
Attribute name for referral attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_PRINCIPAL

public static final String ATTR_NAME_DSML_PRINCIPAL
Attribute name for principal attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_RESPONSE_NAME

public static final String ATTR_NAME_DSML_RESPONSE_NAME
Attribute name for responseName attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_RESPONSE

public static final String ATTR_NAME_DSML_RESPONSE
Attribute name for response attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_ERRORTYPE

public static final String ATTR_NAME_DSML_ERRORTYPE
Attribute name for errorType attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_DETAILS

public static final String ATTR_NAME_DSML_DETAILS
Attribute name for details attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_MESSAGE

public static final String ATTR_NAME_DSML_MESSAGE
Attribute name for message attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_REQUEST_NAME

public static final String ATTR_NAME_DSML_REQUEST_NAME
Attribute name for extended.requestname attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_REQUEST_VALUE

public static final String ATTR_NAME_DSML_REQUEST_VALUE
Attribute name for extended.requestvalue attribute.

See Also:
Constant Field Values

ATTR_NAME_DSML_ABANDON_ID

public static final String ATTR_NAME_DSML_ABANDON_ID
Attribute name for abandonID attribute.

See Also:
Constant Field Values

OPERATION_ADD_REQUEST

public static final String OPERATION_ADD_REQUEST
Name of the add request.

See Also:
Constant Field Values

OPERATION_DELETE_REQUEST

public static final String OPERATION_DELETE_REQUEST
Name of the delete request.

See Also:
Constant Field Values

OPERATION_SEARCH_REQUEST

public static final String OPERATION_SEARCH_REQUEST
Name of the search request.

See Also:
Constant Field Values

OPERATION_COMPARE_REQUEST

public static final String OPERATION_COMPARE_REQUEST
Name of the compare request.

See Also:
Constant Field Values

OPERATION_MODIFY_REQUEST

public static final String OPERATION_MODIFY_REQUEST
Name of the modify request.

See Also:
Constant Field Values

OPERATION_MODIFYDN_REQUEST

public static final String OPERATION_MODIFYDN_REQUEST
Name of the modify distinguish number request.

See Also:
Constant Field Values

OPERATION_EXTENDED_REQUEST

public static final String OPERATION_EXTENDED_REQUEST
Name of the extended request.

See Also:
Constant Field Values

OPERATION_ABANDON_REQUEST

public static final String OPERATION_ABANDON_REQUEST
Name of the abandon request.

See Also:
Constant Field Values

OPERATION_AUTH_REQUEST

public static final String OPERATION_AUTH_REQUEST
Name of the authorization request.

See Also:
Constant Field Values

OPERATION_ADD_RESPONSE

public static final String OPERATION_ADD_RESPONSE
Name of the add response.

See Also:
Constant Field Values

OPERATION_DELETE_RESPONSE

public static final String OPERATION_DELETE_RESPONSE
Name of the delete response.

See Also:
Constant Field Values

OPERATION_SEARCH_RESPONSE

public static final String OPERATION_SEARCH_RESPONSE
Name of the search response.

See Also:
Constant Field Values

OPERATION_COMPARE_RESPONSE

public static final String OPERATION_COMPARE_RESPONSE
Name of the compare response.

See Also:
Constant Field Values

OPERATION_MODIFY_RESPONSE

public static final String OPERATION_MODIFY_RESPONSE
Name of the modify response.

See Also:
Constant Field Values

OPERATION_MODIFYDN_RESPONSE

public static final String OPERATION_MODIFYDN_RESPONSE
Name of the modify distinguish number response.

See Also:
Constant Field Values

OPERATION_EXTENDED_RESPONSE

public static final String OPERATION_EXTENDED_RESPONSE
Name of the extended response.

See Also:
Constant Field Values

OPERATION_AUTH_RESPONSE

public static final String OPERATION_AUTH_RESPONSE
Name of the authorization response.

See Also:
Constant Field Values

OPERATION_ERROR_RESPONSE

public static final String OPERATION_ERROR_RESPONSE
Name of the error response.

See Also:
Constant Field Values

WHOLE_SUBTREE

public static final String WHOLE_SUBTREE
Indicates search scope - whole tree.

Note: From ITDS DSMLv2 library.

See Also:
Constant Field Values

DEREF_NEVER

public static final String DEREF_NEVER
Default value used for search request.

See Also:
Constant Field Values

NS_URI_SOAP_ENV

public static final String NS_URI_SOAP_ENV
Namespace URI for SOAP.

For SOAP support.

See Also:
Constant Field Values

SOAP_ENV_QN

public static final String SOAP_ENV_QN
Indicates SOAP envelope.

See Also:
Constant Field Values

XMLNS_NS

public static final String XMLNS_NS
XML namespace URI.

See Also:
Constant Field Values

ATTR_SOAP_NS

public static final String ATTR_SOAP_NS
SOAP namespace attribute.

See Also:
Constant Field Values

SOAP_BODY_QN

public static final String SOAP_BODY_QN
SOAP body attribute.

See Also:
Constant Field Values

ATTR_DSML_NS

public static final String ATTR_DSML_NS
DSML namespace attribute.

See Also:
Constant Field Values
Constructor Detail

Dsmlv2Parser

public Dsmlv2Parser()
Method Detail

getResponseOperation

public static String getResponseOperation(String aRequestOperation)
This method maps request and response operations Used from DSMLv2 EventHandler

Parameters:
aRequestOperation - The request operation that will be mapped
Returns:
response of corresponding request operation

initParser

public void initParser()
                throws Exception
Initializes the parser.

Specified by:
initParser in interface ParserInterface
Overrides:
initParser in class ParserImpl
Throws:
Exception - if initialization fails

readEntry

public Entry readEntry()
                throws Exception
Reads a request or response from BatchMessage.

Returns:
next entry
Throws:
Exception - Throws exception if type of request or response not recognized

writeEntry

public void writeEntry(Entry aEntry)
                throws Exception
Writes a request or response to the batch message.

Parameters:
aEntry - The entry which will be written
Throws:
Exception - Throws exception if type of request or response not recognized

closeParser

public void closeParser()
                 throws Exception
Closes the parser

Specified by:
closeParser in interface ParserInterface
Overrides:
closeParser in class ParserImpl
Throws:
Exception - Throws exception if closing fails

flush

public void flush()
Flushes the parser's outputstream or writer

Specified by:
flush in interface ParserInterface
Overrides:
flush in class ParserImpl

getSingleNode

public Node getSingleNode()
Retrieves inner node from the output xml document.

Returns:
the last node.

getSearchResultEntry

public static com.ibm.ldap.dsml.SearchResultEntry getSearchResultEntry(Entry aEntry)
Retrieves single search result only.

Parameters:
aEntry - the entry from which to retrieve single search result.
Returns:
SearchResultEntry object

getSearchResultDoneFromEntry

public static com.ibm.ldap.dsml.LdapResult getSearchResultDoneFromEntry(Entry aEntry)
Retrieves search result done.

Parameters:
aEntry - the entry from which to retrieve search result.
Returns:
LDAP result

getVersion

public String getVersion()
Version information.

Returns:
version information.

xmlNodeToString

public String xmlNodeToString(Node aNode,
                              boolean aIndentOutput)
                       throws Exception
Gives meaningful string representation of a XML node.

Parameters:
aNode - the Node object.
aIndentOutput - if true the output will be indented.
Returns:
String object
Throws:
Exception - If an unrecoverable error occurs during the course of the transformation.

dsmlMessageToElement

public static Element dsmlMessageToElement(com.ibm.ldap.dsml.DsmlMessage aDsmlMessage)
                                    throws Exception
Converts DSML message to Element.

Parameters:
aDsmlMessage - the DSML message.
Returns:
Element object
Throws:
Exception - if a DocumentBuilder cannot be created which satisfies the configuration requested.