com.atlassian.crowd.model.application
Class DirectoryMapping

java.lang.Object
  extended by com.atlassian.crowd.model.application.DirectoryMapping
All Implemented Interfaces:
Serializable

public class DirectoryMapping
extends Object
implements Serializable

Represents a mapping between an application and a directory. Only directories with a mapping to an application are visible to the application.

See Also:
Serialized Form

Constructor Summary
protected DirectoryMapping()
           
  DirectoryMapping(Application application, Directory directory, boolean allowAllToAuthenticate)
          Constructs a new DirectoryMapping.
  DirectoryMapping(Application application, Directory directory, boolean allowAllToAuthenticate, Set<OperationType> allowedOperations)
          Constructs a new DirectoryMapping.
  DirectoryMapping(Long id, Application application, Directory directory, boolean allowAllToAuthenticate)
          Constructs a new DirectoryMapping.
 
Method Summary
 void addAllowedOperation(OperationType operationType)
          Add a new operation that the application is allowed to perform on the directory.
 void addAllowedOperations(OperationType... operationTypes)
          Adds a list of operations that the application is allowed to perform on the directory.
 void addGroupMapping(String groupName)
          Adds a mapping to a new authorised group.
 boolean equals(Object o)
           
 Set<OperationType> getAllowedOperations()
          Returns a set of operations that the application is allowed to perform on the directory.
 Application getApplication()
          Returns the mapped application.
 Set<GroupMapping> getAuthorisedGroups()
          Returns a set of mappings to groups that are authorised to authenticate with the application.
 Directory getDirectory()
          Returns the mapped directory.
 GroupMapping getGroupMapping(String groupName)
          Returns a GroupMapping if it exists, otherwise returns null
 Long getId()
          Returns the ID of the directory mapping.
 int hashCode()
           
 boolean isAllowAllToAuthenticate()
          Returns true if all the users in the directory are allowed to authenticate with the application.
 boolean isAllowed(OperationType operation)
          Returns true if the application is allowed to perform the specified operation on the directory.
 boolean isAuthorised(String groupName)
          Returns true if the group is an authorised group.
 void removeGroupMapping(String groupName)
          Unauthorises a group.
 void setAllowAllToAuthenticate(boolean allowAllToAuthenticate)
          Sets whether all the users in the directory are allowed to authenticate with the application.
 void setAllowedOperations(Set<OperationType> allowedOperations)
          Sets (i.e.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryMapping

protected DirectoryMapping()

DirectoryMapping

public DirectoryMapping(Long id,
                        Application application,
                        Directory directory,
                        boolean allowAllToAuthenticate)
Constructs a new DirectoryMapping. Used by XML import.

Parameters:
id - ID of the directory mapping
application - Application to map
directory - Directory to map
allowAllToAuthenticate - set to true if all users in directory are allowed to authenticate

DirectoryMapping

public DirectoryMapping(Application application,
                        Directory directory,
                        boolean allowAllToAuthenticate)
Constructs a new DirectoryMapping.

Parameters:
application - application to map
directory - directory to map
allowAllToAuthenticate - set to true if all users in directory are allowed to authenticate

DirectoryMapping

public DirectoryMapping(Application application,
                        Directory directory,
                        boolean allowAllToAuthenticate,
                        Set<OperationType> allowedOperations)
Constructs a new DirectoryMapping.

Parameters:
application - application to map
directory - directory to map
allowAllToAuthenticate - set to true if all users in directory are allowed to authenticate
allowedOperations - the set of operations the application is allowed to perform on the directory
Method Detail

getId

public Long getId()
Returns the ID of the directory mapping.

Returns:

getApplication

public Application getApplication()
Returns the mapped application.

Returns:
mapped application

getDirectory

public Directory getDirectory()
Returns the mapped directory.

Returns:
mapped directory

isAllowAllToAuthenticate

public boolean isAllowAllToAuthenticate()
Returns true if all the users in the directory are allowed to authenticate with the application. If the value is false, then the user is required to be in an authorised group.

Returns:
true if all the users in the directory are allowed to authenticate with the application
See Also:
#getAuthorisedGroups()}

setAllowAllToAuthenticate

public void setAllowAllToAuthenticate(boolean allowAllToAuthenticate)
Sets whether all the users in the directory are allowed to authenticate with the application.

Parameters:
allowAllToAuthenticate - set to true if all the users in the directory are allowed to authenticate with the application.

getAuthorisedGroups

public Set<GroupMapping> getAuthorisedGroups()
Returns a set of mappings to groups that are authorised to authenticate with the application. This set is not used if isAllowAllToAuthenticate() returns true.

Returns:
set of mappings to groups that are authorised to authenticate with the application

isAuthorised

public boolean isAuthorised(String groupName)
Returns true if the group is an authorised group. i.e. it is allowed

Parameters:
groupName - name of group
Returns:
true if the group is an authorised group.

getGroupMapping

@Nullable
public GroupMapping getGroupMapping(String groupName)
Returns a GroupMapping if it exists, otherwise returns null

Parameters:
groupName - name of the group to find
Returns:
the GroupMapping or null

addGroupMapping

public void addGroupMapping(String groupName)
Adds a mapping to a new authorised group.

Parameters:
groupName - name of new authorised group

removeGroupMapping

public void removeGroupMapping(String groupName)
Unauthorises a group.

Parameters:
groupName - name of group to unauthorise

addAllowedOperations

public void addAllowedOperations(OperationType... operationTypes)
Adds a list of operations that the application is allowed to perform on the directory.

Parameters:
operationTypes - list of operations that the application is allowed to perform on the directory

addAllowedOperation

public void addAllowedOperation(OperationType operationType)
Add a new operation that the application is allowed to perform on the directory.

Parameters:
operationType - new operation that the application is allowed to perform on the directory

getAllowedOperations

public Set<OperationType> getAllowedOperations()
Returns a set of operations that the application is allowed to perform on the directory.

Returns:
set of operations that the application is allowed to perform on the directory

setAllowedOperations

public void setAllowedOperations(Set<OperationType> allowedOperations)
Sets (i.e. replaces) the list of operations that the application is allowed to perform on the directory.

Parameters:
allowedOperations - set of operations that the application is allowed to perform on the directory

isAllowed

public boolean isAllowed(OperationType operation)
Returns true if the application is allowed to perform the specified operation on the directory.

Parameters:
operation - operation to check
Returns:
true if the application is allowed to perform the specified operation on the directory

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2013 Atlassian. All Rights Reserved.