SMILA (incubation) API documentation

org.eclipse.smila.security.ldap
Class LDAPSecurityResolver

java.lang.Object
  extended by org.eclipse.smila.security.ldap.LDAPSecurityResolver
All Implemented Interfaces:
SecurityResolver

public class LDAPSecurityResolver
extends java.lang.Object
implements SecurityResolver

A LDAP SecurityResolver.


Field Summary
static java.lang.String BUNDLE_NAME
          name of bundle.
static java.lang.String CONFIGURATION_FILE
          name of configuration file.
static java.lang.String DEFAULT_LDAP_USER_NAME_ATTRIBUTE
          The default value for the user name attribute.
static java.lang.String LDAP_ATTRIBUTE_MEMBER
          Constant for the LDAP attribute member.
static java.lang.String LDAP_ATTRIBUTE_MEMBER_OF
          Constant for the LDAP attribute memberOf.
static java.lang.String LDAP_ATTRIBUTE_OBJECT_CLASS
          Constant for the LDAP attribute objectClass.
static java.lang.String LDAP_ATTRIBUTE_UNIQUE_MEMBER
          Constant for the LDAP attribute uniqueMember.
static java.lang.String LDAP_OBJECT_NAME_DYNAMIC_GROUP
          Constant for the LDAP object name dynamicGroup.
static java.lang.String LDAP_OBJECT_NAME_DYNAMIC_GROUP_AUX
          Constant for the LDAP object name dynamicGroupAux.
static java.lang.String LDAP_OBJECT_NAME_GROUP
          Constant for the LDAP object name group.
static java.lang.String LDAP_OBJECT_NAME_GROUP_OF_NAMES
          Constant for the LDAP object name groupOfNames.
static java.lang.String LDAP_OBJECT_NAME_GROUP_OF_UNIQUE_NAMES
          Constant for the LDAP object name groupOfUniqueNames.
static java.lang.String PROPERTY_LDAP_BASE_DN
          The configuration property ldap.base.dn.
static java.lang.String PROPERTY_LDAP_HOST
          The configuration property ldap.host.
static java.lang.String PROPERTY_LDAP_LOGIN
          The configuration property ldap.login.
static java.lang.String PROPERTY_LDAP_PASSWORD
          The configuration property ldap.password.
static java.lang.String PROPERTY_LDAP_PORT
          The configuration property ldap.port.
static java.lang.String PROPERTY_LDAP_USER_NAME_ATTRIBUTE
          The configuration property ldap.base.dn.
 
Constructor Summary
LDAPSecurityResolver()
          Default Constructor.
 
Method Summary
protected  void activate(ComponentContext context)
          DS activate method.
protected  void deactivate(ComponentContext context)
          DS deactivate method.
 java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getProperties(java.lang.String principal)
          Returns all properties of the given principal.
 boolean isGroup(java.lang.String principal)
          Checks if the given principal is a group.
 java.util.Set<java.lang.String> resolveGroupMembers(java.lang.String group)
          Returns all principals that are member to the given group, including any subgroups.
 java.util.Set<java.lang.String> resolveMembership(java.lang.String principal)
          Returns all groups the given principal is member of.
 java.lang.String resolvePrincipal(java.lang.String name)
          Resolves a given name to a full form principal (e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUNDLE_NAME

public static final java.lang.String BUNDLE_NAME
name of bundle. Used in configuration reading.

See Also:
Constant Field Values

CONFIGURATION_FILE

public static final java.lang.String CONFIGURATION_FILE
name of configuration file. Hardcoded for now (or fallback), configuration properties should be received from configuration service later.

See Also:
Constant Field Values

PROPERTY_LDAP_HOST

public static final java.lang.String PROPERTY_LDAP_HOST
The configuration property ldap.host.

See Also:
Constant Field Values

PROPERTY_LDAP_PORT

public static final java.lang.String PROPERTY_LDAP_PORT
The configuration property ldap.port.

See Also:
Constant Field Values

PROPERTY_LDAP_LOGIN

public static final java.lang.String PROPERTY_LDAP_LOGIN
The configuration property ldap.login.

See Also:
Constant Field Values

PROPERTY_LDAP_PASSWORD

public static final java.lang.String PROPERTY_LDAP_PASSWORD
The configuration property ldap.password.

See Also:
Constant Field Values

PROPERTY_LDAP_BASE_DN

public static final java.lang.String PROPERTY_LDAP_BASE_DN
The configuration property ldap.base.dn.

See Also:
Constant Field Values

PROPERTY_LDAP_USER_NAME_ATTRIBUTE

public static final java.lang.String PROPERTY_LDAP_USER_NAME_ATTRIBUTE
The configuration property ldap.base.dn.

See Also:
Constant Field Values

DEFAULT_LDAP_USER_NAME_ATTRIBUTE

public static final java.lang.String DEFAULT_LDAP_USER_NAME_ATTRIBUTE
The default value for the user name attribute.

See Also:
Constant Field Values

LDAP_ATTRIBUTE_OBJECT_CLASS

public static final java.lang.String LDAP_ATTRIBUTE_OBJECT_CLASS
Constant for the LDAP attribute objectClass.

See Also:
Constant Field Values

LDAP_ATTRIBUTE_MEMBER

public static final java.lang.String LDAP_ATTRIBUTE_MEMBER
Constant for the LDAP attribute member.

See Also:
Constant Field Values

LDAP_ATTRIBUTE_UNIQUE_MEMBER

public static final java.lang.String LDAP_ATTRIBUTE_UNIQUE_MEMBER
Constant for the LDAP attribute uniqueMember.

See Also:
Constant Field Values

LDAP_ATTRIBUTE_MEMBER_OF

public static final java.lang.String LDAP_ATTRIBUTE_MEMBER_OF
Constant for the LDAP attribute memberOf.

See Also:
Constant Field Values

LDAP_OBJECT_NAME_GROUP

public static final java.lang.String LDAP_OBJECT_NAME_GROUP
Constant for the LDAP object name group.

See Also:
Constant Field Values

LDAP_OBJECT_NAME_GROUP_OF_NAMES

public static final java.lang.String LDAP_OBJECT_NAME_GROUP_OF_NAMES
Constant for the LDAP object name groupOfNames.

See Also:
Constant Field Values

LDAP_OBJECT_NAME_GROUP_OF_UNIQUE_NAMES

public static final java.lang.String LDAP_OBJECT_NAME_GROUP_OF_UNIQUE_NAMES
Constant for the LDAP object name groupOfUniqueNames.

See Also:
Constant Field Values

LDAP_OBJECT_NAME_DYNAMIC_GROUP

public static final java.lang.String LDAP_OBJECT_NAME_DYNAMIC_GROUP
Constant for the LDAP object name dynamicGroup.

See Also:
Constant Field Values

LDAP_OBJECT_NAME_DYNAMIC_GROUP_AUX

public static final java.lang.String LDAP_OBJECT_NAME_DYNAMIC_GROUP_AUX
Constant for the LDAP object name dynamicGroupAux.

See Also:
Constant Field Values
Constructor Detail

LDAPSecurityResolver

public LDAPSecurityResolver()
Default Constructor.

Method Detail

activate

protected void activate(ComponentContext context)
                 throws java.lang.Exception
DS activate method.

Parameters:
context - ComponentContext
Throws:
java.lang.Exception - if any error occurs

deactivate

protected void deactivate(ComponentContext context)
                   throws java.lang.Exception
DS deactivate method.

Parameters:
context - the ComponentContext
Throws:
java.lang.Exception - if any error occurs

resolvePrincipal

public java.lang.String resolvePrincipal(java.lang.String name)
                                  throws SecurityException
Resolves a given name to a full form principal (e.g. a distinguished name).

Specified by:
resolvePrincipal in interface SecurityResolver
Parameters:
name - the name of the principal
Returns:
the full form principal
Throws:
SecurityException - if any error occurs
See Also:
SecurityResolver.resolvePrincipal(java.lang.String)

getProperties

public java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getProperties(java.lang.String principal)
                                                                                     throws SecurityException
Returns all properties of the given principal. The properties are a map of attribute names (String) and attribute values (Collection of Strings).

Specified by:
getProperties in interface SecurityResolver
Parameters:
principal - the principal
Returns:
all properties if the principal
Throws:
SecurityException - if any error occurs
See Also:
SecurityResolver.getProperties(java.lang.String)

resolveGroupMembers

public java.util.Set<java.lang.String> resolveGroupMembers(java.lang.String group)
                                                    throws SecurityException
Returns all principals that are member to the given group, including any subgroups.

Specified by:
resolveGroupMembers in interface SecurityResolver
Parameters:
group - the group principal
Returns:
a set of all principals that are members of this group
Throws:
SecurityException - if any error occurs
See Also:
SecurityResolver.resolveGroupMembers(java.lang.String)

resolveMembership

public java.util.Set<java.lang.String> resolveMembership(java.lang.String principal)
                                                  throws SecurityException
Returns all groups the given principal is member of.

Specified by:
resolveMembership in interface SecurityResolver
Parameters:
principal - the principal
Returns:
a set of group principals the principal is member of
Throws:
SecurityException - if any error occurs
See Also:
SecurityResolver.resolveMembership(java.lang.String)

isGroup

public boolean isGroup(java.lang.String principal)
                throws SecurityException
Checks if the given principal is a group.

Specified by:
isGroup in interface SecurityResolver
Parameters:
principal - the principal
Returns:
true if the principal is a group, false otherwise
Throws:
SecurityException - if any error occurs
See Also:
SecurityResolver.isGroup(java.lang.String)

SMILA (incubation) API documentation