Package com.tietoenator.trip.jxp.users

# Class TdbUser

java.lang.Object
com.tietoenator.trip.jxp.session.TdbSessionObject
com.tietoenator.trip.jxp.TdbMessageProvider
com.tietoenator.trip.jxp.session.TdbSerializableObject
com.tietoenator.trip.jxp.users.TdbUser

All Implemented Interfaces:
  `com.tietoenator.trip.jxp.internal.utils.DOMSink`, `TdbControlObjectProvider`

public class TdbUser extends TdbSerializableObject implements com.tietoenator.trip.jxp.internal.utils.DOMSink
Manipulator class for TRIP users

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TdbUser(TdbSession session)`
  Constructor, creates a blank instance
  `TdbUser(TdbSession session, TdbControlObject ob)`
  Constructor, creates a user instance for the user referenced by the provided Control object

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `changeMgr(String newmgr)`
  Move all objects owned by the current user to another user.
  `void`
  `changeMgr(String newmgr, String oldmgr)`
  Move all objects owned by one user to another user.
  `void`
  `changeMgr(String newmgr, String oldmgr, String name)`
  Move objects owned by one user to another user.
  `void`
  `changePassword(String oldpw, String newpw)`
  Change the current user's password.
  `void`
  `clear()`
  Clear any state established for this object
  `void`
  `copy(String newname, String newpw, boolean groups, TdbControlObject ob)`
  Create a new user as a copy of an existing one, optionally including group memberships and private procedures.
  `void`
  `create(String username, String password)`
  Create a new user on the server with the specified credentials.
  `void`
  `delete()`
  Remove the user from the server.
  `void`
  `delete(String username)`
  Remove a user from the server.
  `void`
  `export(String filename, boolean groups)`
  Export the definition of the user to a file.
  `void`
  `export(String filename, String username, boolean groups)`
  Export the definition of the user to a file.
  `void`
  `get()`
  Retrieve the user's properties from the server.
  `void`
  `get(String username)`
  Retrieve the specified user's properties from the server.
  `String`
  `getAddress1()`
  Retrieve the first line of the user's address
  `String`
  `getAddress2()`
  Retrieve the second line of the user's address
  `String`
  `getCompany()`
  Retrieve the user's company name
  `int`
  `getDateform()`
  Retrieve the date format in use by the user; to retrieve the text version of a date format, use the `TdbSession.getDateform` methods.
  `String`
  `getDateformSep()`
  Retrieve the separators used when formatting date strings
  `boolean`
  `getIsFM()`
  Retrieve the user's FM status
  `boolean`
  `getIsUM()`
  Retrieve the user's UM status
  `String`
  `getLoginProcedure()`
  Retrieve the name of the user's login procedure, i.e. the procedure that will always be run whenever the user initializes a session.
  `String`
  `getPhoneNumber()`
  Retrieve the user's phone number
  `String`
  `getRealName()`
  Retrieve the user's "real" name
  `int`
  `getStartModule()`
  Obsolete
  `boolean`
  `getUsesBypass()`
  Check if the user can enter TRIP without providing a password if the server O/S in use supports single sign-on
  `void`
  `importUpdate(String filename)`
  Update the user's definition from a saved file.
  `void`
  `importUser(String filename, String username, String password)`
  Create a new user from a saved definition.
  `void`
  `put()`
  Update the user's properties on the server.
  `void`
  `put(String username)`
  Update a user's properties on the server.
  `void`
  `rename(String newname)`
  Rename the user.
  `void`
  `resetPassword(String password)`
  Reset the user's password -- can only be accomplished by the system manager.
  `void`
  `setAddress1(String address)`
  Establish the first line of the user's address
  `void`
  `setAddress2(String address)`
  Established the second line of the user's address
  `void`
  `setCompany(String name)`
  Establish the user's company name
  `void`
  `setDateform(int dform)`
  Establish the date format that will be used by the user; to retrieve the text version of a date format, use the `TdbSession.getDateform` methods.
  `void`
  `setDateformSep(String sep)`
  Establish the separates that will be used when formatting date strings for the user.
  `void`
  `setIsFM(boolean fm)`
  Modify the user's FM status; this can only successfully be invoked by the SYSTEM user
  `void`
  `setIsUM(boolean um)`
  Modify the user's UM status; this can only successfully be invoked by the SYSTEM user
  `void`
  `setLoginProcedure(String proc)`
  Establish the name of the user's login procedure, i.e. the procedure that will always be run whenever the user initializes a session.
  `void`
  `setPhoneNumber(String number)`
  Establish the user's phone number
  `void`
  `setRealName(String name)`
  Establish the user's "real" name
  `void`
  `setStartModule(int module)`
  Obsolete
  `void`
  `setUsesBypass(boolean bypass)`
  Establish the user's ability to enter TRIP without providing a password, provided that the server O/S supports single sign-on; if the O/S does not support single sign-on, this setting is ignored

  ### Methods inherited from class com.tietoenator.trip.jxp.session.TdbSerializableObject

  `getControlObject`

  ### Methods inherited from class com.tietoenator.trip.jxp.TdbMessageProvider

  `codeList, getLastCode, getLastMessage, hasMessages, messageList, resetMessages`

  ### Methods inherited from class com.tietoenator.trip.jxp.session.TdbSessionObject

  `cancel, getSession, isCancelable, setCancelable`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### TdbUser

    public TdbUser(TdbSession session, TdbControlObject ob) throws TdbException
    Constructor, creates a user instance for the user referenced by the provided Control object
    Parameters:
      `session` - Active session
      `ob` - The Control object reference for the user that will be manipulated by this instance
    Throws:
      `TdbException`

  - ### TdbUser

    public TdbUser(TdbSession session) throws TdbException
    Constructor, creates a blank instance
    Parameters:
      `session` - Active session
    Throws:
      `TdbException`

- ## Method Details

  - ### getRealName

    public String getRealName()
    Retrieve the user's "real" name
    Returns:
      The user's real name, if any

  - ### setRealName

    public void setRealName(String name)
    Establish the user's "real" name
    Parameters:
      `name` - The user's new real name

  - ### getCompany

    public String getCompany()
    Retrieve the user's company name
    Returns:
      The user's company name, if any

  - ### setCompany

    public void setCompany(String name)
    Establish the user's company name
    Parameters:
      `name` - The user's new company name

  - ### getAddress1

    public String getAddress1()
    Retrieve the first line of the user's address
    Returns:
      The address line, if any

  - ### setAddress1

    public void setAddress1(String address)
    Establish the first line of the user's address
    Parameters:
      `address` - The first line of the user's new address

  - ### getAddress2

    public String getAddress2()
    Retrieve the second line of the user's address
    Returns:
      The second line of the user's address, if any

  - ### setAddress2

    public void setAddress2(String address)
    Established the second line of the user's address
    Parameters:
      `address` - The second line of the user's new address

  - ### getPhoneNumber

    public String getPhoneNumber()
    Retrieve the user's phone number
    Returns:
      The user's phone number, if any

  - ### setPhoneNumber

    public void setPhoneNumber(String number)
    Establish the user's phone number
    Parameters:
      `number` - The user's new phone number

  - ### getLoginProcedure

    public String getLoginProcedure()
    Retrieve the name of the user's login procedure, i.e. the procedure that will always be run whenever the user initializes a session.
    Returns:
      The name of the user's login procedure, if any

  - ### setLoginProcedure

    public void setLoginProcedure(String proc)
    Establish the name of the user's login procedure, i.e. the procedure that will always be run whenever the user initializes a session.
    Parameters:
      `proc` - The name of the user's new login procedure

  - ### getDateformSep

    public String getDateformSep()
    Retrieve the separators used when formatting date strings
    Returns:
      Date separators

  - ### setDateformSep

    public void setDateformSep(String sep)
    Establish the separates that will be used when formatting date strings for the user. This must be a two character string, with the allowable characters being chosen from :/-
    Parameters:
      `sep` - The user's new date separators

  - ### getIsUM

    public boolean getIsUM()
    Retrieve the user's UM status
    Returns:
      true if the user is a user manager, false otherwise

  - ### setIsUM

    public void setIsUM(boolean um)
    Modify the user's UM status; this can only successfully be invoked by the SYSTEM user
    Parameters:
      `um` - if true, the user will be granted UM privilege

  - ### getIsFM

    public boolean getIsFM()
    Retrieve the user's FM status
    Returns:
      true if the user is a file manager, false otherwise

  - ### setIsFM

    public void setIsFM(boolean fm)
    Modify the user's FM status; this can only successfully be invoked by the SYSTEM user
    Parameters:
      `fm` - if true, the user will be granted FM privilege

  - ### getUsesBypass

    public boolean getUsesBypass()
    Check if the user can enter TRIP without providing a password if the server O/S in use supports single sign-on
    Returns:
      true if the user can enter TRIP without a password

  - ### setUsesBypass

    public void setUsesBypass(boolean bypass)
    Establish the user's ability to enter TRIP without providing a password, provided that the server O/S supports single sign-on; if the O/S does not support single sign-on, this setting is ignored
    Parameters:
      `bypass` - If true, the user will be able to enter TRIP without a password if the server O/S supports single sign-on

  - ### getDateform

    public int getDateform()
    Retrieve the date format in use by the user; to retrieve the text version of a date format, use the `TdbSession.getDateform` methods.
    Returns:
      The index of the dateform in use by the user

  - ### setDateform

    public void setDateform(int dform)
    Establish the date format that will be used by the user; to retrieve the text version of a date format, use the `TdbSession.getDateform` methods.
    Parameters:
      `dform` - The index of the dateform to be used

  - ### getStartModule

    public int getStartModule()
    Obsolete
    Returns:
      N/A

  - ### setStartModule

    public void setStartModule(int module)
    Obsolete
    Parameters:
      `module` - N/A

  - ### clear

    public void clear()
    Clear any state established for this object

  - ### get

    public void get(String username) throws TdbException
    Retrieve the specified user's properties from the server.

    This method causes network I/O.

    Parameters:
      `username` - The name of user for whom properties are to be retrieved
    Throws:
      `TdbException`

  - ### get

    public void get() throws TdbException
    Retrieve the user's properties from the server.

    If this TdbUser instance has been created using a TdbControlObject from a TdbUserList instance, this method will fetch the properties of the user associated with the TdbControlObject instance.

    If this TdbUser instance has previously been used to fetch a user's properties, this method will fetch that user's properties again.

    If neither of the two above cases apply, this method will retrieve the properties of the currently logged on user.

    This method causes network I/O.

    Throws:
      `TdbException`

  - ### create

    public void create(String username, String password) throws TdbException
    Create a new user on the server with the specified credentials. Note that upon successful completion of this function, the Control object contained by the instance of this class will be valid for the new user. Note that any profile or management attributes set for the user will also be applied at this time, so the operation can be considered monotonic.

    This method causes network I/O.

    Parameters:
      `username` - The username of the new user
      `password` - The password of the new user
    Throws:
      `TdbException`

  - ### delete

    public void delete(String username) throws TdbException
    Remove a user from the server.

    This method causes network I/O.

    Parameters:
      `username` - The name of the user to be removed
    Throws:
      `TdbException`

  - ### delete

    public void delete() throws TdbException
    Remove the user from the server.

    This method causes network I/O.

    Throws:
      `TdbException`

  - ### put

    public void put(String username) throws TdbException
    Update a user's properties on the server.

    This method causes network I/O.

    Parameters:
      `username` - The name of user for whom properties are to be updated
    Throws:
      `TdbException`

  - ### put

    public void put() throws TdbException
    Update the user's properties on the server.

    This method causes network I/O.

    Throws:
      `TdbException`

  - ### resetPassword

    public void resetPassword(String password) throws TdbException
    Reset the user's password -- can only be accomplished by the system manager. Note that the current user must have been loaded, either by providing a TdbControlObject during the constructor, or by calling the get() method prior to calling this method.

    This method causes network I/O.

    Parameters:
      `password` - The new password to set
    Throws:
      `TdbException`

  - ### changePassword

    public void changePassword(String oldpw, String newpw) throws TdbException
    Change the current user's password.

    This method causes network I/O.

    Parameters:
      `oldpw` - The current password
      `newpw` - The password to be assigned to the currently logged-in user
    Throws:
      `TdbException`

  - ### rename

    public void rename(String newname) throws TdbException
    Rename the user.

    This method causes network I/O.

    Parameters:
      `newname` - The new name of the user.
    Throws:
      `TdbException`

  - ### changeMgr

    public void changeMgr(String newmgr, String oldmgr, String name) throws TdbException
    Move objects owned by one user to another user.

    This method causes network I/O.

    Parameters:
      `newmgr` - Name of planned new owner of objects
      `oldmgr` - Name of current owner of objects
      `name` - Name of object to move
    Throws:
      `TdbException`

  - ### changeMgr

    public void changeMgr(String newmgr, String oldmgr) throws TdbException
    Move all objects owned by one user to another user.

    This method causes network I/O.

    Parameters:
      `newmgr` - Name of planned new owner of objects
      `oldmgr` - Name of current owner of objects
    Throws:
      `TdbException`

  - ### changeMgr

    public void changeMgr(String newmgr) throws TdbException
    Move all objects owned by the current user to another user.

    This method causes network I/O.

    Parameters:
      `newmgr` - Name of planned new owner of objects
    Throws:
      `TdbException`

  - ### export

    public void export(String filename, String username, boolean groups) throws TdbException
    Export the definition of the user to a file.

    This method causes network I/O.

    Parameters:
      `filename` - The name of the file to which to write the user's definition
      `username` - The name of the user to export
      `groups` - If true, the user's group membership associations will also be exported
    Throws:
      `TdbException`

  - ### export

    public void export(String filename, boolean groups) throws TdbException
    Export the definition of the user to a file.

    This method causes network I/O.

    Parameters:
      `filename` - The name of the file to which to write the user's definition
      `groups` - If true, the user's group membership associations will also be exported
    Throws:
      `TdbException`

  - ### importUpdate

    public void importUpdate(String filename) throws TdbException
    Update the user's definition from a saved file.

    This method causes network I/O.

    Parameters:
      `filename` - The name of the file from which to read the user's definition
    Throws:
      `TdbException`

  - ### importUser

    public void importUser(String filename, String username, String password) throws TdbException
    Create a new user from a saved definition.

    This method causes network I/O.

    Parameters:
      `filename` - The name of the file containing the saved definition
      `username` - The name of the user to create
      `password` - The password to assign to the new user
    Throws:
      `TdbException`

  - ### copy

    public void copy(String newname, String newpw, boolean groups, TdbControlObject ob) throws TdbException
    Create a new user as a copy of an existing one, optionally including group memberships and private procedures.

    This method causes network I/O.

    Parameters:
      `newname` - The name of the new user to be created
      `newpw` - The password to be assigned to the new user
      `groups` - If set true, group memberships are copied
      `ob` - If not null, the Control object pointed to will be updated with information about the new user upon completion of the operation
    Throws:
      `TdbException`