com.bea.ales.management
Class User

java.lang.Object
  |
  +--com.bea.ales.management.Subject
        |
        +--com.bea.ales.management.User

public class User
extends Subject

This class represent a user. The users can be assigned to groups from the same directory. All users within the same directory must have the unique user name. User can have attributes directly or inherited attributes from the group it belongs to.


Method Summary
 void addMemberships(java.util.Collection groups)
          Assign the user to the groups.
 boolean equals(java.lang.Object obj)
           
 GroupQueryResult getAllGroupMempership()
          Get all groups this user is a member of.
 AttributeElement getAttribute(java.lang.String attrName, int queryType)
          Get the user attribute which has the specified attribute name.
 AttributeQueryResult getAttributes(int queryType)
          Get attributes of the user.
 GroupQueryResult getDirectGroupMembership(java.lang.String queryString)
          Get all groups this user is a directly member of.
 GroupQueryResult getEligibleGroups(java.lang.String queryString)
          Get all groups that the user is not a member of.
 GroupQueryResult getIndirectGroupMembership(java.lang.String queryString)
          Get the groups this user is an indirectly member of.
 java.lang.String getScopedName()
           
 int hashCode()
           
 void removeMemberships(java.util.Collection groups)
          Remove the user from groups.
 void removeUserAttribute(AttributeElement attributeElement)
          Remove the attribute value of this user.
 void setAttributeValue(AttributeElement attributeElement)
          Set the attribute value for this user.
 void setPassword(java.lang.String newPass)
          Set the password for the user.
 void setPasswordKnown(java.lang.String oldPass, java.lang.String newPass)
          Set the password for the user, requiring validation of the existing password.
 
Methods inherited from class com.bea.ales.management.Subject
getDirectory, getDirectoryShortName, getName, getType, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getAttributes

public AttributeQueryResult getAttributes(int queryType)
                                   throws ManagementException
Get attributes of the user.

Parameters:
queryType - - One of:
  • QueryType.DIRECT - Only direct attributes of this group.
  • QueryType.ALL - Both inherited and direct attributes of this group.
Returns:
an AttributeQueryResult object contains the result.
Throws:
ManagementException - if the operation fails.
See Also:
AttributeQueryResult

getAttribute

public AttributeElement getAttribute(java.lang.String attrName,
                                     int queryType)
                              throws ManagementException
Get the user attribute which has the specified attribute name.

Parameters:
attrName - the name of the attribute to look for.
queryType - - One of:
  • QueryType.DIRECT - Only direct attributes of this group.
  • QueryType.ALL - Both inherited and direct attributes of this group.
Returns:
the attribute found.
Throws:
ManagementException - if the operation fails.

setAttributeValue

public void setAttributeValue(AttributeElement attributeElement)
                       throws ManagementException,
                              BadParameterException
Set the attribute value for this user.

Parameters:
attributeElement - The name of this passed in attribute is used to find attribute to be set of the user. The value of this passed in attribute is set to the value of the found attribute of the user.
Throws:
ManagementException - if the operation fails.
BadParameterException - if the parameter is not valid.

removeUserAttribute

public void removeUserAttribute(AttributeElement attributeElement)
                         throws ManagementException,
                                BadParameterException
Remove the attribute value of this user.

Parameters:
attributeElement - the same name of the attribute of the user will be removed.
Throws:
ManagementException - if the operation fails.
BadParameterException - if the parameter is not valid.

getDirectGroupMembership

public GroupQueryResult getDirectGroupMembership(java.lang.String queryString)
                                          throws ManagementException
Get all groups this user is a directly member of.

Parameters:
queryString - the query pattern the groups matches.
Returns:
the GroupQueryResult instalnce with all the groups found.
Throws:
ManagementException - if the operation fails.

getIndirectGroupMembership

public GroupQueryResult getIndirectGroupMembership(java.lang.String queryString)
                                            throws ManagementException
Get the groups this user is an indirectly member of.

Parameters:
queryString - the query pattern the groups matches.
Returns:
the GroupQueryResult instance with all the indirect groups found.
Throws:
ManagementException - if the operation fails.

getAllGroupMempership

public GroupQueryResult getAllGroupMempership()
                                       throws ManagementException
Get all groups this user is a member of. It includes both direct and indirect memberships.

Returns:
A GroupQueryResult with all the groups this user is a member of
Throws:
ManagementException -  

getEligibleGroups

public GroupQueryResult getEligibleGroups(java.lang.String queryString)
                                   throws ManagementException
Get all groups that the user is not a member of.

Parameters:
queryString - the pattern string the groups need to match
Returns:
the GroupQueryResult instance containing the groups found.
Throws:
ManagementException - if the operation fails.

addMemberships

public void addMemberships(java.util.Collection groups)
                    throws ManagementException
Assign the user to the groups.

Parameters:
groups - groups that the user is assigned to.
Throws:
ManagementException - if the operation fails.

removeMemberships

public void removeMemberships(java.util.Collection groups)
                       throws ManagementException
Remove the user from groups.

Parameters:
groups - groups that remove the membership of the user.
Throws:
ManagementException - if the operation fails.

setPassword

public void setPassword(java.lang.String newPass)
                 throws ManagementException
Set the password for the user.

Parameters:
newPass - the new password for the user.
Throws:
ManagementException - if the operation fails.

setPasswordKnown

public void setPasswordKnown(java.lang.String oldPass,
                             java.lang.String newPass)
                      throws ManagementException
Set the password for the user, requiring validation of the existing password.

Parameters:
oldPass - old password
newPass - new password
Throws:
ManagementException - if the operation fails.

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

getScopedName

public java.lang.String getScopedName()


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