Package com.ibm.di.connector
Class DSMLv2SOAPConnector
- java.lang.Object
-
- com.ibm.di.connector.Connector
-
- com.ibm.di.connector.DSMLv2SOAPConnector
-
- All Implemented Interfaces:
ConnectorInterface
,VersionInfoInterface
public class DSMLv2SOAPConnector extends Connector implements ConnectorInterface
The DSMLv2 SOAP Connector implements the DSMLv2 standard (http://www.oasis-open.org/committees/dsml/docs/DSMLv2.doc). It is able to execute DSMLv2 requests against a DSML Server. It also provides the option to use DSML SOAP binding.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATTR_NAME_HTTP_BODY
An attribute name: "http.body"static java.lang.String
ATTR_NAME_HTTP_CHARACTER_SET
An attribute name: "characterSet"static java.lang.String
ATTR_NAME_HTTP_CONTENT_TYPE
An attribute name: "http.Content-Type"static java.lang.String
ATTR_NAME_HTTP_METHOD
An attribute name: "http.method"static java.lang.String
ATTR_NAME_HTTP_REMOTE_PASSWORD
An attribute name: "http.remote_pass"static java.lang.String
ATTR_NAME_HTTP_REMOTE_USER
An attribute name: "http.remote_user"static java.lang.String
ATTR_NAME_HTTP_SOAPACTION
An attribute name: "http.SOAPAction"static java.lang.String
ATTR_NAME_HTTP_URL
An attribute name: "http.url"static java.lang.String
BASE_OBJECT
IBM TDS DSMLv2 String constant.static java.lang.String
HTTP_BASIC_AUTH
String constant.static java.lang.String
PARAMETER_AUTH_METHOD
A parameter name: "authenticationMethod"static java.lang.String
PARAMETER_BINARY_ATTRIBUTES
A parameter name: "binaryAttributes"static java.lang.String
PARAMETER_PASSWORD
A parameter name: "password"static java.lang.String
PARAMETER_SEARCH_BASE
A parameter name: "searchBase"static java.lang.String
PARAMETER_SEARCH_FILTER
A parameter name: "searchFilter"static java.lang.String
PARAMETER_SEARCH_SCOPE
A parameter name: "searchScope"static java.lang.String
PARAMETER_SOAPACTION
A parameter name: "soapAction"static java.lang.String
PARAMETER_SOAPBINDING
A parameter name: "soapbinding"static java.lang.String
PARAMETER_URL
A parameter name: "url"static java.lang.String
PARAMETER_USERNAME
A parameter name: "username"static java.lang.String
SINGLE_LEVEL
IBM TDS DSMLv2 String constant.static java.lang.String
WHOLE_SUBTREE
IBM TDS DSMLv2 String constant.-
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
-
-
Constructor Summary
Constructors Constructor Description DSMLv2SOAPConnector()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteEntry(Entry aEntry, SearchCriteria aSearch)
This method first look for an attribute with nameDsmlv2Parser.ATTR_NAME_DN
in the provided entry if not found it looks the first criteria in the SearchCriteria object for the same name.Entry
findEntry(SearchCriteria aSearch)
Finds an existing entry.Entry
getNextEntry()
Gets an entry form the resultSet.java.lang.String
getVersion()
Version information.void
initialize(java.lang.Object o)
Initializes the connector.boolean
isDeltaSupported()
Delta mode supported.void
modEntry(Entry entry, SearchCriteria search)
Modifies an existing entry.void
modEntry(Entry entry, SearchCriteria search, Entry old)
Modifies an existing entry.void
putEntry(Entry aPutEntry)
Sends the DSML request to the DSML Server.Entry
queryReply(Entry aQueryEntry)
Sends the DSML request to the DSML Server.void
selectEntries()
Initializes the connection with the server and sends a request based on the configured parameters.-
Methods inherited from class com.ibm.di.connector.Connector
addFindEntry, allModes, clearFindEntries, debug, debugMode, extractExceptionInformation, findEntry, getBoolean, getClassInstance, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getLog, getMaxDuplicateEntries, getModes, getModes, getName, getNextClient, getNextFindEntry, getParam, getParser, getProperty, getPushbackEntry, getRawConnectorConfiguration, getRSInterface, getUI, hasConfigValue, hasParser, initParser, isExceptionFatal, isIOException, logError, logmsg, pushback, queryOperations, querySchema, queryTables, reconnect, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setDebugMode, setLog, setMaxDuplicateEntries, setModes, setModes, setName, setParam, setParser, setProperty, setRSInterface, terminate, terminateServer
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ibm.di.connector.ConnectorInterface
getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getMaxDuplicateEntries, getName, getNextClient, getNextFindEntry, getParam, getPushbackEntry, getRawConnectorConfiguration, isExceptionFatal, isIOException, pushback, queryOperations, querySchema, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminate, terminateServer
-
-
-
-
Field Detail
-
PARAMETER_URL
public static final java.lang.String PARAMETER_URL
A parameter name: "url"- See Also:
- Constant Field Values
-
PARAMETER_AUTH_METHOD
public static final java.lang.String PARAMETER_AUTH_METHOD
A parameter name: "authenticationMethod"- See Also:
- Constant Field Values
-
PARAMETER_USERNAME
public static final java.lang.String PARAMETER_USERNAME
A parameter name: "username"- See Also:
- Constant Field Values
-
PARAMETER_PASSWORD
public static final java.lang.String PARAMETER_PASSWORD
A parameter name: "password"- See Also:
- Constant Field Values
-
PARAMETER_BINARY_ATTRIBUTES
public static final java.lang.String PARAMETER_BINARY_ATTRIBUTES
A parameter name: "binaryAttributes"- See Also:
- Constant Field Values
-
PARAMETER_SEARCH_BASE
public static final java.lang.String PARAMETER_SEARCH_BASE
A parameter name: "searchBase"- See Also:
- Constant Field Values
-
PARAMETER_SEARCH_FILTER
public static final java.lang.String PARAMETER_SEARCH_FILTER
A parameter name: "searchFilter"- See Also:
- Constant Field Values
-
PARAMETER_SEARCH_SCOPE
public static final java.lang.String PARAMETER_SEARCH_SCOPE
A parameter name: "searchScope"- See Also:
- Constant Field Values
-
PARAMETER_SOAPBINDING
public static final java.lang.String PARAMETER_SOAPBINDING
A parameter name: "soapbinding"- See Also:
- Constant Field Values
-
PARAMETER_SOAPACTION
public static final java.lang.String PARAMETER_SOAPACTION
A parameter name: "soapAction"- See Also:
- Constant Field Values
-
ATTR_NAME_HTTP_SOAPACTION
public static final java.lang.String ATTR_NAME_HTTP_SOAPACTION
An attribute name: "http.SOAPAction"- See Also:
- Constant Field Values
-
ATTR_NAME_HTTP_URL
public static final java.lang.String ATTR_NAME_HTTP_URL
An attribute name: "http.url"- See Also:
- Constant Field Values
-
ATTR_NAME_HTTP_METHOD
public static final java.lang.String ATTR_NAME_HTTP_METHOD
An attribute name: "http.method"- See Also:
- Constant Field Values
-
ATTR_NAME_HTTP_REMOTE_USER
public static final java.lang.String ATTR_NAME_HTTP_REMOTE_USER
An attribute name: "http.remote_user"- See Also:
- Constant Field Values
-
ATTR_NAME_HTTP_REMOTE_PASSWORD
public static final java.lang.String ATTR_NAME_HTTP_REMOTE_PASSWORD
An attribute name: "http.remote_pass"- See Also:
- Constant Field Values
-
ATTR_NAME_HTTP_BODY
public static final java.lang.String ATTR_NAME_HTTP_BODY
An attribute name: "http.body"- See Also:
- Constant Field Values
-
ATTR_NAME_HTTP_CONTENT_TYPE
public static final java.lang.String ATTR_NAME_HTTP_CONTENT_TYPE
An attribute name: "http.Content-Type"- See Also:
- Constant Field Values
-
ATTR_NAME_HTTP_CHARACTER_SET
public static final java.lang.String ATTR_NAME_HTTP_CHARACTER_SET
An attribute name: "characterSet"- See Also:
- Constant Field Values
-
HTTP_BASIC_AUTH
public static final java.lang.String HTTP_BASIC_AUTH
String constant.- See Also:
- Constant Field Values
-
BASE_OBJECT
public static final java.lang.String BASE_OBJECT
IBM TDS DSMLv2 String constant.- See Also:
- Constant Field Values
-
SINGLE_LEVEL
public static final java.lang.String SINGLE_LEVEL
IBM TDS DSMLv2 String constant.- See Also:
- Constant Field Values
-
WHOLE_SUBTREE
public static final java.lang.String WHOLE_SUBTREE
IBM TDS DSMLv2 String constant.- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public void initialize(java.lang.Object o) throws java.lang.Exception
Initializes the connector. Parses all the configuration parameters.- Specified by:
initialize
in interfaceConnectorInterface
- Overrides:
initialize
in classConnector
- Parameters:
o
- - ignored- Throws:
java.lang.Exception
- if the "url" parameter is missing or the protocol used is neither "http" nor "https".
-
putEntry
public void putEntry(Entry aPutEntry) throws java.lang.Exception
Sends the DSML request to the DSML Server. The entry is first parsed. If the server response indicates that an error has occurred then an exception with that error will be thrown.- Specified by:
putEntry
in interfaceConnectorInterface
- Overrides:
putEntry
in classConnector
- Parameters:
aPutEntry
- the DSML request as an Entry object, used by the DSMLv2Parser.- Throws:
java.lang.Exception
- if the distinguish parameter is missing or the DSML Server replied with an error code.
-
queryReply
public Entry queryReply(Entry aQueryEntry) throws java.lang.Exception
Sends the DSML request to the DSML Server. The entry is first parsed. If the server response indicates that an error has occurred then an exception with that error will be thrown. If the response is not an error then that response is parsed back as anEntry
object.- Specified by:
queryReply
in interfaceConnectorInterface
- Overrides:
queryReply
in classConnector
- Parameters:
aQueryEntry
- the DSML request as an Entry object, used by the DSMLv2Parser.- Returns:
- the DSML response as an Entry object, used by the DSMLv2Parser.
- Throws:
java.lang.Exception
- if the DSML Server replied with an error code.
-
selectEntries
public void selectEntries() throws java.lang.Exception
Initializes the connection with the server and sends a request based on the configured parameters. This operation prepares the result set so thegetNextEntry()
could return single entry at a time.- Specified by:
selectEntries
in interfaceConnectorInterface
- Overrides:
selectEntries
in classConnector
- Throws:
java.lang.Exception
- if the server responded with an error message.
-
getNextEntry
public Entry getNextEntry() throws java.lang.Exception
Gets an entry form the resultSet. The resultSet is created during theselectEntries()
operation.- Specified by:
getNextEntry
in interfaceConnectorInterface
- Overrides:
getNextEntry
in classConnector
- Returns:
- The next entry in the resultSet.
- Throws:
java.lang.Exception
- - never- See Also:
ConnectorInterface.selectEntries()
-
findEntry
public Entry findEntry(SearchCriteria aSearch) throws java.lang.Exception
Finds an existing entry. The search criteria specifies which entry to locateHere is an example of how to find all people with names starting with 'J' which are from IBM organization in US.
Example:
var ctor = input.getConnector(); var crit = new com.ibm.di.SearchCriteria("$dn", com.ibm.di.SearchCriteria.SUBSTRING, "c=US,o=IBM"); crit.addCriteria("name", com.ibm.di.SearchCriteria.INITIAL_STRING, "J"); crit.addCriteria("objectclass", com.ibm.di.SearchCriteria.SUBSTRING, "person"); var res = ctor.findEntry(crit); if (res != null) { main.logmsg("Found entry:"); main.dumpEntry(res); } else { if( getFindEntryCount()> 1 ){ main.logmsg("Found these entries:"); while ( (entry = ctor.getNextFindEntry()) != null ) { main.dumpEntry(entry); } } else { main.logmsg("Entry not found!"); } }
- Specified by:
findEntry
in interfaceConnectorInterface
- Overrides:
findEntry
in classConnector
- Parameters:
aSearch
- The search criteria used to locate the entry to be modified- Returns:
- The entry found, or null if no or multiple entries found
- Throws:
java.lang.Exception
- if an error occurs.
-
modEntry
public void modEntry(Entry entry, SearchCriteria search) throws java.lang.Exception
Modifies an existing entry. The new entry data is given by the entry parameter and the search criteria specifies which entry to modify.- Specified by:
modEntry
in interfaceConnectorInterface
- Overrides:
modEntry
in classConnector
- Parameters:
entry
- The entry datasearch
- The search criteria used to locate the entry to be modified- Throws:
java.lang.Exception
- if an error occurs.
-
modEntry
public void modEntry(Entry entry, SearchCriteria search, Entry old) throws java.lang.Exception
Modifies an existing entry. The new entry data is given by the entry parameter and the search criteria specifies which entry to modify.- Specified by:
modEntry
in interfaceConnectorInterface
- Overrides:
modEntry
in classConnector
- Parameters:
entry
- The entry datasearch
- The search criteria used to locate the entry to be modifiedold
- The old entry found by the search criteria- Throws:
java.lang.Exception
- if an error occurs.
-
deleteEntry
public void deleteEntry(Entry aEntry, SearchCriteria aSearch) throws java.lang.Exception
This method first look for an attribute with nameDsmlv2Parser.ATTR_NAME_DN
in the provided entry if not found it looks the first criteria in the SearchCriteria object for the same name. If not found an exception is thrown. After the distinguished name is found the entry is parsed as a DSMLv2 request and sent. If the returned response indicates that an error had occurred then an exception is thrown.- Specified by:
deleteEntry
in interfaceConnectorInterface
- Overrides:
deleteEntry
in classConnector
- Parameters:
aEntry
- the entry which is the result of the attribute mappingaSearch
- the search criteria object.- Throws:
java.lang.Exception
- if an error while deleting the entry has occurred.
-
isDeltaSupported
public boolean isDeltaSupported()
Delta mode supported.- Specified by:
isDeltaSupported
in interfaceConnectorInterface
- Overrides:
isDeltaSupported
in classConnector
- Returns:
- true
-
getVersion
public java.lang.String getVersion()
Version information.- Specified by:
getVersion
in interfaceVersionInfoInterface
- Returns:
- version information.
-
-