com.bea.ales.management
Class DirectoryManager

java.lang.Object
  |
  +--com.bea.ales.management.DirectoryManager

public class DirectoryManager
extends java.lang.Object

This class manage identity Directory. It provides methods to create, remove and find directory. DirectoryManager can be created through RBAC_Context.


Method Summary
 Directory create(java.lang.String dirName)
          Create the identity directory.
 Directory get(java.lang.String dirName)
          Get the identity directory with the specified name.
 DirectoryQueryResult getDirectories(java.lang.String filter)
          Get all direct directories whose names matches with the filter.
 Directory[] getDirectoriesRecursive(java.lang.String filter, Scope aScope)
          Gets a List of Direcorys recursively starting at the given Scope and going up in the scope hierarchy up to the root scope.
 Directory getDirectory(Scope dirScope, java.lang.String relativeName)
          Gets a Directory belonging to the given scope with the given relative name.
 void remove(Directory dir, boolean isCascade)
          Remove the identity directory.
 void remove(java.lang.String dirName, boolean isCascade)
          Remove an identity directory.
 Directory rename(java.lang.String originalName, java.lang.String newName)
          Rename a directory with given original name to a new name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public Directory create(java.lang.String dirName)
                 throws ManagementException
Create the identity directory.

Parameters:
dirName - the name of directory to be created. For example: asi.
Returns:
the directory created
Throws:
ManagementException - if the operation fails.

rename

public Directory rename(java.lang.String originalName,
                        java.lang.String newName)
                 throws ManagementException
Rename a directory with given original name to a new name.

Parameters:
originalName - The relative or short name of the directory to be renamed.
newName - The new relative or short name for that directory.
Returns:
The Directory after it is renamed.
Throws:
ManagementException - If the Directory cannot be constructed using the newName parameter or there was a BLMException while renaming the directory.

remove

public void remove(Directory dir,
                   boolean isCascade)
            throws ManagementException
Remove the identity directory.

Parameters:
dir - the directory to be removed.
isCascade - if set true, remove the directory and all users, groups and associated policies. if set false, only remove the directory.
Throws:
ManagementException - if the operation fails.
See Also:
remove(String, boolean)

remove

public void remove(java.lang.String dirName,
                   boolean isCascade)
            throws ManagementException
Remove an identity directory.

Parameters:
dirName - the name of directory to be removed. For example: asi.
isCascade - if set true, remove the directory and all users, groups and associated policies. if set false, only remove the directory.
Throws:
ManagementException - if the operation fails.
See Also:
remove(Directory, boolean)

get

public Directory get(java.lang.String dirName)
              throws ManagementException
Get the identity directory with the specified name.

Parameters:
dirName - directory name - which is accepted in two formats.
  1. a relative directory name such as dir1.
  2. a fully qualified directory name such as //dir/RootOrg!OrgA!dir1.
In the first format, it is assumed that the caller is looking for dir1 in the current scope (which is available in the RBAC_Context) and this method will resolve the relative name to the fully qualified name such as //dir/RootOrg!dir1 etc. In the second scenario this method uses the fully qualified name given by the caller directly.
Returns:
directory which has the specified name.
Throws:
ManagementException - if the operation fails.

getDirectories

public DirectoryQueryResult getDirectories(java.lang.String filter)
                                    throws ManagementException
Get all direct directories whose names matches with the filter. For a pattern that looks like //dir/orgA!OrgB!* - a direct directory will be //dir/OrgA!OrgB!MyDir1 but NEITHER of //dir/OrgA!parentScopeDir NOR //dir/OrgA!OrgB!OrgC!childScopeDir1.

Parameters:
filter - the name of the pattern to match
Returns:
the DirectoryQueryResult which contains the collection of direct directories that match the filter.
Throws:
ManagementException - if the operation fails.

getDirectory

public Directory getDirectory(Scope dirScope,
                              java.lang.String relativeName)
                       throws ManagementException
Gets a Directory belonging to the given scope with the given relative name.
A directory name is considered to be a relative name when it does not begin with InternalConsts#ALES_DIRECTORY_PREFIX or if it does not contain Scope#SCOPE_SEPARATOR.

Parameters:
dirScope - The Scope in which to look for the directory.
relativeName - The relative name of the directory to retrieve. This will be of the format myDir. Using directory name such as //dir/myDir or RootOrg!OrgA!myDir is improper and will result in IllegalArgumentException being thrown .
Returns:
A directory in the given scope with given relative name.
Throws:
ManagementException - This exception is thrown if the user is not authorized to view the directory or if the directory did not exist in the given scope or if there was other problems retrieving the Directory.
java.lang.IllegalArgumentException - This exception will be thrown if the given scope is null or if the given relative name is empty, null or if it is not a valid relative directory name.

getDirectoriesRecursive

public Directory[] getDirectoriesRecursive(java.lang.String filter,
                                           Scope aScope)
                                    throws ManagementException
Gets a List of Direcorys recursively starting at the given Scope and going up in the scope hierarchy up to the root scope.

Parameters:
filter - The filter String to be used to look for Directorys.
aScope - The Scope at which to start looking for the Directorys. This parameter can be null. If the Scope is null no recursion will occur and the directory search will be at the root organization.
Returns:
A List of Directorys.
Throws:
ManagementException -  


Copyright © 2004-2008, Oracle and/or its affiliates. All rights reserved.