com.atlassian.crowd.dao.directory
Class ImmutableDirectory

java.lang.Object
  extended by com.atlassian.crowd.dao.directory.ImmutableDirectory
All Implemented Interfaces:
Attributes, Directory, Serializable

public final class ImmutableDirectory
extends Object
implements Directory

Immutable directory. A similar class exists in ImmutableDirectory

See Also:
Serialized Form

Nested Class Summary
static class ImmutableDirectory.Builder
          Used to aid in the construction of an ImmutableDirectory.
 
Constructor Summary
ImmutableDirectory(Long id, String name, boolean active, String description, String encryptionType, DirectoryType type, String implementationClass, Date createdDate, Date updatedDate, Set<OperationType> allowedOperations, Map<String,String> attributes)
           
 
Method Summary
 Set<OperationType> getAllowedOperations()
          Returns the operations allowed to be performed on this directory.
 Map<String,String> getAttributes()
          Returns the attributes of the directory.
 Date getCreatedDate()
          Returns the date the directory was created.
 String getDescription()
          Returns a description of the directory.
 String getEncryptionType()
          Returns the encryption algorithm used by the directory.
 Long getId()
          Returns the directory ID.
 String getImplementationClass()
          Returns the fully qualified name of the class that implements the directory.
 Set<String> getKeys()
          Gets all the keys of the attributes.
 String getName()
          Returns the name of the directory.
 DirectoryType getType()
          Returns the type of the directory.
 Date getUpdatedDate()
          Returns the date the directory was last modified.
 String getValue(String key)
          Returns any value associated with the given key, returns null if there is no value.
 Set<String> getValues(String key)
          Get all the values associated with a given key.
 boolean isActive()
          Returns true if the directory is currently active, otherwise false.
 boolean isEmpty()
           
static ImmutableDirectory.Builder newBuilder()
          Create an empty Builder.
static ImmutableDirectory.Builder newBuilder(Directory directory)
          Create a Builder that copies its initial values from the given directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImmutableDirectory

public ImmutableDirectory(Long id,
                          String name,
                          boolean active,
                          String description,
                          String encryptionType,
                          DirectoryType type,
                          String implementationClass,
                          @Nonnull
                          Date createdDate,
                          @Nonnull
                          Date updatedDate,
                          @Nullable
                          Set<OperationType> allowedOperations,
                          @Nullable
                          Map<String,String> attributes)
Method Detail

getId

public Long getId()
Description copied from interface: Directory
Returns the directory ID.

Specified by:
getId in interface Directory
Returns:
directory ID

getName

public String getName()
Description copied from interface: Directory
Returns the name of the directory.

Specified by:
getName in interface Directory
Returns:
name of the directory

isActive

public boolean isActive()
Description copied from interface: Directory
Returns true if the directory is currently active, otherwise false.

Specified by:
isActive in interface Directory
Returns:
true if the directory is currently active, otherwise false.

getEncryptionType

public String getEncryptionType()
Description copied from interface: Directory
Returns the encryption algorithm used by the directory.

Specified by:
getEncryptionType in interface Directory
Returns:
encryption algorithm used by the directory

getDescription

public String getDescription()
Description copied from interface: Directory
Returns a description of the directory.

Specified by:
getDescription in interface Directory
Returns:
description of the directory

getType

public DirectoryType getType()
Description copied from interface: Directory
Returns the type of the directory.

Specified by:
getType in interface Directory
Returns:
type of the directory
See Also:
DirectoryType

getImplementationClass

public String getImplementationClass()
Description copied from interface: Directory
Returns the fully qualified name of the class that implements the directory.

Specified by:
getImplementationClass in interface Directory
Returns:
the fully qualified name of the class that implements the directory

getCreatedDate

public Date getCreatedDate()
Description copied from interface: Directory
Returns the date the directory was created.

Specified by:
getCreatedDate in interface Directory
Returns:
date the directory was created

getUpdatedDate

public Date getUpdatedDate()
Description copied from interface: Directory
Returns the date the directory was last modified.

Specified by:
getUpdatedDate in interface Directory
Returns:
date the directory was last modified

getAllowedOperations

public Set<OperationType> getAllowedOperations()
Description copied from interface: Directory
Returns the operations allowed to be performed on this directory.

Specified by:
getAllowedOperations in interface Directory
Returns:
the operations allowed to be performed on this directory

getAttributes

public Map<String,String> getAttributes()
Description copied from interface: Directory
Returns the attributes of the directory.

Specified by:
getAttributes in interface Directory
Returns:
attributes of the directory

getValues

public Set<String> getValues(String key)
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:
key - the key to retrieve the values for
Returns:
the values associated with the given key, or null if the key does not exist.

getValue

public String getValue(String key)
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:
key - the key to retrieve the value for
Returns:
any value associated with the given key, or null if there is no value

getKeys

public Set<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

newBuilder

public static ImmutableDirectory.Builder newBuilder()
Create an empty Builder.

Returns:
an empty Builder.

newBuilder

public static ImmutableDirectory.Builder newBuilder(Directory directory)
Create a Builder that copies its initial values from the given directory.

Parameters:
directory - The Directory to clone.
Returns:
A new Builder.


Copyright © 2013 Atlassian. All Rights Reserved.