atg.userdirectory
Interface UserDirectory

All Known Subinterfaces:
RepositoryUserDirectory

public interface UserDirectory

A UserDirectory represents an abstraction of an persistent organizational tree containing Users and Organizations. Users and Organizations may be assigned one or more Roles.

Users, Organizations, and Roles are all treated as instances of java.security.Principal, permitting them to be used flexibly across the java.security and atg.security packages. In particular, all Principals obtained from a UserDirectory will be directly usable in access control lists and entries managed by security domains compatible with that directory.

Some roles' membership may be dynamically calculated ("dynamic roles"), while others are explicitly assigned to individual users ("assignable roles"). Most roles are global roles, while RelativeRoles are special in that they represent a certain kind of relationship to a specific principal.

Global roles are organized in a hierarchy of RoleFolders that assists in navigating the global role namespace. RoleFolders are not Principals.

Notes:

Invocations of methods that change one or more transactionally managed objects will behave in a way that depends on whether a transaction is currently active. If no transaction is active, a new one will be created for the update and will be committed before the method returns. If a transaction is active, then all updates will take place within the scope of the transaction, which will remain uncommitted when the method returns.

A returned Principal, either singly or within a collection, must never be modified directly in any way by casting it to a modifiable Java type, since this would prohibit UserDirectory implementations from caching Principals.

All returned Collections are unmodifiable, and are in effect immutable due to the previous convention that the embedded Principal objects should never be modified.

For methods with a Collection result, empty Collection instances are always returned on a valid invocation, whereas null reflects a failure to perform the requested operation.

See Also:
PrincipalType

Field Summary
static java.lang.String CLASS_VERSION
           
static int SORT_ASCENDING
           
static int SORT_DESCENDING
           
 
Method Summary
 Organization findOrganizationByPrimaryKey(java.lang.Object pPrimaryKey)
          Given a Organization's primary key, locate a corresponding Organization in the directory.
 Role findRoleByPrimaryKey(java.lang.Object pPrimaryKey)
          Given a Role's primary key, locate a corresponding Role in the directory.
 User findUserByLogin(java.lang.String loginName)
          Given a User's primary key, locate a corresponding User in the directory.
 User findUserByPrimaryKey(java.lang.Object pPrimaryKey)
          Given a User's primary key, locate a corresponding User in the directory.
 Organization getOrganizationByPath(java.lang.String orgPath)
          Find an Organization by its path.
 Role getRoleByPath(java.lang.String pRolePath)
          Given the folder path of a global role, obtain the corresponding Role.
 RoleFolder getRoleFolderByPath(java.lang.String pRolePath)
          Given the folder path of a global role, obtain the corresponding Role.
 java.util.Collection getRoles()
          Get the set of all roles in the directory, both global and relative.
 java.util.Collection getRolesSortByName(int pStartIndex, int pEndIndex, int pSortOrder)
          Get the set of all roles in the directory, both global and relative, sorted on the name of the role, with index control of the result set returned.
 Organization getRootOrganization()
          Return an Organization that acts as the root of the organizational hierarchy.
 RoleFolder getRootRoleFolder()
          Get the root RoleFolder in a hierarchy of RoleFolders that contain all global roles.
 java.lang.String getUserDirectoryName()
           
 

Field Detail

CLASS_VERSION

static final java.lang.String CLASS_VERSION
See Also:
Constant Field Values

SORT_ASCENDING

static final int SORT_ASCENDING
See Also:
Constant Field Values

SORT_DESCENDING

static final int SORT_DESCENDING
See Also:
Constant Field Values
Method Detail

getUserDirectoryName

java.lang.String getUserDirectoryName()
Returns:
The name of this UserDirectory

findUserByPrimaryKey

User findUserByPrimaryKey(java.lang.Object pPrimaryKey)
Given a User's primary key, locate a corresponding User in the directory.

Parameters:
pPrimaryKey - the principal's primary key
Returns:
The corresponding principal object

findUserByLogin

User findUserByLogin(java.lang.String loginName)
Given a User's primary key, locate a corresponding User in the directory.

Parameters:
loginName - The user's unique login name.
Returns:
The corresponding principal object

findOrganizationByPrimaryKey

Organization findOrganizationByPrimaryKey(java.lang.Object pPrimaryKey)
Given a Organization's primary key, locate a corresponding Organization in the directory.

Parameters:
pPrimaryKey - the principal's primary key
Returns:
The corresponding principal object

findRoleByPrimaryKey

Role findRoleByPrimaryKey(java.lang.Object pPrimaryKey)
Given a Role's primary key, locate a corresponding Role in the directory.

Parameters:
pPrimaryKey - the principal's primary key
Returns:
The corresponding principal object

getRootOrganization

Organization getRootOrganization()
Return an Organization that acts as the root of the organizational hierarchy.

Returns:
the root Organization

getOrganizationByPath

Organization getOrganizationByPath(java.lang.String orgPath)
Find an Organization by its path. The path of an organization is a series of organization names separated by the delimiter '/'. A leading delimiter is optional. e.g. "/someOrg/otherOrg/myOrg" is the path of an organization named "myOrg" whose parent organization is "otherOrg", whose parent organization is "someOrg", whose parent organization is the "root" organization.

Parameters:
orgPath - The path from the root of the Organization.
Returns:
The Organization, or null if not found.

getRoles

java.util.Collection getRoles()
Get the set of all roles in the directory, both global and relative.

Returns:
a collection of Roles

getRolesSortByName

java.util.Collection getRolesSortByName(int pStartIndex,
                                        int pEndIndex,
                                        int pSortOrder)
Get the set of all roles in the directory, both global and relative, sorted on the name of the role, with index control of the result set returned.

Parameters:
pStartIndex - starting index of roles
pEndIndex - ending index of roles
pSortOrder - sorted order of returned Collection. Values = { UserDirectory.SORT_ASCENDING, UserDirectory.SORT_DESCENDING }
Returns:
a collection of atg.userdirectory.Roles

getRootRoleFolder

RoleFolder getRootRoleFolder()
Get the root RoleFolder in a hierarchy of RoleFolders that contain all global roles. RoleFolders have no semantics, but serve to organize Roles in a way that makes sense to people viewing them.


getRoleByPath

Role getRoleByPath(java.lang.String pRolePath)
Given the folder path of a global role, obtain the corresponding Role.

Parameters:
pRolePath - the path of a global role from the root role folder to the global role, delimited by '/' characters. No initial delimiter is required.
Returns:
the global role with that path, or null if no global role with that path exists.

getRoleFolderByPath

RoleFolder getRoleFolderByPath(java.lang.String pRolePath)
Given the folder path of a global role, obtain the corresponding Role.

Parameters:
pRolePath - the path of a global role from the root role folder to the global role, delimited by '/' characters. No initial delimiter is required.
Returns:
the global role with that path, or null if no global role with that path exists.