com.wles.blm
Class BLMLocalUserManager

java.lang.Object
  extended bycom.wles.blm.BLMComponentManager
      extended bycom.wles.blm.BLMLocalUserManager

public class BLMLocalUserManager
extends BLMComponentManager

Manages all operations on users, including creation, deletion and profile operations. User names are specified in a qualified format which includes the identity directory which they belong to. The format is //user/dirName/userName/. The userName portion may include whitespace and any printable english character. You may make use of the com.wles.util.SubjectBuilder to construct and parse user names from Java objects rather then the above format. Use a BLMContextManager to obtain an instance of a BLMLocalUserManager.

See Also:
BLMContextManager, SubjectBuilder

Field Summary
static int ATTRIBUTE_QUERY_TYPE_DIRECT
          Attribute query type specifiying the attribute value assigned directly to the user.
static int ATTRIBUTE_QUERY_TYPE_ENFORCED
          Attribute query type specifiying the attribute value based on the attribute inheritance logic.
static int ATTRIBUTE_QUERY_TYPE_INHERITED
          Attribute query type specifiying the attribute value inherited by the user, from a group membership.
 
Method Summary
 void copyLocalUser(java.lang.String userName, java.lang.String clonedUserName)
          Creates a new user based on an existing user's profile including group membership and attribute values, and rules.
 void create(java.lang.String name)
          Creates a new user.
 java.lang.String filter(java.lang.String findPattern)
          Finds all users matching the specified filter pattern.
 boolean find(java.lang.String cID, java.lang.String name)
          Checks for an occurance of the specified user name in a user collection.
 java.lang.String getAllSubjectGroups(java.lang.String aLocalUserName)
          Finds all the groups the user is a member of.
 int getCount(java.lang.String cID)
          Returns the size of a user or user attribute collection.
 java.lang.String getDirectSubjectGroups(java.lang.String aLocalUserName, java.lang.String filterString)
          Finds the direct group memberships for the specified user.
 java.lang.String getEligibleSubjectGroups(java.lang.String aLocalUserName, java.lang.String filterString)
          Finds all groups this user is not already a member of.
 java.lang.String getIndirectSubjectGroups(java.lang.String aLocalUserName, java.lang.String filterString)
          Finds the indirect (inherited) group memberships for the specified user.
 java.lang.String[] getReport(java.lang.String cID)
          Returns a report on a user collection.
 java.lang.String[] getReport(java.lang.String cID, int iStart, int iCount)
          Returns a report on a subset on a user collection.
 AttributeElement[] getReportOnUserAttributes(java.lang.String cID)
          Returns a report on the user attributes collection.
 AttributeElement[] getReportOnUserAttributes(java.lang.String cID, int iStart, int iCount)
          Returns a report on a subset of the user attributes collection.
 AttributeElement getUserAttribute(java.lang.String aLocalUserName, java.lang.String attrName, int attrQueryType)
          Gets the value of an attribute associated with local user.
 java.lang.String getUserAttributes(java.lang.String aLocalUserName, int attrQueryType)
          Gets a collection of attributes associated with the specified user.
 java.lang.String getUsersWithAttribute(java.lang.String aDirName, AttributeElement attrElem)
          Finds all users with the specified attribute value.
 boolean isLimitReached(java.lang.String cID)
          Checks if the server specified limit has been crossed for this collection.
 void release(java.lang.String cID)
          Releases a user or user attribute collection.
 void remove(java.lang.String name)
          Removes a user from the system.
 void removeCascade(java.lang.String name)
          Removes a user and all associated policy data from the system.
 void removeUserAttribute(java.lang.String name, java.lang.String attrName)
          Removes the value of a user's attribute.
 void rename(java.lang.String oldName, java.lang.String newName)
          Renames a user.
 void setPasswordKnown(java.lang.String oldPassword, java.lang.String newPassword, java.lang.String confirmPassword)
          Resets the value of a user's password, requiring validation of the existing password.
 void setPasswordUnknown(java.lang.String username, java.lang.String newPassword, java.lang.String confirmPassword)
          Sets or resets a user's password without requiring knowledge of the current password.
 void setUserAttribute(java.lang.String aLocalUserName, AttributeElement attrElem)
          Sets the value for a user's attribute.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE_QUERY_TYPE_DIRECT

public static final int ATTRIBUTE_QUERY_TYPE_DIRECT
Attribute query type specifiying the attribute value assigned directly to the user.

See Also:
Constant Field Values

ATTRIBUTE_QUERY_TYPE_ENFORCED

public static final int ATTRIBUTE_QUERY_TYPE_ENFORCED
Attribute query type specifiying the attribute value based on the attribute inheritance logic.

See Also:
Constant Field Values

ATTRIBUTE_QUERY_TYPE_INHERITED

public static final int ATTRIBUTE_QUERY_TYPE_INHERITED
Attribute query type specifiying the attribute value inherited by the user, from a group membership.

See Also:
Constant Field Values
Method Detail

copyLocalUser

public void copyLocalUser(java.lang.String userName,
                          java.lang.String clonedUserName)
                   throws com.wles.blm.BLMException
Creates a new user based on an existing user's profile including group membership and attribute values, and rules. The new user will have a distict username as identified by clonedUserName.

Parameters:
userName - name of the user to be copied
clonedUserName - name of the new user
Throws:
BLMException

create

public void create(java.lang.String name)
            throws com.wles.blm.BLMException
Creates a new user.

Specified by:
create in class BLMComponentManager
Parameters:
name - name of the user to be created
Throws:
BLMException

filter

public java.lang.String filter(java.lang.String findPattern)
                        throws com.wles.blm.BLMException
Finds all users matching the specified filter pattern. The pattern needs to take the qualified form into account. Returns a user collection ID.

Specified by:
filter in class BLMComponentManager
Parameters:
findPattern - pattern for the filter
Returns:
unique String id to the collection found
Throws:
com.wles.blm.BLMException
See Also:
getReport(String cID), getReport(String cID, int iStart, int iCount), getCount(String CID), release(String cID), find(String cID, String name), isLimitReached(String cID)

find

public boolean find(java.lang.String cID,
                    java.lang.String name)
             throws com.wles.blm.BLMException
Checks for an occurance of the specified user name in a user collection.

Specified by:
find in class BLMComponentManager
Parameters:
cID - collection ID of the user collection
name - name of the user
Returns:
boolean found = true
Throws:
BLMException

getAllSubjectGroups

public java.lang.String getAllSubjectGroups(java.lang.String aLocalUserName)
                                     throws com.wles.blm.BLMException
Finds all the groups the user is a member of. This includes both direct and indirect (inherited) group memberships. Returns a group collection ID. Use the collection methods of the BLMLocalSubjectGroupManager to access the results.

Parameters:
aLocalUserName - local subjectgroup to be reported on
Returns:
the collection id containing the result set
Throws:
BLMException
See Also:
BLMLocalSubjectGroupManager.getReport(String cID), BLMLocalSubjectGroupManager.getReport(String cID, int iStart, int iCount), BLMLocalSubjectGroupManager.getCount(String CID), BLMLocalSubjectGroupManager.release(String cID), BLMLocalSubjectGroupManager.find(String cID, String name)

getCount

public int getCount(java.lang.String cID)
             throws com.wles.blm.BLMException
Returns the size of a user or user attribute collection.

Specified by:
getCount in class BLMComponentManager
Parameters:
cID - ID of the collection
Returns:
the count in the collection
Throws:
BLMException

getDirectSubjectGroups

public java.lang.String getDirectSubjectGroups(java.lang.String aLocalUserName,
                                               java.lang.String filterString)
                                        throws com.wles.blm.BLMException
Finds the direct group memberships for the specified user. The returned collection is filtered using the specified pattern. Returns a group collection ID. Use the collection reporting methods of the BLMLocalSubjectGroupManager to access the results.

Parameters:
aLocalUserName - a local user to be reported on
filterString - a pattern to filter the collection
Returns:
string unique collection id
Throws:
BLMException
See Also:
BLMLocalSubjectGroupManager.getReport(String cID), BLMLocalSubjectGroupManager.getReport(String cID, int iStart, int iCount), BLMLocalSubjectGroupManager.getCount(String CID), BLMLocalSubjectGroupManager.release(String cID), BLMLocalSubjectGroupManager.find(String cID, String name)

getEligibleSubjectGroups

public java.lang.String getEligibleSubjectGroups(java.lang.String aLocalUserName,
                                                 java.lang.String filterString)
                                          throws com.wles.blm.BLMException
Finds all groups this user is not already a member of. Returns a group collection ID. Use the collection reporting methods of the BLMLocalSubjectGroupManager to access the results.

Parameters:
aLocalUserName - a local user to be reported on
filterString - a pattern to filter the collection
Returns:
unique collection id
Throws:
BLMException
See Also:
BLMLocalSubjectGroupManager.getReport(String cID), BLMLocalSubjectGroupManager.getReport(String cID, int iStart, int iCount), BLMLocalSubjectGroupManager.getCount(String CID), BLMLocalSubjectGroupManager.release(String cID), BLMLocalSubjectGroupManager.find(String cID, String name)

getIndirectSubjectGroups

public java.lang.String getIndirectSubjectGroups(java.lang.String aLocalUserName,
                                                 java.lang.String filterString)
                                          throws com.wles.blm.BLMException
Finds the indirect (inherited) group memberships for the specified user. The returned collection is filtered using the specified pattern. Returns a group collection ID. Use the collection reporting methods of the BLMLocalSubjectGroupManager to access the results.

Parameters:
aLocalUserName - a local user to be reported on
filterString - a pattern to filter the collection
Returns:
string unique collection id
Throws:
BLMException
See Also:
BLMLocalSubjectGroupManager.getReport(String cID), BLMLocalSubjectGroupManager.getReport(String cID, int iStart, int iCount), BLMLocalSubjectGroupManager.getCount(String CID), BLMLocalSubjectGroupManager.release(String cID), BLMLocalSubjectGroupManager.find(String cID, String name)

getReport

public java.lang.String[] getReport(java.lang.String cID)
                             throws com.wles.blm.BLMException
Returns a report on a user collection.

Parameters:
cID - ID of the collection
Returns:
A String array of user names from the collection.
Throws:
BLMException

getReport

public java.lang.String[] getReport(java.lang.String cID,
                                    int iStart,
                                    int iCount)
                             throws com.wles.blm.BLMException
Returns a report on a subset on a user collection.

Parameters:
cID - ID of the collection
iStart - the index into the collection at which to start the report
iCount - the number of entries to include in the report
Returns:
A String array of user names from the collection.
Throws:
BLMException

getReportOnUserAttributes

public AttributeElement[] getReportOnUserAttributes(java.lang.String cID)
                                             throws com.wles.blm.BLMException,
                                                    BadParameterException
Returns a report on the user attributes collection.

Parameters:
cID - ID of the collection
Returns:
An array of AttributeElement objects from the collection.
Throws:
BLMException
BadParameterException

getReportOnUserAttributes

public AttributeElement[] getReportOnUserAttributes(java.lang.String cID,
                                                    int iStart,
                                                    int iCount)
                                             throws com.wles.blm.BLMException,
                                                    BadParameterException
Returns a report on a subset of the user attributes collection.

Parameters:
cID - ID of the collection
iStart - Start index in the collection
iCount - Number of objects
Returns:
An array of AttributeElement objects from the collection.
Throws:
BLMException
BadParameterException

getUserAttribute

public AttributeElement getUserAttribute(java.lang.String aLocalUserName,
                                         java.lang.String attrName,
                                         int attrQueryType)
                                  throws com.wles.blm.BLMException,
                                         BadParameterException
Gets the value of an attribute associated with local user.

Parameters:
aLocalUserName - the user name
attrName - the attribute name
attrQueryType - ATTRIBUTE_QUERY_TYPE_DIRECT, ATTRIBUTE_QUERY_TYPE_INHERITED, ATTRIBUTE_QUERY_TYPE_ENFORCED
Returns:
the AttributeElement containing the value of the user's attribute, or null if this attribute is not defined for the specified user.
Throws:
BLMException
BadParameterException
See Also:
ATTRIBUTE_QUERY_TYPE_DIRECT, ATTRIBUTE_QUERY_TYPE_INHERITED, ATTRIBUTE_QUERY_TYPE_ENFORCED

getUserAttributes

public java.lang.String getUserAttributes(java.lang.String aLocalUserName,
                                          int attrQueryType)
                                   throws com.wles.blm.BLMException
Gets a collection of attributes associated with the specified user. Returns a subject attribute collection ID.

Parameters:
aLocalUserName - user name
attrQueryType - ATTRIBUTE_QUERY_TYPE_DIRECT, ATTRIBUTE_QUERY_TYPE_INHERITED, ATTRIBUTE_QUERY_TYPE_ENFORCED
Returns:
collection id containing the result set
Throws:
BLMException
See Also:
getReportOnUserAttributes(String cID), getReportOnUserAttributes(String cID, int iStart, int iCount), getCount(String cID), release(String cID), ATTRIBUTE_QUERY_TYPE_DIRECT, ATTRIBUTE_QUERY_TYPE_INHERITED, ATTRIBUTE_QUERY_TYPE_ENFORCED

getUsersWithAttribute

public java.lang.String getUsersWithAttribute(java.lang.String aDirName,
                                              AttributeElement attrElem)
                                       throws com.wles.blm.BLMException,
                                              BadParameterException
Finds all users with the specified attribute value. Returns a user collection ID.

Parameters:
aDirName - directory name
attrElem - the attribute name and value
Returns:
The collection id of the result set.
Throws:
BLMException
BadParameterException
See Also:
getReport(String cID), getReport(String cID, int iStart, int iCount), getCount(String CID), release(String cID), find(String cID, String name), getReportOnUserAttributes(String cID)

isLimitReached

public boolean isLimitReached(java.lang.String cID)
                       throws com.wles.blm.BLMException
Checks if the server specified limit has been crossed for this collection. The BLM server supports a configurable limit on the total number of elements that a collection may contain. If the limit has been crossed for the specified collection, then the data in the collection is not complete. You may either reconfigure the server to increase the limit, or change the filter on the collection to match fewer names.

Parameters:
cID - collection ID of the collection
Throws:
BLMException

release

public void release(java.lang.String cID)
             throws com.wles.blm.BLMException
Releases a user or user attribute collection. Supplying a null collection id will cause all held collections to be released.

Specified by:
release in class BLMComponentManager
Parameters:
cID - ID of the collection
Returns:
void
Throws:
BLMException

remove

public void remove(java.lang.String name)
            throws com.wles.blm.BLMException
Removes a user from the system.

Specified by:
remove in class BLMComponentManager
Parameters:
name - name of the LocalUser to be renamed
Throws:
BLMException

removeCascade

public void removeCascade(java.lang.String name)
                   throws com.wles.blm.BLMException
Removes a user and all associated policy data from the system.

Parameters:
name - name of the user to be removed.
Throws:
BLMException

removeUserAttribute

public void removeUserAttribute(java.lang.String name,
                                java.lang.String attrName)
                         throws com.wles.blm.BLMException,
                                BadParameterException
Removes the value of a user's attribute.

Parameters:
name - fully qualified name of the user
attrName - the name of the attribute to remove
Returns:
void
Throws:
BLMException
BadParameterException

rename

public void rename(java.lang.String oldName,
                   java.lang.String newName)
            throws com.wles.blm.BLMException
Renames a user. All rules referencing this user will automatically be updated to refer to the new name.

Specified by:
rename in class BLMComponentManager
Parameters:
oldName - old name of the user
newName - new name of the user
Throws:
BLMException

setPasswordKnown

public void setPasswordKnown(java.lang.String oldPassword,
                             java.lang.String newPassword,
                             java.lang.String confirmPassword)
                      throws com.wles.blm.BLMException
Resets the value of a user's password, requiring validation of the existing password. The password set by this method is only applicable when using the ALES database authentication provider against the ALES datastore. This method can be used to allow user's to reset their own passwords.

Parameters:
oldPassword - old password
newPassword - new password
confirmPassword - confirm password
Throws:
BLMException

setPasswordUnknown

public void setPasswordUnknown(java.lang.String username,
                               java.lang.String newPassword,
                               java.lang.String confirmPassword)
                        throws com.wles.blm.BLMException
Sets or resets a user's password without requiring knowledge of the current password. The password set by this method is only applicable when using the ALES database authentication provider against the ALES datastore. This method is inteneded for use by administrators so that they may reset a user's password without needing to know the value of the current password.

Parameters:
username - fully qualified user name
newPassword - new password
confirmPassword - confirm password
Throws:
BLMException

setUserAttribute

public void setUserAttribute(java.lang.String aLocalUserName,
                             AttributeElement attrElem)
                      throws com.wles.blm.BLMException,
                             BadParameterException
Sets the value for a user's attribute.

Parameters:
aLocalUserName - user name
attrElem - the attribute name and value to set
Throws:
BLMException
BadParameterException


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