Class ImmutableApplication

java.lang.Object
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:
  • Constructor Details

  • Method Details

    • 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).
    • getApplicationDirectoryMappings

      @Nonnull public List<ApplicationDirectoryMapping> getApplicationDirectoryMappings()
      Description copied from interface: Application
      Returns the list of directory mappings ranked by directory priority as in perspective of the application.
      Specified by:
      getApplicationDirectoryMappings 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
    • getApplicationDirectoryMapping

      public ApplicationDirectoryMapping getApplicationDirectoryMapping(long directoryId)
      Description copied from interface: Application
      Returns a directory mapping of the directory specified by directory id.
      Specified by:
      getApplicationDirectoryMapping 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
    • getWebhooks

      public Set<Webhook> getWebhooks()
      Description copied from interface: Application
      Returns the Webhooks associated to the application. Webhooks were added in Crowd 2.7. For applications that are not Crowd servers, it is OK to always return an empty Set.
      Specified by:
      getWebhooks in interface Application
      Returns:
      Webhooks associated to 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
    • isFilteringUsersWithAccessEnabled

      public boolean isFilteringUsersWithAccessEnabled()
      Specified by:
      isFilteringUsersWithAccessEnabled in interface Application
      Returns:
      true if user queries should return only users with access.
    • isFilteringGroupsWithAccessEnabled

      public boolean isFilteringGroupsWithAccessEnabled()
      Specified by:
      isFilteringGroupsWithAccessEnabled in interface Application
      Returns:
      true if group queries should return only groups with access.
    • isMembershipAggregationEnabled

      public boolean isMembershipAggregationEnabled()
      Specified by:
      isMembershipAggregationEnabled in interface Application
      Returns:
      true if membership aggregation is enabled for this application.
    • isCachedDirectoriesAuthenticationOrderOptimisationEnabled

      public boolean isCachedDirectoriesAuthenticationOrderOptimisationEnabled()
      Specified by:
      isCachedDirectoriesAuthenticationOrderOptimisationEnabled in interface Application
      Returns:
      true if authentication order optimization for cached directories is enabled for this application.
    • isAuthenticationWithoutPasswordEnabled

      public boolean isAuthenticationWithoutPasswordEnabled()
      Description copied from interface: Application
      Returns true if application has authentication without user's password enabled, false otherwise.

      Authentication without user's password is used i.e. for remember me functionality in Atlassian products. If a user session is expired but remember-me cookie is still valid, product will request Crowd to generate a new Crowd SSO token without passing user's password to Crowd.

      As possibility to authenticate user without knowing their password is considered insecure, this option is disabled by default and it should be enabled only for trusted apps.

      Specified by:
      isAuthenticationWithoutPasswordEnabled in interface Application
      Returns:
      true if application has authentication without user's password enabled, false otherwise.
    • isAuthenticationViaEmailEnabled

      public boolean isAuthenticationViaEmailEnabled()
      Description copied from interface: Application
      Determines whether application can authenticate their users using their e-mail.
      Specified by:
      isAuthenticationViaEmailEnabled in interface Application
      Returns:
      true if application has authentication via email enabled, false otherwise.
    • 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. It may return null or empty set 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
    • from

      public static ImmutableApplication from(Application application)
      Returns:
      an ImmutableApplication with the same properties as the given application. Will avoid creating a copy if possible.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object