com.atlassian.crowd.model.directory
Class DirectoryImpl

java.lang.Object
  extended by com.atlassian.crowd.model.InternalEntity
      extended by com.atlassian.crowd.model.directory.DirectoryImpl
All Implemented Interfaces:
com.atlassian.crowd.embedded.api.Attributes, com.atlassian.crowd.embedded.api.Directory, TimestampedEntity, Serializable

public class DirectoryImpl
extends InternalEntity
implements com.atlassian.crowd.embedded.api.Directory

Implementation of Directory (designed for use with Hibernate).

See Also:
Serialized Form

Field Summary
static String ATTRIBUTE_KEY_AUTO_ADD_GROUPS
           
static String ATTRIBUTE_KEY_LOCAL_USER_STATUS
          Key to decide whether we support local user status for a given LDAP directory.
static String ATTRIBUTE_KEY_USE_NESTED_GROUPS
           
static String ATTRIBUTE_KEY_USE_PRIMARY_GROUP
           
static String ATTRIBUTE_KEY_USER_ENCRYPTION_METHOD
           
static char AUTO_ADD_GROUPS_SEPARATOR
           
static Set<String> PASSWORD_ATTRIBUTES
           
static String SANITISED_PASSWORD
           
 
Fields inherited from class com.atlassian.crowd.model.InternalEntity
active, createdDate, id, name, updatedDate
 
Constructor Summary
DirectoryImpl()
           
DirectoryImpl(com.atlassian.crowd.embedded.api.Directory directory)
           
DirectoryImpl(InternalEntityTemplate template)
          Used for importing via XML migration.
DirectoryImpl(String name, com.atlassian.crowd.embedded.api.DirectoryType type, String implementationClass)
           
 
Method Summary
 void addAllowedOperation(com.atlassian.crowd.embedded.api.OperationType operationType)
           
 boolean equals(Object o)
           
 Set<com.atlassian.crowd.embedded.api.OperationType> getAllowedOperations()
           
 Map<String,String> getAttributes()
           
 String getDescription()
           
 String getEncryptionType()
           
 RemoteDirectory getImplementation()
          Deprecated. Use a DirectoryInstanceLoader.
 String getImplementationClass()
           
 Set<String> getKeys()
           
 String getLowerImplementationClass()
           
 String getLowerName()
           
 RemoteDirectory getRawImplementation()
          Deprecated. Use a DirectoryInstanceLoader.
 com.atlassian.crowd.embedded.api.DirectoryType getType()
           
 String getValue(String name)
           
 Set<String> getValues(String name)
           
 int hashCode()
           
 boolean isEmpty()
           
 void removeAttribute(String name)
           
 void setActive(boolean active)
           
 void setAllowedOperations(Set<com.atlassian.crowd.embedded.api.OperationType> allowedOperations)
           
 void setAttribute(String name, String value)
           
 void setAttributes(Map<String,String> attributes)
          Sets the attributes of the directory.
 void setDescription(String description)
           
 void setImplementationClass(String implementationClass)
           
 void setName(String name)
           
 void setType(com.atlassian.crowd.embedded.api.DirectoryType type)
           
 String toString()
           
 void updateAttributesFrom(Map<String,String> attributes)
           
 void updateDetailsFrom(com.atlassian.crowd.embedded.api.Directory directory)
           
 void validate()
           
 
Methods inherited from class com.atlassian.crowd.model.InternalEntity
getCreatedDate, getId, getName, getUpdatedDate, isActive, setCreatedDate, setCreatedDateToNow, setUpdatedDate, setUpdatedDateToNow
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.crowd.embedded.api.Directory
getCreatedDate, getId, getName, getUpdatedDate, isActive
 

Field Detail

ATTRIBUTE_KEY_USER_ENCRYPTION_METHOD

public static final String ATTRIBUTE_KEY_USER_ENCRYPTION_METHOD
See Also:
Constant Field Values

ATTRIBUTE_KEY_USE_NESTED_GROUPS

public static final String ATTRIBUTE_KEY_USE_NESTED_GROUPS
See Also:
Constant Field Values

ATTRIBUTE_KEY_LOCAL_USER_STATUS

public static final String ATTRIBUTE_KEY_LOCAL_USER_STATUS
Key to decide whether we support local user status for a given LDAP directory. If the value is true, users can be enabled and disabled independently in Crowd and the LDAP server. If the value is false, user status is synchronised between Crowd and the LDAP server (for LDAP directories that support synchronisation of user status, like Active Directory). This option is only relevant for cached directories.

See Also:
Constant Field Values

ATTRIBUTE_KEY_AUTO_ADD_GROUPS

public static final String ATTRIBUTE_KEY_AUTO_ADD_GROUPS
See Also:
Constant Field Values

ATTRIBUTE_KEY_USE_PRIMARY_GROUP

public static final String ATTRIBUTE_KEY_USE_PRIMARY_GROUP
See Also:
Constant Field Values

AUTO_ADD_GROUPS_SEPARATOR

public static final char AUTO_ADD_GROUPS_SEPARATOR
See Also:
Constant Field Values

PASSWORD_ATTRIBUTES

public static final Set<String> PASSWORD_ATTRIBUTES

SANITISED_PASSWORD

public static final String SANITISED_PASSWORD
See Also:
Constant Field Values
Constructor Detail

DirectoryImpl

public DirectoryImpl()

DirectoryImpl

public DirectoryImpl(InternalEntityTemplate template)
Used for importing via XML migration.

Parameters:
template - directory template.

DirectoryImpl

public DirectoryImpl(String name,
                     com.atlassian.crowd.embedded.api.DirectoryType type,
                     String implementationClass)

DirectoryImpl

public DirectoryImpl(com.atlassian.crowd.embedded.api.Directory directory)
Method Detail

updateDetailsFrom

public void updateDetailsFrom(com.atlassian.crowd.embedded.api.Directory directory)

updateAttributesFrom

public void updateAttributesFrom(Map<String,String> attributes)

getImplementation

public RemoteDirectory getImplementation()
                                  throws DirectoryInstantiationException
Deprecated. Use a DirectoryInstanceLoader.

Loads the implementationClass for this directory.

Returns:
The loaded interface for the RemoteDirectory.
Throws:
DirectoryInstantiationException - If the loading of the RemoteDirectory fails.

getRawImplementation

public RemoteDirectory getRawImplementation()
                                     throws DirectoryInstantiationException
Deprecated. Use a DirectoryInstanceLoader.

Throws:
DirectoryInstantiationException

getEncryptionType

public String getEncryptionType()
Specified by:
getEncryptionType in interface com.atlassian.crowd.embedded.api.Directory

getAttributes

public Map<String,String> getAttributes()
Specified by:
getAttributes in interface com.atlassian.crowd.embedded.api.Directory

setAttributes

public void setAttributes(Map<String,String> attributes)
Sets the attributes of the directory. attributes must be a mutable Map.

Parameters:
attributes - new attributes

getAllowedOperations

public Set<com.atlassian.crowd.embedded.api.OperationType> getAllowedOperations()
Specified by:
getAllowedOperations in interface com.atlassian.crowd.embedded.api.Directory

addAllowedOperation

public void addAllowedOperation(com.atlassian.crowd.embedded.api.OperationType operationType)

setAllowedOperations

public void setAllowedOperations(Set<com.atlassian.crowd.embedded.api.OperationType> allowedOperations)

getLowerImplementationClass

public String getLowerImplementationClass()

getLowerName

public String getLowerName()

getDescription

public String getDescription()
Specified by:
getDescription in interface com.atlassian.crowd.embedded.api.Directory

getType

public com.atlassian.crowd.embedded.api.DirectoryType getType()
Specified by:
getType in interface com.atlassian.crowd.embedded.api.Directory

getImplementationClass

public String getImplementationClass()
Specified by:
getImplementationClass in interface com.atlassian.crowd.embedded.api.Directory

setDescription

public void setDescription(String description)

setType

public void setType(com.atlassian.crowd.embedded.api.DirectoryType type)

setImplementationClass

public void setImplementationClass(String implementationClass)

setName

public void setName(String name)
Overrides:
setName in class InternalEntity

setActive

public void setActive(boolean active)
Overrides:
setActive in class InternalEntity

getValues

public Set<String> getValues(String name)
Specified by:
getValues in interface com.atlassian.crowd.embedded.api.Attributes
Parameters:
name - attribute name.
Returns:
a collection of the only attribtue value or null if the directory does not have the attribute.

getValue

public String getValue(String name)
Specified by:
getValue in interface com.atlassian.crowd.embedded.api.Attributes

getKeys

public Set<String> getKeys()
Specified by:
getKeys in interface com.atlassian.crowd.embedded.api.Attributes

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface com.atlassian.crowd.embedded.api.Attributes

setAttribute

public void setAttribute(String name,
                         String value)

removeAttribute

public void removeAttribute(String name)

validate

public void validate()

equals

public boolean equals(Object o)
Specified by:
equals in class InternalEntity

hashCode

public int hashCode()
Specified by:
hashCode in class InternalEntity

toString

public final String toString()
Overrides:
toString in class Object


Copyright © 2014 Atlassian. All Rights Reserved.