com.atlassian.crowd.embedded.impl
Class ImmutableDirectory

java.lang.Object
  extended by com.atlassian.crowd.embedded.impl.ImmutableDirectory
All Implemented Interfaces:
Attributes, Directory, java.io.Serializable

public final class ImmutableDirectory
extends java.lang.Object
implements Directory, java.io.Serializable

See Also:
Serialized Form

Nested Class Summary
static class ImmutableDirectory.Builder
          Used to aid in the construction of an ImmutableDirectory.
 
Constructor Summary
ImmutableDirectory(java.lang.Long id, java.lang.String name, boolean active, java.lang.String description, java.lang.String encryptionType, DirectoryType type, java.lang.String implementationClass, java.util.Date createdDate, java.util.Date updatedDate, java.util.Set<OperationType> allowedOperations, java.util.Map<java.lang.String,java.lang.String> attributes)
           
 
Method Summary
 java.util.Set<OperationType> getAllowedOperations()
           
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
           
 java.util.Date getCreatedDate()
           
 java.lang.String getDescription()
           
 java.lang.String getEncryptionType()
           
 java.lang.Long getId()
           
 java.lang.String getImplementationClass()
           
 java.util.Set<java.lang.String> getKeys()
          Gets all the keys of the attributes.
 java.lang.String getName()
           
 DirectoryType getType()
           
 java.util.Date getUpdatedDate()
           
 java.lang.String getValue(java.lang.String key)
          Returns the value associated with the given key, returns null if there is no value, or throws an exception if there is more than one value.
 java.util.Set<java.lang.String> getValues(java.lang.String key)
          Get all the values associated with a given key.
 boolean isActive()
           
 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(java.lang.Long id,
                          java.lang.String name,
                          boolean active,
                          java.lang.String description,
                          java.lang.String encryptionType,
                          DirectoryType type,
                          java.lang.String implementationClass,
                          @NotNull
                          java.util.Date createdDate,
                          @NotNull
                          java.util.Date updatedDate,
                          @Nullable
                          java.util.Set<OperationType> allowedOperations,
                          @Nullable
                          java.util.Map<java.lang.String,java.lang.String> attributes)
Method Detail

getId

public java.lang.Long getId()
Specified by:
getId in interface Directory

getName

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

isActive

public boolean isActive()
Specified by:
isActive in interface Directory

getEncryptionType

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

getDescription

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

getType

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

getImplementationClass

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

getCreatedDate

public java.util.Date getCreatedDate()
Specified by:
getCreatedDate in interface Directory

getUpdatedDate

public java.util.Date getUpdatedDate()
Specified by:
getUpdatedDate in interface Directory

getAllowedOperations

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

getAttributes

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

getValues

public java.util.Set<java.lang.String> getValues(java.lang.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 java.lang.String getValue(java.lang.String key)
Description copied from interface: Attributes
Returns the value associated with the given key, returns null if there is no value, or throws an exception if there is more than one value.

Specified by:
getValue in interface Attributes
Parameters:
key - the key to retrieve the value for
Returns:
the 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

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 © 2010 Atlassian. All Rights Reserved.