Package com.ibm.di.parser
Class Dsmlv2Parser
- java.lang.Object
-
- com.ibm.di.parser.ParserImpl
-
- 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
Fields Modifier and Type Field Description static java.lang.StringATTR_DSML_NSDSML namespace attribute.static java.lang.StringATTR_NAME_ACUMULATORresultEntriesconfig parameter name.static java.lang.StringATTR_NAME_DNAttribute name for distinguish number.static java.lang.StringATTR_NAME_DSML_ABANDON_IDAttribute name for abandonID attribute.static java.lang.StringATTR_NAME_DSML_ATTRIBUTESAttribute name for attributes attribute.static java.lang.StringATTR_NAME_DSML_BASEName of the DSML base attribute.static java.lang.StringATTR_NAME_DSML_COMPARE_NAMEAttribute name for compare_name attribute.static java.lang.StringATTR_NAME_DSML_COMPARE_RESULTAttribute name for compare_value attribute.static java.lang.StringATTR_NAME_DSML_COMPARE_VALUEAttribute name for compare_value attribute.static java.lang.StringATTR_NAME_DSML_CONTROLSAttribute name for controls attribute.static java.lang.StringATTR_NAME_DSML_DELETEOLDRDNAttribute name for deleteOldRDN attribute.static java.lang.StringATTR_NAME_DSML_DEREFALIASESAttribute name for derefAliases attribute.static java.lang.StringATTR_NAME_DSML_DETAILSAttribute name for details attribute.static java.lang.StringATTR_NAME_DSML_ERROR_MESSAGEAttribute name for error attribute.static java.lang.StringATTR_NAME_DSML_ERRORTYPEAttribute name for errorType attribute.static java.lang.StringATTR_NAME_DSML_EXCEPTIONAttribute name for exception attribute.static java.lang.StringATTR_NAME_DSML_FILTERAttribute name for filter attribute.static java.lang.StringATTR_NAME_DSML_MESSAGEAttribute name for message attribute.static java.lang.StringATTR_NAME_DSML_NEWSUPERIORAttribute name for newSuperior attribute.static java.lang.StringATTR_NAME_DSML_OPERATIONName of the DSML operation attribute.static java.lang.StringATTR_NAME_DSML_PRINCIPALAttribute name for principal attribute.static java.lang.StringATTR_NAME_DSML_REFFERALAttribute name for referral attribute.static java.lang.StringATTR_NAME_DSML_REQUEST_IDAttribute name for requestID attribute.static java.lang.StringATTR_NAME_DSML_REQUEST_NAMEAttribute name for extended.requestname attribute.static java.lang.StringATTR_NAME_DSML_REQUEST_VALUEAttribute name for extended.requestvalue attribute.static java.lang.StringATTR_NAME_DSML_RESPONSEAttribute name for response attribute.static java.lang.StringATTR_NAME_DSML_RESPONSE_NAMEAttribute name for responseName attribute.static java.lang.StringATTR_NAME_DSML_RESULTCODEAttribute name for resultcode attribute.static java.lang.StringATTR_NAME_DSML_RESULTDESCAttribute name for resultdescr attribute.static java.lang.StringATTR_NAME_DSML_SCOPEAttribute name for scope attribute.static java.lang.StringATTR_NAME_DSML_SIZELIMITAttribute name for sizeLimit attribute.static java.lang.StringATTR_NAME_DSML_TIMELIMITAttribute name for timeLimit attribute.static java.lang.StringATTR_NAME_DSML_TYPESONLYAttribute name for typesOnly attribute.static java.lang.StringATTR_NAME_NEWRDNAttribute name for new RDN.static java.lang.StringATTR_SOAP_NSSOAP namespace attribute.static java.lang.StringDEREF_NEVERDefault value used for search request.static java.lang.StringNS_URI_SOAP_ENVNamespace URI for SOAP.static java.lang.StringOPERATION_ABANDON_REQUESTName of the abandon request.static java.lang.StringOPERATION_ADD_REQUESTName of the add request.static java.lang.StringOPERATION_ADD_RESPONSEName of the add response.static java.lang.StringOPERATION_AUTH_REQUESTName of the authorization request.static java.lang.StringOPERATION_AUTH_RESPONSEName of the authorization response.static java.lang.StringOPERATION_COMPARE_REQUESTName of the compare request.static java.lang.StringOPERATION_COMPARE_RESPONSEName of the compare response.static java.lang.StringOPERATION_DELETE_REQUESTName of the delete request.static java.lang.StringOPERATION_DELETE_RESPONSEName of the delete response.static java.lang.StringOPERATION_ERROR_RESPONSEName of the error response.static java.lang.StringOPERATION_EXTENDED_REQUESTName of the extended request.static java.lang.StringOPERATION_EXTENDED_RESPONSEName of the extended response.static java.lang.StringOPERATION_MODIFY_REQUESTName of the modify request.static java.lang.StringOPERATION_MODIFY_RESPONSEName of the modify response.static java.lang.StringOPERATION_MODIFYDN_REQUESTName of the modify distinguish number request.static java.lang.StringOPERATION_MODIFYDN_RESPONSEName of the modify distinguish number response.static java.lang.StringOPERATION_SEARCH_REQUESTName of the search request.static java.lang.StringOPERATION_SEARCH_RESPONSEName of the search response.static java.lang.StringPARAMETER_BATCH_REQUEST_IDbatchRequestIdconfig parameter name.static java.lang.StringPARAMETER_BINARY_ATTRIBUTESbinaryAttributesconfig parameter name.static java.lang.StringPARAMETER_MODEParameter mode.static java.lang.StringSOAP_BODY_QNSOAP body attribute.static java.lang.StringSOAP_ENV_QNIndicates SOAP envelope.static java.lang.StringWHOLE_SUBTREEIndicates search scope - whole tree.static java.lang.StringXMLNS_NSXML namespace URI.-
Fields inherited from class com.ibm.di.parser.ParserImpl
_debug, myConfiguration
-
-
Constructor Summary
Constructors Constructor Description Dsmlv2Parser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseParser()Closes the parserstatic org.w3c.dom.ElementdsmlMessageToElement(com.ibm.ldap.dsml.DsmlMessage aDsmlMessage)Converts DSML message to Element.voidflush()Flushes the parser's outputstream or writerstatic java.lang.StringgetResponseOperation(java.lang.String aRequestOperation)This method maps request and response operations Used from DSMLv2 EventHandlerstatic com.ibm.ldap.dsml.LdapResultgetSearchResultDoneFromEntry(Entry aEntry)Retrieves search result done.static com.ibm.ldap.dsml.SearchResultEntrygetSearchResultEntry(Entry aEntry)Retrieves single search result only.org.w3c.dom.NodegetSingleNode()Retrieves inner node from the output xml document.java.lang.StringgetVersion()Version information.voidinitParser()Initializes the parser.EntryreadEntry()Reads a request or response from BatchMessage.voidwriteEntry(Entry aEntry)Writes a request or response to the batch message.java.lang.StringxmlNodeToString(org.w3c.dom.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
-
-
-
-
Field Detail
-
PARAMETER_MODE
public static final java.lang.String PARAMETER_MODE
Parameter mode.- See Also:
- Constant Field Values
-
PARAMETER_BINARY_ATTRIBUTES
public static final java.lang.String PARAMETER_BINARY_ATTRIBUTES
binaryAttributesconfig parameter name.- See Also:
- Constant Field Values
-
PARAMETER_BATCH_REQUEST_ID
public static final java.lang.String PARAMETER_BATCH_REQUEST_ID
batchRequestIdconfig parameter name.- See Also:
- Constant Field Values
-
ATTR_NAME_ACUMULATOR
public static final java.lang.String ATTR_NAME_ACUMULATOR
resultEntriesconfig parameter name.- See Also:
- Constant Field Values
-
ATTR_NAME_DN
public static final java.lang.String ATTR_NAME_DN
Attribute name for distinguish number.- See Also:
- Constant Field Values
-
ATTR_NAME_NEWRDN
public static final java.lang.String ATTR_NAME_NEWRDN
Attribute name for new RDN.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_BASE
public static final java.lang.String ATTR_NAME_DSML_BASE
Name of the DSML base attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_OPERATION
public static final java.lang.String ATTR_NAME_DSML_OPERATION
Name of the DSML operation attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_COMPARE_NAME
public static final java.lang.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 java.lang.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 java.lang.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 java.lang.String ATTR_NAME_DSML_ERROR_MESSAGE
Attribute name for error attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_RESULTCODE
public static final java.lang.String ATTR_NAME_DSML_RESULTCODE
Attribute name for resultcode attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_RESULTDESC
public static final java.lang.String ATTR_NAME_DSML_RESULTDESC
Attribute name for resultdescr attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_FILTER
public static final java.lang.String ATTR_NAME_DSML_FILTER
Attribute name for filter attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_ATTRIBUTES
public static final java.lang.String ATTR_NAME_DSML_ATTRIBUTES
Attribute name for attributes attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_SCOPE
public static final java.lang.String ATTR_NAME_DSML_SCOPE
Attribute name for scope attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_REQUEST_ID
public static final java.lang.String ATTR_NAME_DSML_REQUEST_ID
Attribute name for requestID attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_CONTROLS
public static final java.lang.String ATTR_NAME_DSML_CONTROLS
Attribute name for controls attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_EXCEPTION
public static final java.lang.String ATTR_NAME_DSML_EXCEPTION
Attribute name for exception attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_NEWSUPERIOR
public static final java.lang.String ATTR_NAME_DSML_NEWSUPERIOR
Attribute name for newSuperior attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_DELETEOLDRDN
public static final java.lang.String ATTR_NAME_DSML_DELETEOLDRDN
Attribute name for deleteOldRDN attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_DEREFALIASES
public static final java.lang.String ATTR_NAME_DSML_DEREFALIASES
Attribute name for derefAliases attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_SIZELIMIT
public static final java.lang.String ATTR_NAME_DSML_SIZELIMIT
Attribute name for sizeLimit attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_TIMELIMIT
public static final java.lang.String ATTR_NAME_DSML_TIMELIMIT
Attribute name for timeLimit attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_TYPESONLY
public static final java.lang.String ATTR_NAME_DSML_TYPESONLY
Attribute name for typesOnly attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_REFFERAL
public static final java.lang.String ATTR_NAME_DSML_REFFERAL
Attribute name for referral attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_PRINCIPAL
public static final java.lang.String ATTR_NAME_DSML_PRINCIPAL
Attribute name for principal attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_RESPONSE_NAME
public static final java.lang.String ATTR_NAME_DSML_RESPONSE_NAME
Attribute name for responseName attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_RESPONSE
public static final java.lang.String ATTR_NAME_DSML_RESPONSE
Attribute name for response attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_ERRORTYPE
public static final java.lang.String ATTR_NAME_DSML_ERRORTYPE
Attribute name for errorType attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_DETAILS
public static final java.lang.String ATTR_NAME_DSML_DETAILS
Attribute name for details attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_MESSAGE
public static final java.lang.String ATTR_NAME_DSML_MESSAGE
Attribute name for message attribute.- See Also:
- Constant Field Values
-
ATTR_NAME_DSML_REQUEST_NAME
public static final java.lang.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 java.lang.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 java.lang.String ATTR_NAME_DSML_ABANDON_ID
Attribute name for abandonID attribute.- See Also:
- Constant Field Values
-
OPERATION_ADD_REQUEST
public static final java.lang.String OPERATION_ADD_REQUEST
Name of the add request.- See Also:
- Constant Field Values
-
OPERATION_DELETE_REQUEST
public static final java.lang.String OPERATION_DELETE_REQUEST
Name of the delete request.- See Also:
- Constant Field Values
-
OPERATION_SEARCH_REQUEST
public static final java.lang.String OPERATION_SEARCH_REQUEST
Name of the search request.- See Also:
- Constant Field Values
-
OPERATION_COMPARE_REQUEST
public static final java.lang.String OPERATION_COMPARE_REQUEST
Name of the compare request.- See Also:
- Constant Field Values
-
OPERATION_MODIFY_REQUEST
public static final java.lang.String OPERATION_MODIFY_REQUEST
Name of the modify request.- See Also:
- Constant Field Values
-
OPERATION_MODIFYDN_REQUEST
public static final java.lang.String OPERATION_MODIFYDN_REQUEST
Name of the modify distinguish number request.- See Also:
- Constant Field Values
-
OPERATION_EXTENDED_REQUEST
public static final java.lang.String OPERATION_EXTENDED_REQUEST
Name of the extended request.- See Also:
- Constant Field Values
-
OPERATION_ABANDON_REQUEST
public static final java.lang.String OPERATION_ABANDON_REQUEST
Name of the abandon request.- See Also:
- Constant Field Values
-
OPERATION_AUTH_REQUEST
public static final java.lang.String OPERATION_AUTH_REQUEST
Name of the authorization request.- See Also:
- Constant Field Values
-
OPERATION_ADD_RESPONSE
public static final java.lang.String OPERATION_ADD_RESPONSE
Name of the add response.- See Also:
- Constant Field Values
-
OPERATION_DELETE_RESPONSE
public static final java.lang.String OPERATION_DELETE_RESPONSE
Name of the delete response.- See Also:
- Constant Field Values
-
OPERATION_SEARCH_RESPONSE
public static final java.lang.String OPERATION_SEARCH_RESPONSE
Name of the search response.- See Also:
- Constant Field Values
-
OPERATION_COMPARE_RESPONSE
public static final java.lang.String OPERATION_COMPARE_RESPONSE
Name of the compare response.- See Also:
- Constant Field Values
-
OPERATION_MODIFY_RESPONSE
public static final java.lang.String OPERATION_MODIFY_RESPONSE
Name of the modify response.- See Also:
- Constant Field Values
-
OPERATION_MODIFYDN_RESPONSE
public static final java.lang.String OPERATION_MODIFYDN_RESPONSE
Name of the modify distinguish number response.- See Also:
- Constant Field Values
-
OPERATION_EXTENDED_RESPONSE
public static final java.lang.String OPERATION_EXTENDED_RESPONSE
Name of the extended response.- See Also:
- Constant Field Values
-
OPERATION_AUTH_RESPONSE
public static final java.lang.String OPERATION_AUTH_RESPONSE
Name of the authorization response.- See Also:
- Constant Field Values
-
OPERATION_ERROR_RESPONSE
public static final java.lang.String OPERATION_ERROR_RESPONSE
Name of the error response.- See Also:
- Constant Field Values
-
WHOLE_SUBTREE
public static final java.lang.String WHOLE_SUBTREE
Indicates search scope - whole tree.Note: From ITDS DSMLv2 library.
- See Also:
- Constant Field Values
-
DEREF_NEVER
public static final java.lang.String DEREF_NEVER
Default value used for search request.- See Also:
- Constant Field Values
-
NS_URI_SOAP_ENV
public static final java.lang.String NS_URI_SOAP_ENV
Namespace URI for SOAP.For SOAP support.
- See Also:
- Constant Field Values
-
SOAP_ENV_QN
public static final java.lang.String SOAP_ENV_QN
Indicates SOAP envelope.- See Also:
- Constant Field Values
-
XMLNS_NS
public static final java.lang.String XMLNS_NS
XML namespace URI.- See Also:
- Constant Field Values
-
ATTR_SOAP_NS
public static final java.lang.String ATTR_SOAP_NS
SOAP namespace attribute.- See Also:
- Constant Field Values
-
SOAP_BODY_QN
public static final java.lang.String SOAP_BODY_QN
SOAP body attribute.- See Also:
- Constant Field Values
-
ATTR_DSML_NS
public static final java.lang.String ATTR_DSML_NS
DSML namespace attribute.- See Also:
- Constant Field Values
-
-
Method Detail
-
getResponseOperation
public static java.lang.String getResponseOperation(java.lang.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 java.lang.ExceptionInitializes the parser.- Specified by:
initParserin interfaceParserInterface- Overrides:
initParserin classParserImpl- Throws:
java.lang.Exception- if initialization fails
-
readEntry
public Entry readEntry() throws java.lang.Exception
Reads a request or response from BatchMessage.- Returns:
- next entry
- Throws:
java.lang.Exception- Throws exception if type of request or response not recognized
-
writeEntry
public void writeEntry(Entry aEntry) throws java.lang.Exception
Writes a request or response to the batch message.- Parameters:
aEntry- The entry which will be written- Throws:
java.lang.Exception- Throws exception if type of request or response not recognized
-
closeParser
public void closeParser() throws java.lang.ExceptionCloses the parser- Specified by:
closeParserin interfaceParserInterface- Overrides:
closeParserin classParserImpl- Throws:
java.lang.Exception- Throws exception if closing fails
-
flush
public void flush()
Flushes the parser's outputstream or writer- Specified by:
flushin interfaceParserInterface- Overrides:
flushin classParserImpl
-
getSingleNode
public org.w3c.dom.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 java.lang.String getVersion()
Version information.- Returns:
- version information.
-
xmlNodeToString
public java.lang.String xmlNodeToString(org.w3c.dom.Node aNode, boolean aIndentOutput) throws java.lang.ExceptionGives meaningful string representation of a XML node.- Parameters:
aNode- the Node object.aIndentOutput- iftruethe output will be indented.- Returns:
- String object
- Throws:
java.lang.Exception- If an unrecoverable error occurs during the course of the transformation.
-
dsmlMessageToElement
public static org.w3c.dom.Element dsmlMessageToElement(com.ibm.ldap.dsml.DsmlMessage aDsmlMessage) throws java.lang.ExceptionConverts DSML message to Element.- Parameters:
aDsmlMessage- the DSML message.- Returns:
- Element object
- Throws:
java.lang.Exception- if a DocumentBuilder cannot be created which satisfies the configuration requested.
-
-