|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wewebu.ow.server.util.ldap.OwLdapConnection
public class OwLdapConnection
A LDAP connection contains the directory connection Properties
(see InitialDirContext.InitialDirContext(java.util.Hashtable)
and standard directory operations needed by the Alfresco Workdesk connector and its schema interpreters.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
Constructor Summary | |
---|---|
OwLdapConnection(Properties ldapProperties_p,
int recursionLevel_p)
Constructor |
Method Summary | |
---|---|
InitialLdapContext |
createInitialDirContext()
|
Object |
getAttributeValue(String distinguishedName_p,
String attributeName_p)
Get the attribute value for given attribute name. |
String |
getAttributeValue(String distinguishedName_p,
String attributeName_p,
boolean trimmCommonName_p)
|
Properties |
getProperties()
|
String |
getProperty(String propertyName_p,
String defaultValue_p)
|
int |
getRecursionLevel()
|
Object |
getUserAttributeValue(String attributeName_p)
|
String |
getUserAttributeValue(String attributeName_p,
boolean trimmCommonName_p)
|
String |
getUserDistinguishedName()
|
NamingEnumeration<SearchResult> |
search(String searchBase_p,
String[][] attributeValues_p,
String[] returnIds_p)
Searches the LDAP repository for records matching the given pattern. |
Collection<String> |
searchAttributeValues(String searchBase_p,
String[][] matchAttrs_p,
String attribute_p)
|
OwObjectCollection |
searchValuesByFilter(String searchBase,
String filter,
String returningAttibute,
String sortKey)
Search for objects with attributes matching a given pattern. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OwLdapConnection(Properties ldapProperties_p, int recursionLevel_p)
ldapProperties_p
- this connection propertiesrecursionLevel_p
- the configured recursion levelMethod Detail |
---|
public InitialLdapContext createInitialDirContext() throws OwConfigurationException
InitialDirContext
based on this connection properties
OwConfigurationException
- if the context creation failspublic String getProperty(String propertyName_p, String defaultValue_p)
propertyName_p
- defaultValue_p
-
public int getRecursionLevel()
This configuration parameter has nothing to do with LDAP nested records.
public Properties getProperties()
public String getUserDistinguishedName() throws OwAuthenticationException
OwAuthenticationException
- if no user was authenticated (the OwLdapConnector.USER_DN_PROPERTY
is not defined in the properties of this connection)public String getUserAttributeValue(String attributeName_p, boolean trimmCommonName_p) throws OwAuthenticationException, OwConfigurationException, OwInvalidOperationException
attributeName_p
- trimmCommonName_p
- if true
common name prefixed values will be
stripped of their common name prefixes (egg. "cn: alice" will be returned as "alice")
OwAuthenticationException
OwConfigurationException
OwInvalidOperationException
public Object getUserAttributeValue(String attributeName_p) throws OwAuthenticationException, OwConfigurationException, OwInvalidOperationException
attributeName_p
-
OwAuthenticationException
OwConfigurationException
OwInvalidOperationException
public String getAttributeValue(String distinguishedName_p, String attributeName_p, boolean trimmCommonName_p) throws OwAuthenticationException, OwConfigurationException, OwInvalidOperationException
distinguishedName_p
- attributeName_p
- trimmCommonName_p
- if true
common name prefixed values will be
stripped of their common name prefixes (egg. "cn: alice" will be returned as "alice")
OwAuthenticationException
OwConfigurationException
OwInvalidOperationException
public Object getAttributeValue(String distinguishedName_p, String attributeName_p) throws OwAuthenticationException, OwConfigurationException, OwInvalidOperationException
distinguishedName_p
- - the attribute name
String
object containing the value for the given attribute, or a null
value,
in case the requested attribute is not found in LDAP
OwAuthenticationException
- thrown when the user is not authenticated.
OwInvalidOperationException
- thrown when the given attribute cannot be resolved.
OwConfigurationException
public Collection<String> searchAttributeValues(String searchBase_p, String[][] matchAttrs_p, String attribute_p) throws OwAuthenticationException, OwConfigurationException, OwInvalidOperationException
searchBase_p
- matchAttrs_p
- array of String pairs of attribute name value that will be used in matching the targeted entries
example : new String[]{{"objectClass","groupOfNames"},{"cn","administrators"}}attribute_p
- name of the attribute whose values will be returned
OwAuthenticationException
OwConfigurationException
OwInvalidOperationException
public NamingEnumeration<SearchResult> search(String searchBase_p, String[][] attributeValues_p, String[] returnIds_p) throws OwConfigurationException, OwInvalidOperationException
searchBase_p
- attributeValues_p
- returnIds_p
-
OwConfigurationException
OwInvalidOperationException
public OwObjectCollection searchValuesByFilter(String searchBase, String filter, String returningAttibute, String sortKey) throws OwException
searchBase
- filter
- returningAttibute
- sortKey
- if null no sorting will be performed
OwException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |