com.autonomy.aci.businessobjects
Class User

java.lang.Object
  extended bycom.autonomy.aci.businessobjects.AciBusinessObject
      extended bycom.autonomy.aci.businessobjects.User
All Implemented Interfaces:
java.io.Serializable

public class User
extends AciBusinessObject

Represents a user entry on IDOL Server.

A User should be read from IDOL using the UserFunctionality interface using the username:

	IDOLService idolService = new IDOLService();
	...
	UserFunctionality userFun = idolService.useUserFunctionality();
 	User user = userFun.getUser(sUserName)
 

Modifying the user's fields, roles, privileges and security details using the public access methods only changes the values for these user parameters on the local object. To update the user details on the IDOL service you then need to send the modified user object using the UserFunctionality interface:

	userFun.updateUser(user)
 

See Also:
IDOLService, UserFunctionality, Serialized Form

Field Summary
static int DEFAULT_MAX_AGENTS
          The default maximum number of agents that a user can have.
 
Constructor Summary
User()
           
User(java.lang.String sUsername)
          Construct a User object for a user with the given username.
 
Method Summary
 void addPrivilege(Privilege privilege)
          Add a privilege to those already enjoyed by this user.
 void addRole(Role role)
          Add a role to the set of roles this user belongs to.
 void addSecurityType(SecurityType securityType)
          Add a repository or authentication security type to those already set on this user.
 void clearPrivileges()
          Remove all privileges from this user.
 void clearRoles()
          Remove this user from all roles.
 void clearSecurityTypes()
          Deletes all security information for this user.
 void clearUserFields()
          Deletes all existing user fields and their values.
 java.lang.String getEmail()
          Read the email address of this user.
 int getMaxAgents()
          Read the maximum number of agents that this user can own.
 int getNumAgents()
          Read the number of agents that this user currently owns.
 java.lang.String getPassword()
          Read the password of this user.
 java.util.ArrayList getPrivileges()
          Read the privileges that this user enjoys.
 java.util.ArrayList getPrivilegeValues(java.lang.String sPrivilegeName)
          Read the values of a given privilege for this user.
 java.util.ArrayList getRoles()
          Read the roles that this user belongs to.
 java.lang.String getSecurityInfo()
          Read the security information string of this user.
 java.util.ArrayList getSecurityTypes()
          Read the security types (repository and authentication) set for this user.
 java.util.Set getUserFieldNames()
          Read all the fields and their values set on this user.
 java.lang.String getUserFieldValue(java.lang.String sFieldname)
          Read the value of a user field.
 java.lang.String getUserFieldValue(java.lang.String sFieldname, java.lang.String sDefaultValue)
          Read the value of a user field.
 java.lang.String getUserID()
          Read the unique ID of the user's IDOL entry.
 java.lang.String getUsername()
          Read the username of the user represented by this User object.
 boolean isUserInRole(Role role)
          Checks the role permissions to see if the user belongs to the given role.
 void removePrivilege(Privilege privilege)
          Remove a privilege from those currently enjoyed by this user.
 void removeRole(Role role)
          Remove a role from the set of roles this user belongs to.
 void removeSecurityType(SecurityType securityType)
          Remove a repository or authentication security type from those currently set on this user.
 void removeUserField(java.lang.String sFieldname)
          Deletes the user field entry for the specified field, if it exists.
 void setEmail(java.lang.String sEmailAddress)
          Set the email address for this user.
 void setMaxAgents(int nMaxAgents)
          Set the value for the maximum number of agents this user can have.
 void setNumAgents(int nNumAgents)
          Set the value for the number of agents this user currently has.
 void setPassword(java.lang.String sPassword)
          Set the password for this user.
 void setPrivileges(java.util.ArrayList alPrivileges)
          Set the names and values of the privileges that this user enjoys.
 void setRoles(java.util.ArrayList alRoles)
          Set the list of roles that this user belongs to.
 void setSecurityInfo(java.lang.String sSecurityInfo)
          Set the security information for this user.
 void setSecurityTypes(java.util.ArrayList alSecurityTypes)
          Set all the security types for this user.
 void setUserField(java.lang.String sFieldname, java.lang.String sFieldValue)
          Set the value of a user field.
 void setUserFields(java.util.HashMap fieldMap)
          Replaces any existing user fields with those provided.
 void setUserID(java.lang.String sUserID)
          Set the ID of the user.
 void setUsername(java.lang.String sUsername)
          Set the name of this user.
 java.lang.String toString()
          Assembles all the available user information into a string to easy viewing.
 
Methods inherited from class com.autonomy.aci.businessobjects.AciBusinessObject
getUID, setUID
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_MAX_AGENTS

public static final int DEFAULT_MAX_AGENTS
The default maximum number of agents that a user can have.

See Also:
Constant Field Values
Constructor Detail

User

public User()

User

public User(java.lang.String sUsername)
Construct a User object for a user with the given username.

Parameters:
sUsername - the name of the user.
Method Detail

setUserID

public void setUserID(java.lang.String sUserID)
Set the ID of the user. This should always be the UID read from the IDOL entry for this user. Other values will lead to UserNotFoundExceptions being throw when using methods from the ACI Services API.

Parameters:
sUserID - the UID for the user.

setUsername

public void setUsername(java.lang.String sUsername)
Set the name of this user.

Parameters:
sUsername - the name of this user.

setPassword

public void setPassword(java.lang.String sPassword)
Set the password for this user.

Parameters:
sPassword - the password for this user.

setEmail

public void setEmail(java.lang.String sEmailAddress)
Set the email address for this user.

Parameters:
sEmailAddress - the email address for this user.

setSecurityInfo

public void setSecurityInfo(java.lang.String sSecurityInfo)

Set the security information for this user. This is an encrypted string constructed by IDOL using the user's repository information and its value on IDOL is not modified when updating the user. To modify the security information for a user, you should change the user's repository information (using setSecurityTypes) and update the user entry on IDOL using UserFunctionality.updateUser - this returns an updated user object with the new security information string set.

(This method is only intended to be used by the ACI Service API classes themselves.)


setUserFields

public void setUserFields(java.util.HashMap fieldMap)
Replaces any existing user fields with those provided. Both the keys and the values assosciated in the Map must be Strings.

Parameters:
fieldMap - a Map assosciating String pairs representing the field names and values.

setUserField

public void setUserField(java.lang.String sFieldname,
                         java.lang.String sFieldValue)
Set the value of a user field. If the specified field does not already exist, a new one is created. If the field is already set, it's value is overwritten with the new value.

Parameters:
sFieldname - the name of the user field to set.
sFieldValue - the value to give the field.

removeUserField

public void removeUserField(java.lang.String sFieldname)
Deletes the user field entry for the specified field, if it exists.

Parameters:
sFieldname - the name of the field to delete.

clearUserFields

public void clearUserFields()
Deletes all existing user fields and their values.


setSecurityTypes

public void setSecurityTypes(java.util.ArrayList alSecurityTypes)
Set all the security types for this user.

Parameters:
alSecurityTypes - an ArrayList of SecurityTypess giving details of all the security types for this user.

addSecurityType

public void addSecurityType(SecurityType securityType)
Add a repository or authentication security type to those already set on this user.

Parameters:
securityType - details of the security type and the values to use for this user.

removeSecurityType

public void removeSecurityType(SecurityType securityType)
Remove a repository or authentication security type from those currently set on this user.

Parameters:
securityType - the security type to remove (only needs to have the security type name set).

clearSecurityTypes

public void clearSecurityTypes()
Deletes all security information for this user.


setRoles

public void setRoles(java.util.ArrayList alRoles)
Set the list of roles that this user belongs to.

Parameters:
alRoles - an ArrayList of Roles giving all the roles this user belongs to.

addRole

public void addRole(Role role)
Add a role to the set of roles this user belongs to.

Parameters:
role - the role to add.

removeRole

public void removeRole(Role role)
Remove a role from the set of roles this user belongs to.

Parameters:
role - the role to remove.

clearRoles

public void clearRoles()
Remove this user from all roles.


setPrivileges

public void setPrivileges(java.util.ArrayList alPrivileges)
Set the names and values of the privileges that this user enjoys.

Parameters:
alPrivileges - an ArrayList of Privilege objects giving all the privileges for this user.

addPrivilege

public void addPrivilege(Privilege privilege)
Add a privilege to those already enjoyed by this user.

Parameters:
privilege - the privilege to add.

removePrivilege

public void removePrivilege(Privilege privilege)
Remove a privilege from those currently enjoyed by this user.

Parameters:
privilege - the privilege to remove.

clearPrivileges

public void clearPrivileges()
Remove all privileges from this user.


setMaxAgents

public void setMaxAgents(int nMaxAgents)
Set the value for the maximum number of agents this user can have.

Parameters:
nMaxAgents - the maximum number of agents.

setNumAgents

public void setNumAgents(int nNumAgents)
Set the value for the number of agents this user currently has.

Parameters:
nNumAgents - the number of agents this user has.

getUsername

public java.lang.String getUsername()
Read the username of the user represented by this User object.

Returns:
the user's username.

getUserID

public java.lang.String getUserID()
Read the unique ID of the user's IDOL entry.

Returns:
the user's ID.

getPassword

public java.lang.String getPassword()
Read the password of this user.

Returns:
the user's password.

getEmail

public java.lang.String getEmail()
Read the email address of this user.

Returns:
the user's email address.

getSecurityInfo

public java.lang.String getSecurityInfo()
Read the security information string of this user.

Returns:
the user's security information string.

getSecurityTypes

public java.util.ArrayList getSecurityTypes()
Read the security types (repository and authentication) set for this user.

Returns:
an ArrayList of SecurityTypes objects giving the security details for this user.

getUserFieldNames

public java.util.Set getUserFieldNames()
Read all the fields and their values set on this user.

Returns:
the fields are provided as a mapping of field name and field value pairs. public Map getUserFields() { return(Map)_hashmapFields.clone(); } /** Read the names of all the user fields that are set for this user.

getUserFieldValue

public java.lang.String getUserFieldValue(java.lang.String sFieldname,
                                          java.lang.String sDefaultValue)
Read the value of a user field. The default value is returned if the user does not have a field with that name set or if the field does not have a value.

Parameters:
sFieldname - the name of the user field.
sDefaultValue - the value to return if the field does not exist or is empty.
Returns:
the user field's value or the default value supplied.

getUserFieldValue

public java.lang.String getUserFieldValue(java.lang.String sFieldname)
Read the value of a user field.

Parameters:
sFieldname - the name of the user field.
Returns:
the user field's value or null if the field does not exist or does not have a value.

getRoles

public java.util.ArrayList getRoles()
Read the roles that this user belongs to.

Returns:
an ArrayList of Roles objects giving the roles this user belongs to.

isUserInRole

public boolean isUserInRole(Role role)
Checks the role permissions to see if the user belongs to the given role.

Parameters:
role - the role to check for.
Returns:
true if the user belongs to the given role, false otherwise.

getPrivileges

public java.util.ArrayList getPrivileges()
Read the privileges that this user enjoys.

Returns:
an ArrayList of Privileges objects giving the privileges this user enjoys.

getPrivilegeValues

public java.util.ArrayList getPrivilegeValues(java.lang.String sPrivilegeName)
Read the values of a given privilege for this user.

Parameters:
sPrivilegeName - the name of the privilege whose values are required.
Returns:
an ArrayList of Strings giving the values that the user has set for the privilege.

getMaxAgents

public int getMaxAgents()
Read the maximum number of agents that this user can own.

Returns:
the maximum number of agents.

getNumAgents

public int getNumAgents()
Read the number of agents that this user currently owns.

Returns:
the number of agents this user owns.

toString

public java.lang.String toString()
Assembles all the available user information into a string to easy viewing.