com.atlassian.crowd.integration.directory.connector.mapper
Class ContainerContextMapper

java.lang.Object
  extended by com.atlassian.crowd.integration.directory.connector.mapper.ContainerContextMapper
All Implemented Interfaces:
org.springframework.ldap.core.ContextMapper
Direct Known Subclasses:
GroupContextMapper, RoleContextMapper

public abstract class ContainerContextMapper
extends java.lang.Object
implements org.springframework.ldap.core.ContextMapper

Given a container object, fetches all members.


Nested Class Summary
static class ContainerContextMapper.MemberFetchType
           
 
Field Summary
protected  long directoryID
           
protected  LDAPPropertiesMapper ldapPropertiesMapper
           
protected  org.springframework.ldap.core.LdapTemplate ldapTemplate
           
protected  org.apache.log4j.Logger logger
           
protected  MemberAttributeParser memberParser
           
protected  ContainerContextMapper.MemberFetchType populateMembers
           
 
Constructor Summary
protected ContainerContextMapper(long directoryID, org.springframework.ldap.core.LdapTemplate ldapTemplate, LDAPPropertiesMapper ldapPropertiesMapper, ContainerContextMapper.MemberFetchType populateMembers, MemberAttributeParser memberParser)
           
 
Method Summary
protected abstract  java.lang.String getDescriptionAttribute()
          Returns the name of the attribute that identifies the object description
protected  MemberFetcher getFetcher(ContainerContextMapper.MemberFetchType fetchType)
          Creates the member fetcher - the object that's responsible for fetching and creating group/role members
protected abstract  java.lang.String getNameAttribute()
          Returns the name of the attribute that identifies the object name
protected abstract  DirectoryContainer getNewContainer()
          Responsible for creating the object used to represent the container within Crowd.
 DirectoryContainer mapFromContext(org.springframework.ldap.core.DirContextAdapter context, ContainerContextMapper.MemberFetchType fetchMembers)
          Allows us to override the populateMembers tag - this is so we can make sure that we *don't* recursively try to populate memberships when using the DirectFetcher.
 java.lang.Object mapFromContext(java.lang.Object ctx)
          ContextMapper interface implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.log4j.Logger logger

directoryID

protected final long directoryID

ldapTemplate

protected final org.springframework.ldap.core.LdapTemplate ldapTemplate

ldapPropertiesMapper

protected final LDAPPropertiesMapper ldapPropertiesMapper

memberParser

protected final MemberAttributeParser memberParser

populateMembers

protected final ContainerContextMapper.MemberFetchType populateMembers
Constructor Detail

ContainerContextMapper

protected ContainerContextMapper(long directoryID,
                                 org.springframework.ldap.core.LdapTemplate ldapTemplate,
                                 LDAPPropertiesMapper ldapPropertiesMapper,
                                 ContainerContextMapper.MemberFetchType populateMembers,
                                 MemberAttributeParser memberParser)
Method Detail

mapFromContext

public java.lang.Object mapFromContext(java.lang.Object ctx)
ContextMapper interface implementation. Called for each object fetched from LDAP.

Specified by:
mapFromContext in interface org.springframework.ldap.core.ContextMapper
Parameters:
ctx -
Returns:

mapFromContext

public DirectoryContainer mapFromContext(org.springframework.ldap.core.DirContextAdapter context,
                                         ContainerContextMapper.MemberFetchType fetchMembers)
Allows us to override the populateMembers tag - this is so we can make sure that we *don't* recursively try to populate memberships when using the DirectFetcher.

Parameters:
context -
fetchMembers -
Returns:

getNewContainer

protected abstract DirectoryContainer getNewContainer()
Responsible for creating the object used to represent the container within Crowd. Split out so it can be overridden by subclasses.

Returns:

getFetcher

protected MemberFetcher getFetcher(ContainerContextMapper.MemberFetchType fetchType)
Creates the member fetcher - the object that's responsible for fetching and creating group/role members

Parameters:
fetchType - Determines which MemberFetcher we create - do we want all users, all users in all groups, or just the groups?
Returns:

getNameAttribute

protected abstract java.lang.String getNameAttribute()
Returns the name of the attribute that identifies the object name

Returns:

getDescriptionAttribute

protected abstract java.lang.String getDescriptionAttribute()
Returns the name of the attribute that identifies the object description

Returns:


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.