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:
Attributes, Directory, TimestampedEntity, java.io.Serializable

public class DirectoryImpl
extends InternalEntity
implements Directory

Implementation of Directory (designed for use with Hibernate).

See Also:
Serialized Form

Field Summary
static java.lang.String ATTRIBUTE_KEY_AUTO_ADD_GROUPS
           
static java.lang.String ATTRIBUTE_KEY_USE_NESTED_GROUPS
           
static java.lang.String ATTRIBUTE_KEY_USER_ENCRYPTION_METHOD
           
 
Fields inherited from class com.atlassian.crowd.model.InternalEntity
active, createdDate, id, name, updatedDate
 
Constructor Summary
DirectoryImpl()
           
DirectoryImpl(Directory directory)
           
DirectoryImpl(InternalEntityTemplate template)
          Used for importing via XML migration.
DirectoryImpl(java.lang.String name, DirectoryType type, java.lang.String implementationClass)
           
 
Method Summary
 void addAllowedOperation(OperationType operationType)
           
 boolean equals(java.lang.Object o)
           
 java.util.Set<OperationType> getAllowedOperations()
           
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
           
 java.lang.String getDescription()
           
 java.lang.String getEncryptionType()
           
 RemoteDirectory getImplementation()
          Loads the implementationClass for this directory.
 java.lang.String getImplementationClass()
           
 java.util.Set<java.lang.String> getKeys()
          Gets all the keys of the attributes.
 java.lang.String getLowerImplementationClass()
           
 java.lang.String getLowerName()
           
 RemoteDirectory getRawImplementation()
           
 DirectoryType getType()
           
 java.lang.String getTypeAsString()
           
 java.lang.String getValue(java.lang.String name)
          Returns any value associated with the given key, returns null if there is no value.
 java.util.Set<java.lang.String> getValues(java.lang.String name)
          Get all the values associated with a given key.
 int hashCode()
           
 boolean isEmpty()
           
 void removeAttribute(java.lang.String name)
           
 void setActive(boolean active)
           
 void setAllowedOperations(java.util.Set<OperationType> allowedOperations)
           
 void setAttribute(java.lang.String name, java.lang.String value)
           
 void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
           
 void setDescription(java.lang.String description)
           
 void setImplementationClass(java.lang.String implementationClass)
           
 void setName(java.lang.String name)
           
 void setType(DirectoryType type)
           
 java.lang.String toString()
           
 void updateAttributesFrom(java.util.Map<java.lang.String,java.lang.String> attributes)
           
 void updateDetailsFrom(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 java.lang.String ATTRIBUTE_KEY_USER_ENCRYPTION_METHOD
See Also:
Constant Field Values

ATTRIBUTE_KEY_USE_NESTED_GROUPS

public static final java.lang.String ATTRIBUTE_KEY_USE_NESTED_GROUPS
See Also:
Constant Field Values

ATTRIBUTE_KEY_AUTO_ADD_GROUPS

public static final java.lang.String ATTRIBUTE_KEY_AUTO_ADD_GROUPS
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(java.lang.String name,
                     DirectoryType type,
                     java.lang.String implementationClass)

DirectoryImpl

public DirectoryImpl(Directory directory)
Method Detail

updateDetailsFrom

public void updateDetailsFrom(Directory directory)

updateAttributesFrom

public void updateAttributesFrom(java.util.Map<java.lang.String,java.lang.String> attributes)

getImplementation

public RemoteDirectory getImplementation()
                                  throws DirectoryInstantiationException
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
Throws:
DirectoryInstantiationException

getEncryptionType

public java.lang.String getEncryptionType()
Specified by:
getEncryptionType in interface Directory

getAttributes

public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Specified by:
getAttributes in interface Directory

setAttributes

public void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)

getAllowedOperations

public java.util.Set<OperationType> getAllowedOperations()
Specified by:
getAllowedOperations in interface Directory

addAllowedOperation

public void addAllowedOperation(OperationType operationType)

setAllowedOperations

public void setAllowedOperations(java.util.Set<OperationType> allowedOperations)

getLowerImplementationClass

public java.lang.String getLowerImplementationClass()

getLowerName

public java.lang.String getLowerName()

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface Directory

getType

public DirectoryType getType()
Specified by:
getType in interface Directory

getTypeAsString

public java.lang.String getTypeAsString()

getImplementationClass

public java.lang.String getImplementationClass()
Specified by:
getImplementationClass in interface Directory

setDescription

public void setDescription(java.lang.String description)

setType

public void setType(DirectoryType type)

setImplementationClass

public void setImplementationClass(java.lang.String implementationClass)

setName

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

setActive

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

getValues

public java.util.Set<java.lang.String> getValues(java.lang.String name)
Description copied from interface: Attributes
Get all the values associated with a given key. Duplicate values are not allowed, and this should be enforced case-insensitively to match the behaviour of LDAP servers. Will return null if the key does not exist.

Specified by:
getValues in interface 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 java.lang.String getValue(java.lang.String name)
Description copied from interface: Attributes
Returns any value associated with the given key, returns null if there is no value.

Specified by:
getValue in interface Attributes
Parameters:
name - the key to retrieve the value for
Returns:
any value associated with the given key, or null if there is no value

getKeys

public java.util.Set<java.lang.String> getKeys()
Description copied from interface: Attributes
Gets all the keys of the attributes. Warning: case-insensitive keys are currently no enforced, however this is the case for LDAP, so this may be implemented in the future.

Specified by:
getKeys in interface Attributes
Returns:
a set of all the keys.

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Attributes
Returns:
true if there are no attributes

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)

removeAttribute

public void removeAttribute(java.lang.String name)

validate

public void validate()

equals

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

hashCode

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010 Atlassian. All Rights Reserved.