com.atlassian.crowd.model.application
Class ImmutableApplication

java.lang.Object
  extended by com.atlassian.crowd.model.application.ImmutableApplication
All Implemented Interfaces:
Attributes, Application, Serializable

public final class ImmutableApplication
extends Object
implements Application

Immutable Application

Since:
2.2
See Also:
Serialized Form

Nested Class Summary
static class ImmutableApplication.Builder
           
 
Constructor Summary
ImmutableApplication(Long id, String name, ApplicationType type, String description, PasswordCredential passwordCredential, boolean permanent, boolean active, Map<String,String> attributes, List<DirectoryMapping> directoryMappings, Set<RemoteAddress> remoteAddresses, boolean lowercaseOutput, boolean aliasingEnabled, Date createdDate, Date updatedDate)
           
 
Method Summary
static ImmutableApplication.Builder builder(Application application)
          Constructs a new builder for an ImmutableApplication with the fields initialised to application.
static ImmutableApplication.Builder builder(String name, ApplicationType type)
          Constructs a new builder for an ImmutableApplication.
 Map<String,String> getAttributes()
          Returns the attributes of the application.
 Date getCreatedDate()
          Returns the date the application was created.
 PasswordCredential getCredential()
          Returns the application password.
 String getDescription()
          Returns the description of the application.
 DirectoryMapping getDirectoryMapping(long directoryId)
          Returns a directory mapping of the directory specified by directory id.
 List<DirectoryMapping> getDirectoryMappings()
          Returns the list of directory mappings ranked by directory priority as in perspective of the application.
 Long getId()
          Returns the application ID.
 Set<String> getKeys()
          Gets all the keys of the attributes.
 String getName()
          Returns the name of the application.
 Set<RemoteAddress> getRemoteAddresses()
          Returns the whitelist of addresses allowed to connect to Crowd as the application.
 ApplicationType getType()
          Returns the type of the application.
 Date getUpdatedDate()
          Returns the date the application was last updated.
 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 hasRemoteAddress(String remoteAddress)
          Returns true if the remote address is already in the list of allowable remote addresses for the application.
 boolean isActive()
          Returns whether the application is active.
 boolean isAliasingEnabled()
          Returns true if aliasing is enabled for the application.
 boolean isEmpty()
           
 boolean isLowerCaseOutput()
          Returns true if the usernames and group names returned should be in lowercase.
 boolean isPermanent()
          Returns whether the application is a permanent application and thus cannot be removed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImmutableApplication

public ImmutableApplication(Long id,
                            String name,
                            ApplicationType type,
                            String description,
                            PasswordCredential passwordCredential,
                            boolean permanent,
                            boolean active,
                            Map<String,String> attributes,
                            List<DirectoryMapping> directoryMappings,
                            Set<RemoteAddress> remoteAddresses,
                            boolean lowercaseOutput,
                            boolean aliasingEnabled,
                            Date createdDate,
                            Date updatedDate)
Method Detail

getId

public Long getId()
Description copied from interface: Application
Returns the application ID.

Specified by:
getId in interface Application
Returns:
application ID

getName

public String getName()
Description copied from interface: Application
Returns the name of the application.

Specified by:
getName in interface Application
Returns:
name of the application

getType

public ApplicationType getType()
Description copied from interface: Application
Returns the type of the application.

Specified by:
getType in interface Application
Returns:
application type

getDescription

public String getDescription()
Description copied from interface: Application
Returns the description of the application.

Specified by:
getDescription in interface Application
Returns:
description of the application

getCredential

public PasswordCredential getCredential()
Description copied from interface: Application
Returns the application password.

Specified by:
getCredential in interface Application
Returns:
application password

isPermanent

public boolean isPermanent()
Description copied from interface: Application
Returns whether the application is a permanent application and thus cannot be removed. For instance, the Crowd application is a permanent application.

Specified by:
isPermanent in interface Application
Returns:
true if the application is permanent.

isActive

public boolean isActive()
Description copied from interface: Application
Returns whether the application is active.

Specified by:
isActive in interface Application
Returns:
true if the application is active.

getAttributes

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

Specified by:
getAttributes in interface Application
Returns:
attributes of the application

getDirectoryMappings

public List<DirectoryMapping> getDirectoryMappings()
Description copied from interface: Application
Returns the list of directory mappings ranked by directory priority as in perspective of the application.

Specified by:
getDirectoryMappings in interface Application
Returns:
List of directory mappings (never null).

getDirectoryMapping

public DirectoryMapping getDirectoryMapping(long directoryId)
Description copied from interface: Application
Returns a directory mapping of the directory specified by directory id.

Specified by:
getDirectoryMapping in interface Application
Parameters:
directoryId - ID of the directory
Returns:
directory mapping if found, null if the directory mapping could not be found

getRemoteAddresses

public Set<RemoteAddress> getRemoteAddresses()
Description copied from interface: Application
Returns the whitelist of addresses allowed to connect to Crowd as the application. The remote addresses may contain subnet masking information in CIDR format.

Specified by:
getRemoteAddresses in interface Application
Returns:
whitelist of addresses allowed to connect to Crowd as the application.

hasRemoteAddress

public boolean hasRemoteAddress(String remoteAddress)
Description copied from interface: Application
Returns true if the remote address is already in the list of allowable remote addresses for the application.

Specified by:
hasRemoteAddress in interface Application
Parameters:
remoteAddress - RemoteAddress whose presence is to be tested
Returns:
true if the remote address is already in the list of allowable remote addresses for the application

isLowerCaseOutput

public boolean isLowerCaseOutput()
Description copied from interface: Application
Returns true if the usernames and group names returned should be in lowercase.

Specified by:
isLowerCaseOutput in interface Application
Returns:
true if the usernames and group names returned

isAliasingEnabled

public boolean isAliasingEnabled()
Description copied from interface: Application
Returns true if aliasing is enabled for the application.

Specified by:
isAliasingEnabled in interface Application
Returns:
true if aliasing is enabled for the application

getCreatedDate

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

Specified by:
getCreatedDate in interface Application
Returns:
date the application was created

getUpdatedDate

public Date getUpdatedDate()
Description copied from interface: Application
Returns the date the application was last updated. If the application has just been created, the updated date will be the same as the creation date.

Specified by:
getUpdatedDate in interface Application
Returns:
date the application was last updated

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

builder

public static ImmutableApplication.Builder builder(String name,
                                                   ApplicationType type)
Constructs a new builder for an ImmutableApplication.

Parameters:
name - name of the application
type - type of the application
Returns:
builder with the name and type initialised

builder

public static ImmutableApplication.Builder builder(Application application)
Constructs a new builder for an ImmutableApplication with the fields initialised to application.

Parameters:
application - application to duplicate
Returns:
builder with the fields initialised to application


Copyright © 2012 Atlassian. All Rights Reserved.