Package com.ibm.security.access.user
Class User
- java.lang.Object
- 
- com.ibm.security.access.user.User
 
- 
 public class User extends java.lang.ObjectA user. The boolean checks on the state of the user hinge off the last exception raised. The exception will be set when an error occurs. The authenticate / setPassword / changePassword methods will cause the boolean state of the objects to change. Other internal / unexpected errors will only populate the error message available via getErrMessage().- Since:
- 9.0.2.1
 
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringUser_java_copyrightstatic java.lang.StringUser_java_sourceCodeID
 - 
Constructor SummaryConstructors Constructor Description User(RgyUser user)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddAttribute(java.lang.String attrName, java.lang.Object value)Set an attribute to a single value.booleanaddAttribute(java.lang.String attrName, java.lang.Object[] values)Set an attribute to the given values.booleanaddToGroup(java.lang.String groupName)Add a user to the given group.booleanaddToGroupWithDomain(java.lang.String groupName, java.lang.String domainName)Add a user to the given group, with domain If an error occurs doing the look up of the group then the error message of the User will be set.booleanattributeExists(java.lang.String attrName)check if a user has an attributebooleanauthenticate(java.lang.String password)Attempts to authenticate a user.booleanchangePassword(java.lang.String oldPassword, java.lang.String newPassword)Attempt to change a password, requiring the old password Will clear the error message of this user if successful.voidclearError()Remove the error state of this objectjava.lang.ObjectgetAttribute(java.lang.String attrName)java.lang.String[]getAttributeNames()Fetch all values for an attribute.java.lang.Object[]getAttributes(java.lang.String attrName)Fetch a single attribute value.java.lang.StringgetErrMessage()Get the error message of the last operation.java.lang.String[]getGroups()Get the groups of this user Will clear the error message of this user if successful.java.lang.StringgetId()Get the users ID.java.lang.String[]getNativeGroups()Get the natvie groups of this user Will clear the error message of this user if successful.java.lang.StringgetNativeId()Get the users native ID.booleanisAccountDisabled()booleanisAccountLocked()booleanisAccountValid()booleanisCredentialsValid()booleanisPasswordCharsValid()booleanisPasswordContainsRepeatedChars()booleanisPasswordContainsSpaces()booleanisPasswordExpiringSoon()booleanisPasswordMissingAlphaChars()booleanisPasswordMissingNonAlphaChars()booleanisPasswordTooShort()booleanisPasswordValid()booleanisValidTimeOfDayAccess()booleanremoveAttribute(java.lang.String attrName)Remove an attribute from this userbooleanremoveFromGroup(java.lang.String groupName)Remove a user from the given group.booleanremoveFromGroupWithDomain(java.lang.String groupName, java.lang.String domainName)Remove a user from the given group with domain.booleanreplaceAttribute(java.lang.String attrName, java.lang.Object value)Set an attribute to a single value.booleanreplaceAttribute(java.lang.String attrName, java.lang.Object[] values)Set an attribute to the given values.booleansetPassword(java.lang.String newPassword)Will clear the error message of this user if successful.booleanwasAccountJustDisabled()booleanwasAccountJustLocked()booleanwasOldPasswordValid()
 
- 
- 
- 
Field Detail- 
User_java_sourceCodeIDpublic static final java.lang.String User_java_sourceCodeID - See Also:
- Constant Field Values
 
 - 
User_java_copyrightpublic static final java.lang.String User_java_copyright 
 
- 
 - 
Method Detail- 
isAccountDisabledpublic boolean isAccountDisabled() 
 - 
isAccountLockedpublic boolean isAccountLocked() 
 - 
wasAccountJustLockedpublic boolean wasAccountJustLocked() 
 - 
wasAccountJustDisabledpublic boolean wasAccountJustDisabled() 
 - 
isCredentialsValidpublic boolean isCredentialsValid() 
 - 
isAccountValidpublic boolean isAccountValid() 
 - 
isPasswordValidpublic boolean isPasswordValid() 
 - 
isValidTimeOfDayAccesspublic boolean isValidTimeOfDayAccess() 
 - 
isPasswordExpiringSoonpublic boolean isPasswordExpiringSoon() 
 - 
wasOldPasswordValidpublic boolean wasOldPasswordValid() 
 - 
isPasswordCharsValidpublic boolean isPasswordCharsValid() 
 - 
isPasswordContainsSpacespublic boolean isPasswordContainsSpaces() 
 - 
isPasswordContainsRepeatedCharspublic boolean isPasswordContainsRepeatedChars() 
 - 
isPasswordTooShortpublic boolean isPasswordTooShort() 
 - 
isPasswordMissingAlphaCharspublic boolean isPasswordMissingAlphaChars() 
 - 
isPasswordMissingNonAlphaCharspublic boolean isPasswordMissingNonAlphaChars() 
 - 
getErrMessagepublic java.lang.String getErrMessage() Get the error message of the last operation.- Returns:
- String of the last caught exception. Null if not exception was caught.
 
 - 
clearErrorpublic void clearError() Remove the error state of this object
 - 
authenticatepublic boolean authenticate(java.lang.String password) Attempts to authenticate a user. Will clear the error message of this user if successful.- Parameters:
- password- users password to check
- Returns:
- true if the user was successfully authenticated.
 
 - 
changePasswordpublic boolean changePassword(java.lang.String oldPassword, java.lang.String newPassword)Attempt to change a password, requiring the old password Will clear the error message of this user if successful.- Parameters:
- oldPassword- the users valid old password
- newPassword- the new password to use if the old password validates successfully.
- Returns:
- true if no exception was raised and the password was changed
 
 - 
setPasswordpublic boolean setPassword(java.lang.String newPassword) Will clear the error message of this user if successful. Attempt to change a password, without the old password. Will clear the error message of this user if successful.- Parameters:
- newPassword- new password
- Returns:
- true if no exception was raised.
 
 - 
getNativeIdpublic java.lang.String getNativeId() Get the users native ID.- Returns:
- this users ldap DN
 
 - 
getIdpublic java.lang.String getId() Get the users ID.- Returns:
- this users username.
 
 - 
getGroupspublic java.lang.String[] getGroups() Get the groups of this user Will clear the error message of this user if successful.- Returns:
- the groups, or empty array if not a member of any groups. null if an error occurs.
 
 - 
getNativeGroupspublic java.lang.String[] getNativeGroups() Get the natvie groups of this user Will clear the error message of this user if successful.- Returns:
- the groups, or empty array if not a member of any groups. null if an error occurs.
 
 - 
attributeExistspublic boolean attributeExists(java.lang.String attrName) check if a user has an attribute- Parameters:
- attrName- name of the attribute to check for
- Returns:
- true if the user has the attribute, false if they do not.
 
 - 
getAttributepublic java.lang.Object getAttribute(java.lang.String attrName) - Parameters:
- attrName-
- Returns:
 
 - 
getAttributespublic java.lang.Object[] getAttributes(java.lang.String attrName) Fetch a single attribute value. If this is a multivalued attribute, the value returned is undefined.- Parameters:
- attrName- Name of the attribute to retrieve.
- Returns:
- the attribute value. Null if the attribute wasn't found.
 
 - 
getAttributeNamespublic java.lang.String[] getAttributeNames() Fetch all values for an attribute.- Parameters:
- attrName- Name of the attributes to retrieve
- Returns:
- the attribute values. Null if the attribute wasn't found.
 
 - 
removeAttributepublic boolean removeAttribute(java.lang.String attrName) Remove an attribute from this user- Parameters:
- attrName- name of the attribute to remove
- Returns:
- true if the attribute was removed. False if the attribute was not removed.
 
 - 
addAttributepublic boolean addAttribute(java.lang.String attrName, java.lang.Object value)Set an attribute to a single value. Will append values to an existing attribute- Parameters:
- attrName- Name of the attribute to set.
- value- name of the value to set.
- Returns:
- true if the attribute was successfully set. False if it was not.
 
 - 
addAttributepublic boolean addAttribute(java.lang.String attrName, java.lang.Object[] values)Set an attribute to the given values. Will append values to an existing attribute- Parameters:
- attrName- Name of the attribute to set.
- values- name of the values to set.
- Returns:
- true if the attribute was successfully set. False if it was not.
 
 - 
replaceAttributepublic boolean replaceAttribute(java.lang.String attrName, java.lang.Object value)Set an attribute to a single value. Will replace values of an existing attribute- Parameters:
- attrName- Name of the attribute to set.
- value- name of the value to set.
- Returns:
- true if the attribute was successfully set. False if it was not.
 
 - 
replaceAttributepublic boolean replaceAttribute(java.lang.String attrName, java.lang.Object[] values)Set an attribute to the given values. Will replace values of anexisting attribute- Parameters:
- attrName- Name of the attribute to set.
- values- name of the values to set.
- Returns:
- true if the attribute was successfully set. False if it was not.
 
 - 
addToGrouppublic boolean addToGroup(java.lang.String groupName) Add a user to the given group. If an error occurs doing the look up of the group then the error message of the User will be set. If the group is not found then the message will not be set.- Parameters:
- groupName- name of the group to add the user to
- Returns:
- true if the user was added to the group / false if the user was not added to the group.
 
 - 
addToGroupWithDomainpublic boolean addToGroupWithDomain(java.lang.String groupName, java.lang.String domainName)Add a user to the given group, with domain If an error occurs doing the look up of the group then the error message of the User will be set. If the group is not found then the message will not be set.- Parameters:
- groupName- name of the group to add the user to
- domainName- name of the domain the group is in
- Returns:
- true if the user was added to the group / false if the user was not added to the group.
 
 - 
removeFromGrouppublic boolean removeFromGroup(java.lang.String groupName) Remove a user from the given group. If an error occurs doing the look up of the group then the error message of the User will be set. If the group is not found then the message will not be set.- Parameters:
- groupName- name of the group to remove the user from.
- Returns:
- true if the user was removed from the group / false if the user was not removed from the group.
 
 - 
removeFromGroupWithDomainpublic boolean removeFromGroupWithDomain(java.lang.String groupName, java.lang.String domainName)Remove a user from the given group with domain. If an error occurs doing the look up of the group then the error message of the User will be set. If the group is not found then the message will not be set.- Parameters:
- groupName- name of the group to remove the user from.
- domainName- name of the domain the group is in
- Returns:
- true if the user was removed from the group / false if the user was not removed from the group.
 
 
- 
 
-