| java.lang.Object | |
| ↳ | org.mule.module.ldap.LDAPConnector |
Known Direct Subclasses
|
Known Indirect Subclasses
|
The LDAP Connector will allow to connect to any LDAP server and perform every LDAP operation:
| URL |
The connection URL to the LDAP server. LDAP connection URLs have the following syntax: ldap[s]://hostname:port/base_dn
|
| Type |
The implementation of the connection to be used. Right now the only available implementation is JNDI, though any other
implementation can be used (For example using Novell libraries). If you want to create your own implementation you should
extend the class LDAPConnection
|
| Initial Pool Size | The string representation of an integer that represents the number of connections per connection identity to create when initially creating a connection for the identity. To disable pooling, just set this value to 0 (zero). |
| Max Pool Size | The string representation of an integer that represents the maximum number of connections per connection identity that can be maintained concurrently. |
| Pool Timeout | The string representation of an integer that represents the number of milliseconds that an idle connection may remain in the pool without being closed and removed from the pool. |
| Referral |
Constant that holds the name of the environment property for specifying how referrals encountered by the service provider are to be processed.
The value of the property is one of the following strings:
|
| Extended Configuration |
This is a Map instance holding extended configuration attributes that will be used in the Context environment.
Values configured here have less precedence than the other values that are allowed
in the module configuration.
Some examples of extended properties (key: value) are:
|
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| LOGGER | |||||||||||
| connection | |||||||||||
| extendedConfiguration | This is a Map instance holding extended configuration attributes that will be used in the Context environment. | ||||||||||
| initialPoolSize | The string representation of an integer that represents the number of connections per connection identity to create when initially creating a connection for the identity. | ||||||||||
| maxPoolSize | The string representation of an integer that represents the maximum number of connections per connection identity that can be maintained concurrently. | ||||||||||
| poolTimeout | The string representation of an integer that represents the number of milliseconds that an idle connection may remain in the pool without being closed and removed from the pool. | ||||||||||
| referral | Constant that holds the name of the environment property for specifying how referrals encountered by the service provider are to be processed (follow, ignore, throw). | ||||||||||
| type | The implementation of the connection to be used. | ||||||||||
| url | The connection URL to the LDAP server with the following syntax: ldap[s]://hostname:port/base_dn. |
||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new
LDAPEntry in the LDAP server. | |||||||||||
Creates a new entry in the LDAP server from a Map representation.
| |||||||||||
Adds all the values for an attribute in an existing LDAP entry.
| |||||||||||
Adds a value for an attribute in an existing LDAP entry.
| |||||||||||
Performs an LDAP bind (login) operation.
| |||||||||||
Establish the connection to the LDAP server and use connection management to handle different
users.
| |||||||||||
Returns the connection ID
| |||||||||||
Deletes the LDAP entry represented by the provided distinguished name.
| |||||||||||
Deletes all the values matching attributeValues of the attribute defined by attributeName.
| |||||||||||
Deletes the value matching attributeValue of the attribute defined by attributeName.
| |||||||||||
Disconnect the current connection
| |||||||||||
Are we connected?
| |||||||||||
Transforms a
LDAPEntry to a String in LDIF representation (RFC 2849). | |||||||||||
Creates the Map representation of an
LDAPEntry. | |||||||||||
Retrieves an entry from the LDAP server base on its distinguished name (DN).
| |||||||||||
Creates a
LDAPEntry from its Map representation. | |||||||||||
Updates an existing
LDAPEntry in the LDAP server. | |||||||||||
Updates an existing entry in the LDAP server from a Map representation.
| |||||||||||
Updates (replaces) the value or values of the attribute defined by attributeName with the new values defined by
attributeValues.
| |||||||||||
Updates (replaces) the value or values of the attribute defined by attributeName with the new value defined by
attributeValue.
| |||||||||||
Performs a LDAP search and streams result to the rest of the flow.
| |||||||||||
Renames and existing LDAP entry (moves and entry from a DN to another one).
| |||||||||||
Performs a LDAP search returning a list with all the resulting LDAP entries.
| |||||||||||
Performs a LDAP search that is supposed to return a unique result.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
This is a Map instance holding extended configuration attributes that will be used in the Context environment.
The string representation of an integer that represents the number of connections per connection identity to create when initially creating a connection for the identity. To disable pooling, just set this value to 0 (zero).
The string representation of an integer that represents the maximum number of connections per connection identity that can be maintained concurrently.
The string representation of an integer that represents the number of milliseconds that an idle connection may remain in the pool without being closed and removed from the pool.
Constant that holds the name of the environment property for specifying how referrals encountered by the service provider are to be processed (follow, ignore, throw).
The connection URL to the LDAP server with the following syntax: ldap[s]://hostname:port/base_dn.
Creates a new LDAPEntry in the LDAP server. The entry should contain the distinguished name (DN), the objectClass
attributes that define its structure and at least a value for all the required attributes (required attributes depend on the
object classes assigned to the entry. You can refer to RFC 4519 for standard object classes and attributes.
| entry | The LDAPEntry that should be added. |
|---|
| NoPermissionException | If the current binded user has no permissions to add entries under any of the RDN (relative DN) that compose the entry DN. |
|---|---|
| InvalidAttributeException | If the structure of the entry is invalid (for example there are missing required attributes or it has attributes that are not part of any of the defined object classes) |
| NameAlreadyBoundException | If there is already an existing entry with the same DN in the LDAP server tree. |
| LDAPException | In case there is any other exception, mainly related to connectivity problems or referrals. |
| Exception | In case there is any other error creating the entry. |
Creates a new entry in the LDAP server from a Map representation. The distinguished name (DN) of the
entry is first obtained from the optional parameter dn and if this value is blank (null, empty string
or string with only space chars) then the DN should be a present in the entry map as a String value
under the key "dn" (see MAP_DN_KEY).
"dn" (see MAP_DN_KEY) and the value
a String representing the distinguished name (for example cn=andy,ou=people,dc=mulesoft,dc=org).| dn | The primary value to use as DN of the entry. If not set, then the DN will be retrieved from the map representing the entry under the key dn. |
|---|---|
| entry | Map representation of the LDAP entry. |
| NoPermissionException | If the current binded user has no permissions to add entries under any of the RDN (relative DN) that compose the entry DN. |
|---|---|
| InvalidAttributeException | If the structure of the entry is invalid (for example there are missing required attributes or it has attributes that are not part of any of the defined object classes) |
| NameAlreadyBoundException | If there is already an existing entry with the same DN in the LDAP server tree. |
| LDAPException | In case there is any other exception, mainly related to connectivity problems or referrals. |
| Exception | In case there is any other error creating the entry (for example if the DN is not passed as an argument nor in the entry map). |
Adds all the values for an attribute in an existing LDAP entry. If the entry already contained a value (or values) for the given attributeName then these values will be added. The attribute should allow multiple values or an exception will be raised.
| dn | The DN of the LDAP entry to modify |
|---|---|
| attributeName | The name of the attribute to add values to. |
| attributeValues | The values for the attribute |
| NoPermissionException | If the current binded user has no permissions to update the entry. |
|---|---|
| NameNotFoundException | If there is no existing entry for the given DN. |
| InvalidAttributeException | If the attribute value is invalid or the entry already has the provided value. |
| LDAPException | In case there is any other exception, mainly related to connectivity problems or referrals. |
| Exception | In case there is any other error updating the entry. |
Adds a value for an attribute in an existing LDAP entry. If the entry already contained a value for the given attributeName then this value will be added (only if the attribute is multi value and there entry didn't have the value already).
If you want to add a value with a type different than String, then you can use the add-multi-value-attribute operation and define a one element list with the value.| dn | The DN of the LDAP entry to modify |
|---|---|
| attributeName | The name of the attribute to add a value to. |
| attributeValue | The value for the attribute |
| NoPermissionException | If the current binded user has no permissions to update the entry. |
|---|---|
| InvalidAttributeException | If the attribute value is invalid or the entry already has the provided value. |
| NameNotFoundException | If there is no existing entry for the given DN. |
| LDAPException | In case there is any other exception, mainly related to connectivity problems or referrals. |
| Exception | In case there is any other error updating the entry. |
Performs an LDAP bind (login) operation. After login there will be a LDAP connection pool ready to use for other operations using the authenticated user. If no values are provided to override authDn and authPassword then using this operation will just re-bind (re-authenticate) the user/password defined in the config element. If new values are provided for authDn and authPassword, then authentication will be performed.
LDAPEntry of the authenticated user.| NoPermissionException | If the current binded user has no permissions to perform the lookup for its own LDAP entry. |
|---|---|
| NameNotFoundException | If base DN is invalid (for example it doesn't exist) |
| LDAPException | In case there is any other exception, mainly related to connectivity problems or referrals. |
| Exception | In case there is any other error performing the login and posterior lookup. |
Establish the connection to the LDAP server and use connection management to handle different users.
| authDn | The DN (distinguished name) of the user (for example: uid=user,ou=people,dc=mulesoft,dc=org). If using Microsoft Active Directory, instead of the DN, you can provide the user@domain (for example: user@mulesoft.org) |
|---|---|
| authPassword | The password of the user |
| authentication | Specifies the authentication mechanism to use. For the Sun LDAP service provider, this can be one of the following strings:
|
| ConnectionException | Holding one of the possible values in ConnectionExceptionCode. |
|---|
Returns the connection ID
Deletes the LDAP entry represented by the provided distinguished name. The entry should not have child entries, in which case a
ContextNotEmptyException is thrown.
NameNotFoundException if any of the intermediate contexts do not exist.
| dn | The DN of the LDAP entry to delete |
|---|
| NoPermissionException | If the current binded user has no permissions to delete the entry. |
|---|---|
| NameNotFoundException | If an intermediate context does not exist. |
| ContextNotEmptyException | If the entry to delete has child entries. |
| LDAPException | In case there is any other exception, mainly related to connectivity problems or referrals. |
| Exception | In case there is any other error deleting the entry. |
Deletes all the values matching attributeValues of the attribute defined by attributeName. Values that are not present in the entry are ignored. If no values are specified, then the whole attribute is deleted from the entry.
| dn | The DN of the LDAP entry to modify |
|---|---|
| attributeName | The name of the attribute to delete its values. |
| attributeValues | The values that should be deleted. |
| NoPermissionException | If the current binded user has no permissions to update the entry. |
|---|---|
| NameNotFoundException | If there is no existing entry for the given DN. |
| LDAPException | In case there is any other exception, mainly related to connectivity problems or referrals. |
| Exception | In case there is any other error updating the entry. |
Deletes the value matching attributeValue of the attribute defined by attributeName. If the entry didn't have the value, then the entry stays the same. If no value is specified, then the whole attribute is deleted from the entry.
If you want to delete a value with a type different than String, then you can use the delete-multi-value-attribute operation and define a one element list with the value.| dn | The DN of the LDAP entry to modify |
|---|---|
| attributeName | The name of the attribute to delete its value. |
| attributeValue | The value that should be deleted. |
| NoPermissionException | If the current binded user has no permissions to update the entry. |
|---|---|
| NameNotFoundException | If there is no existing entry for the given DN. |
| LDAPException | In case there is any other exception, mainly related to connectivity problems or referrals. |
| Exception | In case there is any other error updating the entry. |
Disconnect the current connection
Are we connected?
Creates the Map representation of an LDAPEntry.
"dn" (see MAP_DN_KEY).byte[]).byte[]).| entry | The LDAPEntry to transform to map. |
|---|
Retrieves an entry from the LDAP server base on its distinguished name (DN). DNs are the unique identifiers of an LDAP entry, so this method will perform a search based on this ID and so return a single entry as result or throw an exception if the DN is invalid or inexistent.
Use this operation oversearchOne(String, String, List, SearchScope, int, long, boolean) when you know the DN of the object you want to
retrieve.
| dn | The DN of the LDAP entry that will be retrieved. |
|---|---|
| attributes | A list of the attributes that should be returned in the result. If the attributes list is empty or null, then by default all LDAP entry attributes are returned. |
LDAPEntry for the given dn parameter.| NoPermissionException | If the current binded user has no permissions to perform the lookup for the given DN. |
|---|---|
| NameNotFoundException | If base DN is invalid (for example it doesn't exist) |
| LDAPException | In case there is any other exception, mainly related to connectivity problems or referrals. |
| Exception | In case there is any other error performing the search. |
Creates a LDAPEntry from its Map representation. This transformer won't check that the entry is valid. The only validation
that is performed is the presence of the distinguished name.
"dn" (see MAP_DN_KEY) and the value a String representing the distinguished name
(for example cn=andy,ou=people,dc=mulesoft,dc=org).| entry | Map representation of the LDAP entry. |
|---|
LDAPEntry object.| Exception | If the map entry is invalid (for example, it doesn't contain the DN) |
|---|
Updates an existing LDAPEntry in the LDAP server. The entry should contain an existing distinguished name (DN), the objectClass
attributes that define its structure and at least a value for all the required attributes (required attributes depend on the
object classes assigned to the entry. You can refer to RFC 4519 for standard object classes and attributes.
dn: cn=entry,ou=group,dc=company,dc=org
cn: entry
attr1: Value1
attr2: Value2
multi1: Value3
multi1: Value4
objectclass: top
objectclass: myentry
dn: cn=entry,ou=group,dc=company,dc=org
attr1: NewValue
attr3: NewAttributeValue
dn: cn=entry,ou=group,dc=company,dc=org
cn: entry
attr1: NewValue
attr2: Value2
multi1: Value3
multi1: Value4
attr3: NewAttributeValue
objectclass: top
objectclass: myentry
| entry | The LDAPEntry that should be updated. |
|---|
| NoPermissionException | If the current binded user has no permissions to update entries under any of the RDN (relative DN) that compose the entry DN. |
|---|---|
| InvalidAttributeException | If the structure of the entry is invalid (for example there are missing required attributes or it has attributes that are not part of any of the defined object classes) |
| NameNotFoundException | If there is no existing entry with the same DN in the LDAP server tree. |
| LDAPException | In case there is any other exception, mainly related to connectivity problems or referrals. |
| Exception | In case there is any other error updating the entry. |
Updates an existing entry in the LDAP server from a Map representation. The distinguished name (DN) of the
entry is first obtained from the optional parameter dn and if this value is blank (null, empty string
or string with only space chars) then the DN should be a present in the entry map as a String value
under the key "dn" (see MAP_DN_KEY).
dn: cn=entry,ou=group,dc=company,dc=org
cn: entry
attr1: Value1
attr2: Value2
multi1: Value3
multi1: Value4
objectclass: top
objectclass: myentry
dn: cn=entry,ou=group,dc=company,dc=org
attr1: NewValue
attr3: NewAttributeValue
dn: cn=entry,ou=group,dc=company,dc=org
cn: entry
attr1: NewValue
attr2: Value2
multi1: Value3
multi1: Value4
attr3: NewAttributeValue
objectclass: top
objectclass: myentry
In order to represent a LDAP entry as a map, you should consider the following rules for the map key/value pair:
"dn" (see MAP_DN_KEY) and the value
a String representing the distinguished name (for example cn=andy,ou=people,dc=mulesoft,dc=org).| dn | The primary value to use as DN of the entry. If not set, then the DN will be retrieved from the map representing the entry under the key dn. |
|---|---|
| entry | Map representation of the LDAP entry. |
| NoPermissionException | If the current binded user has no permissions to update entries under any of the RDN (relative DN) that compose the entry DN. |
|---|---|
| InvalidAttributeException | If the structure of the entry is invalid (for example there are missing required attributes or it has attributes that are not part of any of the defined object classes) |
| NameNotFoundException | If there is no existing entry with the same DN in the LDAP server tree. |
| LDAPException | In case there is any other exception, mainly related to connectivity problems or referrals. |
| Exception | In case there is any other error updating the entry (for example if the DN is not passed as an argument nor in the entry map). |
Updates (replaces) the value or values of the attribute defined by attributeName with the new values defined by attributeValues. If the attribute was not present in the entry, then the value is added.
| dn | The DN of the LDAP entry to modify |
|---|---|
| attributeName | The name of the attribute to update its values. |
| attributeValues | The new values for the attribute |
| NoPermissionException | If the current binded user has no permissions to update the entry. |
|---|---|
| NameNotFoundException | If there is no existing entry for the given DN. |
| LDAPException | In case there is any other exception, mainly related to connectivity problems or referrals. |
| Exception | In case there is any other error updating the entry. |
Updates (replaces) the value or values of the attribute defined by attributeName with the new value defined by attributeValue. If the attribute was not present in the entry, then the value is added.
If you want to update a value with a type different than String, then you can use the update-multi-value-attribute operation and define a one element list with the value.| dn | The DN of the LDAP entry to modify |
|---|---|
| attributeName | The name of the attribute to update its value. |
| attributeValue | The new value for the attribute |
| NoPermissionException | If the current binded user has no permissions to update the entry. |
|---|---|
| NameNotFoundException | If there is no existing entry for the given DN. |
| LDAPException | In case there is any other exception, mainly related to connectivity problems or referrals. |
| Exception | In case there is any other error updating the entry. |
Performs a LDAP search and streams result to the rest of the flow. This means that instead of returning a list with all results it partitions the LDAP search result into pages (individual entry if resultPageSize is 1) or lists of size resultPageSize.
For queries returning large results it is recommended to use pagination (not all LDAP servers support this or are configured to support it). For that you need to provide a page size value that should be less or equal than max results (count limit). If you are getting a Size Limit Exceeded exception message then you should check that the authenticated user has enough privileges or the LDAP server is not limited by configuration.| baseDn | The base DN of the LDAP search. |
|---|---|
| filter | A valid LDAP filter. The LDAP connector supports LDAP search filters as defined in RFC 2254. Some examples are:
|
| attributes | A list of the attributes that should be returned in the result. If the attributes list is empty or null, then by default all LDAP entry attributes are returned. |
| scope | The scope of the search. Valid attributes are:
|
| timeout | Search timeout in milliseconds. If the value is 0, this means to wait indefinitely. |
| maxResults | The maximum number of entries that will be returned as a result of the search. 0 indicates that all entries will be returned. |
| returnObject | Enables/disables returning objects returned as part of the result. If disabled, only the name and class of the object is returned. If enabled, the object will be returned. |
| pageSize | If the LDAP server supports paging results set in this attribute the size of the page. If the pageSize is less or equals than 0, then paging will be disabled. |
| resultPageSize | The size of the list this operation streams. If this value is less than 1, then it will be considered that the page size is 1. |
| callback | Used to stream results |
| NoPermissionException | If the current binded user has no permissions to perform the search under the given base DN. |
|---|---|
| NameNotFoundException | If base DN is invalid (for example it doesn't exist) |
| LDAPException | In case there is any other exception, mainly related to connectivity problems or referrals. |
| Exception | In case there is any other error performing the search. |
Renames and existing LDAP entry (moves and entry from a DN to another one).
| oldDn | DN of the existing entry that will be renamed. |
|---|---|
| newDn | Destination DN |
| NameAlreadyBoundException | If there is already an existing entry with the same DN as newDn. |
|---|---|
| LDAPException | In case there is any other exception, mainly related to connectivity problems or referrals. |
| Exception | In case there is any other error deleting the entry. |
Performs a LDAP search returning a list with all the resulting LDAP entries.
For queries returning large results it is recommended to use pagination (not all LDAP servers support this or are configured to support it). For that you need to provide a page size value that should be less or equal than max results (count limit). If you are getting a Sizelimit Exceeded exception then you should check that the authenticated user has enough privileges or the LDAP server is not limited by configuration.| baseDn | The base DN of the LDAP search. |
|---|---|
| filter | A valid LDAP filter. The LDAP connector supports LDAP search filters as defined in RFC 2254. Some examples are:
|
| attributes | A list of the attributes that should be returned in the result. If the attributes list is empty or null, then by default all LDAP entry attributes are returned. |
| scope | The scope of the search. Valid attributes are:
|
| timeout | Search timeout in milliseconds. If the value is 0, this means to wait indefinitely. |
| maxResults | The maximum number of entries that will be returned as a result of the search. 0 indicates that all entries will be returned. |
| returnObject | Enables/disables returning objects returned as part of the result. If disabled, only the name and class of the object is returned. If enabled, the object will be returned. |
| pageSize | If the LDAP server supports paging results set in this attribute the size of the page. If the pageSize is less or equals than 0, then paging will be disabled. |
LDAPEntry objects with the results of the search. If the search throws no results, then this is an empty list.| NoPermissionException | If the current binded user has no permissions to perform the search under the given base DN. |
|---|---|
| NameNotFoundException | If base DN is invalid (for example it doesn't exist) |
| LDAPException | In case there is any other exception, mainly related to connectivity problems or referrals. |
| Exception | In case there is any other error performing the search. |
Performs a LDAP search that is supposed to return a unique result. If the search returns more than one result, then a warn log message is generated and the first element of the result is returned.
Use this operation overlookup(String, List) when you know don't know the DN of the entry you need
to retrieve but you have a set of attributes that you know should return a single entry (for example an email address)
| baseDn | The base DN of the LDAP search. |
|---|---|
| filter | A valid LDAP filter. The LDAP connector supports LDAP search filters as defined in RFC 2254. Some examples are:
|
| attributes | A list of the attributes that should be returned in the result. If the attributes list is empty or null, then by default all LDAP entry attributes are returned. |
| scope | The scope of the search. Valid attributes are:
|
| timeout | Search timeout in milliseconds. If the value is 0, this means to wait indefinitely. |
| maxResults | The maximum number of entries that will be returned as a result of the search. 0 indicates that all entries will be returned. |
| returnObject | Enables/disables returning objects returned as part of the result. If disabled, only the name and class of the object is returned. If enabled, the object will be returned. |
LDAPEntry with the first element of the search result or null if there are no results.| NoPermissionException | If the current binded user has no permissions to perform the search under the given base DN. |
|---|---|
| NameNotFoundException | If base DN is invalid (for example it doesn't exist) |
| LDAPException | In case there is any other exception, mainly related to connectivity problems or referrals. |
| Exception | In case there is any other error performing the search. |
| extendedConfiguration |
|---|
| initialPoolSize |
|---|
| maxPoolSize |
|---|
| poolTimeout |
|---|
| url |
|---|