com.wewebu.ow.server.util.ldap
Class OwBasicLdapSchemaInterpreter

java.lang.Object
  extended by com.wewebu.ow.server.util.ldap.OwBasicLdapSchemaInterpreter
All Implemented Interfaces:
OwLdapSchemaInterpreter
Direct Known Subclasses:
OwADSchemaInterpreter, OwStandardSchemaInterpreter

public abstract class OwBasicLdapSchemaInterpreter
extends Object
implements OwLdapSchemaInterpreter

Common base class for LDAP schema interpreter.

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

Since:
3.1.0.0

Field Summary
protected static String DISTINGUISHED_NAME
           
protected static String GROUP_REFERENCE_ATTRIBUTE_PROPERTY
           
protected static String GROUPS_DIRECTORY_PROPERTY
           
protected static String GROUPS_OBJECT_CLASS_PROPERTY
           
protected static String LDAP_COUNT_LIMIT_PROPERTY
           
protected static String LOGIN_QUERY_NAME
           
protected static String NAME_LONGNAME_PROPERTY
           
protected static String NAME_MEMBER_OF_PROPERTY
           
protected static String NAME_OBJECTGUID_PROPERTY
           
protected static String NAME_SHORTNAME_PROPERTY
           
protected static String USER_DISPLAY_NAME_PROPERTY
           
protected static String USER_GROUP_REFERENCE_PROPERTY
           
 
Constructor Summary
OwBasicLdapSchemaInterpreter()
           
 
Method Summary
 String findDistinguishedNameAnonymously(String user_p, OwLdapConnection connection_p)
          Returns the full distinguished name for the login user to use for authentication later.
 OwUserInfo findUserByDNAnonymously(String strID_p, OwLdapConnection connection_p)
          Finds a user by its Distinguished Name.
 OwUserInfo findUserByIdAnonymously(String strID_p, OwLdapConnection connection_p)
          Finds a user by its ID.
 OwUserInfo findUserByLoginAnonymously(String strID_p, OwLdapConnection connection_p)
           
protected abstract  String getDisplayNameAttName(OwLdapConnection connection_p)
           
protected abstract  String getObjectIdAttribute(OwLdapConnection connection_p)
           
 String getRecordId(String dname, OwLdapConnection connection)
           
 String getUserDisplayName(OwLdapConnection connection_p)
          Get the user display name, or a null value.
 String getUserDisplayName(String dname, OwLdapConnection connection)
           
protected abstract  String getUserLoginAttribute(OwLdapConnection connection_p)
           
 void init(Properties ldapProperties_p, Properties adminLdapProperties_p)
          Properties initialization method used to make schema specific initializations of the directory properties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.wewebu.ow.server.util.ldap.OwLdapSchemaInterpreter
findGroupsMatching, findUserMatching, getAllShortGroupNames, getShortGroupNames, getUserId, getUserLongName, getUserShortName
 

Field Detail

LOGIN_QUERY_NAME

protected static final String LOGIN_QUERY_NAME
See Also:
Constant Field Values

DISTINGUISHED_NAME

protected static final String DISTINGUISHED_NAME
See Also:
Constant Field Values

GROUPS_DIRECTORY_PROPERTY

protected static final String GROUPS_DIRECTORY_PROPERTY
See Also:
Constant Field Values

LDAP_COUNT_LIMIT_PROPERTY

protected static final String LDAP_COUNT_LIMIT_PROPERTY
See Also:
Constant Field Values

USER_DISPLAY_NAME_PROPERTY

protected static final String USER_DISPLAY_NAME_PROPERTY
See Also:
Constant Field Values

NAME_MEMBER_OF_PROPERTY

protected static final String NAME_MEMBER_OF_PROPERTY
See Also:
Constant Field Values

NAME_OBJECTGUID_PROPERTY

protected static final String NAME_OBJECTGUID_PROPERTY
See Also:
Constant Field Values

NAME_SHORTNAME_PROPERTY

protected static final String NAME_SHORTNAME_PROPERTY
See Also:
Constant Field Values

NAME_LONGNAME_PROPERTY

protected static final String NAME_LONGNAME_PROPERTY
See Also:
Constant Field Values

GROUPS_OBJECT_CLASS_PROPERTY

protected static final String GROUPS_OBJECT_CLASS_PROPERTY
See Also:
Constant Field Values

GROUP_REFERENCE_ATTRIBUTE_PROPERTY

protected static final String GROUP_REFERENCE_ATTRIBUTE_PROPERTY
See Also:
Constant Field Values

USER_GROUP_REFERENCE_PROPERTY

protected static final String USER_GROUP_REFERENCE_PROPERTY
See Also:
Constant Field Values
Constructor Detail

OwBasicLdapSchemaInterpreter

public OwBasicLdapSchemaInterpreter()
Method Detail

findDistinguishedNameAnonymously

public String findDistinguishedNameAnonymously(String user_p,
                                               OwLdapConnection connection_p)
                                        throws OwAuthenticationException,
                                               OwConfigurationException
Description copied from interface: OwLdapSchemaInterpreter
Returns the full distinguished name for the login user to use for authentication later.

Specified by:
findDistinguishedNameAnonymously in interface OwLdapSchemaInterpreter
Parameters:
user_p - representing the login name for the user being searched
Returns:
String representing the full distinguished name for the login passed to the method
Throws:
OwAuthenticationException - the user that wants to login is not available in the LDAP
OwConfigurationException - possible cause: the LDAP connector is not set up correctly in the bootstrap.xml (Authentication node)

init

public void init(Properties ldapProperties_p,
                 Properties adminLdapProperties_p)
          throws OwConfigurationException
Description copied from interface: OwLdapSchemaInterpreter
Properties initialization method used to make schema specific initializations of the directory properties

Specified by:
init in interface OwLdapSchemaInterpreter
Parameters:
ldapProperties_p - user based properties
adminLdapProperties_p - admin user based properties
Throws:
OwConfigurationException

findUserByDNAnonymously

public OwUserInfo findUserByDNAnonymously(String strID_p,
                                          OwLdapConnection connection_p)
                                   throws OwException
Description copied from interface: OwLdapSchemaInterpreter
Finds a user by its Distinguished Name.

Specified by:
findUserByDNAnonymously in interface OwLdapSchemaInterpreter
Returns:
user with the given DN.
Throws:
OwException - Throws OwObjectNotFoundException if no user was found.

findUserByIdAnonymously

public OwUserInfo findUserByIdAnonymously(String strID_p,
                                          OwLdapConnection connection_p)
                                   throws OwException
Description copied from interface: OwLdapSchemaInterpreter
Finds a user by its ID.

Specified by:
findUserByIdAnonymously in interface OwLdapSchemaInterpreter
Returns:
user with the given DN.
Throws:
OwException - Throws OwObjectNotFoundException if no user was found.

findUserByLoginAnonymously

public OwUserInfo findUserByLoginAnonymously(String strID_p,
                                             OwLdapConnection connection_p)
                                      throws OwException
Specified by:
findUserByLoginAnonymously in interface OwLdapSchemaInterpreter
Throws:
OwException

getUserDisplayName

public String getUserDisplayName(OwLdapConnection connection_p)
                          throws OwAuthenticationException,
                                 OwConfigurationException,
                                 OwInvalidOperationException
Description copied from interface: OwLdapSchemaInterpreter
Get the user display name, or a null value.

Specified by:
getUserDisplayName in interface OwLdapSchemaInterpreter
Returns:
the user short name, or a null value.
Throws:
OwAuthenticationException - thrown when the user is not authenticated.
OwConfigurationException - possible cause: the LDAP connector is not set up correctly in the bootstrap.xml (Authentication node)
OwInvalidOperationException - thrown when the "displayName" attribute cannot be resolved.

getUserDisplayName

public String getUserDisplayName(String dname,
                                 OwLdapConnection connection)
                          throws OwException
Specified by:
getUserDisplayName in interface OwLdapSchemaInterpreter
Parameters:
dname - User DN.
Returns:
the display name of the given user.
Throws:
OwException

getRecordId

public String getRecordId(String dname,
                          OwLdapConnection connection)
                   throws OwException
Specified by:
getRecordId in interface OwLdapSchemaInterpreter
Returns:
the value of the LDAP attribute that is configured to be used as OWD ID.
Throws:
OwException

getUserLoginAttribute

protected abstract String getUserLoginAttribute(OwLdapConnection connection_p)

getObjectIdAttribute

protected abstract String getObjectIdAttribute(OwLdapConnection connection_p)

getDisplayNameAttName

protected abstract String getDisplayNameAttName(OwLdapConnection connection_p)


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.