com.bea.ales.management
Class Directory

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

public class Directory
extends java.lang.Object

This class represents an identity directory which contains a collection of users and groups. It provides methods to manage schema of the directory, to get UserManager and GroupManager which manage user and group directly. The schema is the collection of attribute definitions and default value. Each directory is bundled with its own schema. All users and groups in the directory can only have attributes defined in the schema bundled with the directory.


Field Summary
static java.lang.String ATTRIBUTE_TYPE_BOOLEAN
           
static java.lang.String ATTRIBUTE_TYPE_DATE
           
static java.lang.String ATTRIBUTE_TYPE_INTEGER
           
static java.lang.String ATTRIBUTE_TYPE_IP_ADDRESS
           
static java.lang.String ATTRIBUTE_TYPE_STRING
           
static java.lang.String ATTRIBUTE_TYPE_TIME
           
 
Method Summary
 void addSchemaAttribute(AttributeElement attributeElement)
          Add the attribute definition to this directory's schema.
 void addSchemaAttribute(java.lang.String name, java.lang.String type, boolean isList)
          Add attribute definition to schema of the directory without a default value
 boolean equals(java.lang.Object obj)
          Compare this directory with other Java object.
 java.util.Collection getAvailableAttributeTypes()
          Get all available attribute types.
static java.lang.String getFullyQualifiedDirectoryNameFromShortName(java.lang.String shortName, Scope currentScope)
          Gets the fully qualified name of the directory from the short name.
 GroupManager getGroupManager()
          Get group manager that manages groups in the directory
 java.lang.String getName()
          Get name of the directory.
 java.lang.String getQualifiedScopeName()
          Gets the qualified name for the scope of this Directory.
static java.lang.String getRelativeDirectoryNameFromFullyQualifiedName(java.lang.String fullyQualifiedName)
          Gets the relative directory name from the given fully qualified directory name.
 AttributeQueryResult getSchema()
          Get the collection of the attributes of the specified directory's schema.
 UserManager getUserManager()
          Get user manager which manages users in the directory
 int hashCode()
          Return the hash code of the directory.
 void removeSchemaAttribute(java.lang.String attrName)
          Remove attribute definition from the directory's schema
 void SetAttributeDefaultValue(AttributeElement attributeElement)
          Set the default attribute value for a schema attribute of this directory.
 java.lang.String toString()
          Return the string representation of the directory.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTRIBUTE_TYPE_STRING

public static java.lang.String ATTRIBUTE_TYPE_STRING

ATTRIBUTE_TYPE_BOOLEAN

public static java.lang.String ATTRIBUTE_TYPE_BOOLEAN

ATTRIBUTE_TYPE_DATE

public static java.lang.String ATTRIBUTE_TYPE_DATE

ATTRIBUTE_TYPE_INTEGER

public static java.lang.String ATTRIBUTE_TYPE_INTEGER

ATTRIBUTE_TYPE_IP_ADDRESS

public static java.lang.String ATTRIBUTE_TYPE_IP_ADDRESS

ATTRIBUTE_TYPE_TIME

public static java.lang.String ATTRIBUTE_TYPE_TIME
Method Detail

getName

public java.lang.String getName()
Get name of the directory.

Returns:
the name of the directory. For example:asi.

equals

public boolean equals(java.lang.Object obj)
Compare this directory with other Java object. When the compared object is an directory which has the the same name, they are considered as equal.

Returns:
true if this directory equal to the compared object, or false if not equal.
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Return the hash code of the directory.

Returns:
hash code of the directory.
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Return the string representation of the directory.

Returns:
the string representation of the directory.
Overrides:
toString in class java.lang.Object

getUserManager

public UserManager getUserManager()
                           throws ManagementException
Get user manager which manages users in the directory

Returns:
UserManager bundled with the directory
Throws:
ManagementException - if the operation fails.
See Also:
getGroupManager()

getGroupManager

public GroupManager getGroupManager()
                             throws ManagementException
Get group manager that manages groups in the directory

Returns:
GroupManager bundled with the directory
Throws:
ManagementException - if the operation fails.
See Also:
getUserManager()

getSchema

public AttributeQueryResult getSchema()
                               throws ManagementException
Get the collection of the attributes of the specified directory's schema.

Returns:
the AttributeQueryResult which has all the attributes defined in this directory's schema
Throws:
ManagementException - if the operation fails.
See Also:
AttributeQueryResult

getAvailableAttributeTypes

public java.util.Collection getAvailableAttributeTypes()
                                                throws ManagementException
Get all available attribute types. The types inlcude ATTRIBUTE_TYPE_STRING, ATTRIBUTE_TYPE_INTEGER, ATTRIBUTE_TYPE_BOOLEAN, ATTRIBUTE_TYPE_IP_ADDRESS, ATTRIBUTE_TYPE_DATE, ATTRIBUTE_TYPE_TIME

Returns:
the collection of attribute type names in string.
Throws:
ManagementException - if the operation fails.

addSchemaAttribute

public void addSchemaAttribute(AttributeElement attributeElement)
                        throws ManagementException,
                               BadParameterException
Add the attribute definition to this directory's schema.

Parameters:
attributeElement - the attribute to add to this directory schema. If attributeElement has the value, the value is set to default value of the attriubte definition in the schema.
Throws:
ManagementException - if the operation fails.
BadParameterException - if the paremeter is not valid.

addSchemaAttribute

public void addSchemaAttribute(java.lang.String name,
                               java.lang.String type,
                               boolean isList)
                        throws ManagementException
Add attribute definition to schema of the directory without a default value

Parameters:
name - the name of the attribute to add to the schema
type - the type of the attribute
isList - whether the attribute is a list or not.
Throws:
ManagementException - if the operation fails.

removeSchemaAttribute

public void removeSchemaAttribute(java.lang.String attrName)
                           throws ManagementException
Remove attribute definition from the directory's schema

Parameters:
attrName - the attribute name to be removed.
Throws:
ManagementException - if the operation fails.

SetAttributeDefaultValue

public void SetAttributeDefaultValue(AttributeElement attributeElement)
                              throws ManagementException,
                                     BadParameterException
Set the default attribute value for a schema attribute of this directory.

Parameters:
attributeElement - The name of this passed in attribute is used to find attribute to be set in the directory's schema. The value of this passed in attribute is set to the found attribute in the schema as the default vaule.
Throws:
ManagementException - if the operation fails.
BadParameterException - if the paremeter is not valid.

getFullyQualifiedDirectoryNameFromShortName

public static java.lang.String getFullyQualifiedDirectoryNameFromShortName(java.lang.String shortName,
                                                                           Scope currentScope)
Gets the fully qualified name of the directory from the short name. For example for a directory DirB in organization scope RootOrg!OrgA the fully qualified name will be //dir/RootOrg!OrgA!DirB.

Parameters:
shortName - The short name of the directory. In the above example DirB
currentScope - The Scope used to retrieve the fully path of this directory. This parameter can be null.
Returns:
The fully qualified directory name. In the above example //dir/RootOrg!OrgA!DirB. If the RBAC_Context is null or the shortName parameter value is blank the short name will be returned as the fully qualified name.

getRelativeDirectoryNameFromFullyQualifiedName

public static java.lang.String getRelativeDirectoryNameFromFullyQualifiedName(java.lang.String fullyQualifiedName)
Gets the relative directory name from the given fully qualified directory name. For example for a given fully qualified name of //dir/OrgA!OrgB!DirB this method will return DirB.

Parameters:
fullyQualifiedName - The fully qualified directory name. If the fully qualified name is null or empty or does not conform to the expected format for the qualified directory name, IllegalArgumentException will be thrown.
Returns:
The relative directory name.

getQualifiedScopeName

public java.lang.String getQualifiedScopeName()
Gets the qualified name for the scope of this Directory.

Returns:
A String representation of the Scope to which this Directory belongs. A Scope#DEFAULT_ORG_FULL_SCOPE_NAME is returned if the directory has no scope information - this typically means the directory belongs to the RootOrg!DefaultOrg.


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