com.atlassian.crowd.model.application
Class ApplicationImpl

java.lang.Object
  extended by com.atlassian.crowd.model.InternalEntity
      extended by com.atlassian.crowd.model.application.ApplicationImpl
All Implemented Interfaces:
Attributes, Application, TimestampedEntity, java.io.Serializable

public class ApplicationImpl
extends InternalEntity
implements Application

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.atlassian.crowd.model.InternalEntity
active, createdDate, id, name, updatedDate
 
Fields inherited from interface com.atlassian.crowd.model.application.Application
ATTRIBUTE_KEY_ALIASING_ENABLED, ATTRIBUTE_KEY_APPLICATION_URL, ATTRIBUTE_KEY_ATLASSIAN_SHA1_APPLIED, ATTRIBUTE_KEY_LOWER_CASE_OUTPUT
 
Constructor Summary
protected ApplicationImpl()
           
  ApplicationImpl(InternalEntityTemplate template)
          Used for importing via XML migration.
protected ApplicationImpl(java.lang.String name, long id, ApplicationType type, java.lang.String description, PasswordCredential credential, boolean active, java.util.Map<java.lang.String,java.lang.String> attributes, java.util.List<DirectoryMapping> directoryMappings, java.util.Set<RemoteAddress> remoteAddresses, java.util.Date createdDate, java.util.Date updatedDate)
           
 
Method Summary
 void addDirectoryMapping(Directory directory, boolean allowAllToAuthenticate, OperationType... operationTypes)
           
 void addGroupMapping(long directoryId, java.lang.String groupName)
           
 void addRemoteAddress(java.lang.String remoteAddress)
           
 boolean equals(java.lang.Object o)
           
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
           
 PasswordCredential getCredential()
           
 java.lang.String getDescription()
           
 DirectoryMapping getDirectoryMapping(long directoryId)
           
 java.util.List<DirectoryMapping> getDirectoryMappings()
           
 java.util.Set<java.lang.String> getKeys()
          Gets all the keys of the attributes.
 java.lang.String getLowerName()
           
 java.util.Set<RemoteAddress> getRemoteAddresses()
           
 ApplicationType getType()
           
 java.lang.String getValue(java.lang.String name)
          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 name)
          Get all the values associated with a given key.
 int hashCode()
           
 boolean hasRemoteAddress(java.lang.String remoteAddress)
           
 boolean isAliasingEnabled()
           
 boolean isEmpty()
           
 boolean isLowerCaseOutput()
           
 boolean isPermanent()
           
static ApplicationImpl newInstance(Application application)
           
static ApplicationImpl newInstance(java.lang.String name, ApplicationType type)
           
static ApplicationImpl newInstanceWithCredential(java.lang.String name, ApplicationType type, PasswordCredential credential)
           
static ApplicationImpl newInstanceWithIdAndCredential(java.lang.String name, ApplicationType type, PasswordCredential credential, long id)
           
static ApplicationImpl newInstanceWithPassword(java.lang.String name, ApplicationType type, java.lang.String password)
           
 void removeAttribute(java.lang.String name)
           
 boolean removeDirectoryMapping(long directoryId)
           
 boolean removeRemoteAddress(java.lang.String remoteAddress)
           
 void setActive(boolean active)
           
 void setAliasingEnabled(boolean aliasingEnabled)
           
 void setAttribute(java.lang.String name, java.lang.String value)
           
 void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
           
 void setCredential(PasswordCredential credential)
           
 void setDescription(java.lang.String description)
           
 void setLowerCaseOutput(boolean value)
           
 void setName(java.lang.String name)
           
 void setRemoteAddresses(java.util.Set<RemoteAddress> remoteAddresses)
           
 void setType(ApplicationType type)
           
 java.lang.String toString()
           
 void updateDetailsFromApplication(Application application)
          Only to be used by the ApplicationDAO#update method
 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.model.application.Application
getCreatedDate, getId, getName, getUpdatedDate, isActive
 

Constructor Detail

ApplicationImpl

protected ApplicationImpl()

ApplicationImpl

protected ApplicationImpl(java.lang.String name,
                          long id,
                          ApplicationType type,
                          java.lang.String description,
                          PasswordCredential credential,
                          boolean active,
                          java.util.Map<java.lang.String,java.lang.String> attributes,
                          java.util.List<DirectoryMapping> directoryMappings,
                          java.util.Set<RemoteAddress> remoteAddresses,
                          java.util.Date createdDate,
                          java.util.Date updatedDate)

ApplicationImpl

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

Parameters:
template - directory template.
Method Detail

newInstance

public static ApplicationImpl newInstance(Application application)

newInstance

public static ApplicationImpl newInstance(java.lang.String name,
                                          ApplicationType type)

newInstanceWithIdAndCredential

public static ApplicationImpl newInstanceWithIdAndCredential(java.lang.String name,
                                                             ApplicationType type,
                                                             PasswordCredential credential,
                                                             long id)

newInstanceWithCredential

public static ApplicationImpl newInstanceWithCredential(java.lang.String name,
                                                        ApplicationType type,
                                                        PasswordCredential credential)

newInstanceWithPassword

public static ApplicationImpl newInstanceWithPassword(java.lang.String name,
                                                      ApplicationType type,
                                                      java.lang.String password)

updateDetailsFromApplication

public void updateDetailsFromApplication(Application application)
Only to be used by the ApplicationDAO#update method

Parameters:
application -

validate

public void validate()

setName

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

setActive

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

getLowerName

public java.lang.String getLowerName()

getType

public ApplicationType getType()
Specified by:
getType in interface Application

setType

public void setType(ApplicationType type)

getDescription

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

setDescription

public void setDescription(java.lang.String description)

getCredential

public PasswordCredential getCredential()
Specified by:
getCredential in interface Application

setCredential

public void setCredential(PasswordCredential credential)

isPermanent

public boolean isPermanent()
Specified by:
isPermanent in interface Application

getAttributes

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

setAttributes

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

getDirectoryMappings

public java.util.List<DirectoryMapping> getDirectoryMappings()
Specified by:
getDirectoryMappings in interface Application

addDirectoryMapping

public void addDirectoryMapping(Directory directory,
                                boolean allowAllToAuthenticate,
                                OperationType... operationTypes)

addGroupMapping

public void addGroupMapping(long directoryId,
                            java.lang.String groupName)

getDirectoryMapping

public DirectoryMapping getDirectoryMapping(long directoryId)
Specified by:
getDirectoryMapping in interface Application

removeDirectoryMapping

public boolean removeDirectoryMapping(long directoryId)

getRemoteAddresses

public java.util.Set<RemoteAddress> getRemoteAddresses()
Specified by:
getRemoteAddresses in interface Application

addRemoteAddress

public void addRemoteAddress(java.lang.String remoteAddress)

setRemoteAddresses

public void setRemoteAddresses(java.util.Set<RemoteAddress> remoteAddresses)

hasRemoteAddress

public boolean hasRemoteAddress(java.lang.String remoteAddress)
Specified by:
hasRemoteAddress in interface Application

removeRemoteAddress

public boolean removeRemoteAddress(java.lang.String remoteAddress)

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 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:
name - 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

setAttribute

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

removeAttribute

public void removeAttribute(java.lang.String name)

isLowerCaseOutput

public boolean isLowerCaseOutput()
Specified by:
isLowerCaseOutput in interface Application

setLowerCaseOutput

public void setLowerCaseOutput(boolean value)

setAliasingEnabled

public void setAliasingEnabled(boolean aliasingEnabled)

isAliasingEnabled

public boolean isAliasingEnabled()
Specified by:
isAliasingEnabled in interface Application

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.