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 instanceTdbUser(TdbSession session, TdbControlObject ob)
Constructor, creates a user instance for the user referenced by the provided Control object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
changeMgr(java.lang.String newmgr)
Move all objects owned by the current user to another user.void
changeMgr(java.lang.String newmgr, java.lang.String oldmgr)
Move all objects owned by one user to another user.void
changeMgr(java.lang.String newmgr, java.lang.String oldmgr, java.lang.String name)
Move objects owned by one user to another user.void
changePassword(java.lang.String oldpw, java.lang.String newpw)
Change the current user's password.void
clear()
Clear any state established for this objectvoid
copy(java.lang.String newname, java.lang.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(java.lang.String username, java.lang.String password)
Create a new user on the server with the specified credentials.void
delete()
Remove the user from the server.void
delete(java.lang.String username)
Remove a user from the server.void
export(java.lang.String filename, boolean groups)
Export the definition of the user to a file.void
export(java.lang.String filename, java.lang.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(java.lang.String username)
Retrieve the specified user's properties from the server.java.lang.String
getAddress1()
Retrieve the first line of the user's addressjava.lang.String
getAddress2()
Retrieve the second line of the user's addressjava.lang.String
getCompany()
Retrieve the user's company nameint
getDateform()
Retrieve the date format in use by the user; to retrieve the text version of a date format, use theTdbSession.getDateform
methods.java.lang.String
getDateformSep()
Retrieve the separators used when formatting date stringsboolean
getIsFM()
Retrieve the user's FM statusboolean
getIsUM()
Retrieve the user's UM statusjava.lang.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.java.lang.String
getPhoneNumber()
Retrieve the user's phone numberjava.lang.String
getRealName()
Retrieve the user's "real" nameint
getStartModule()
Obsoleteboolean
getUsesBypass()
Check if the user can enter TRIP without providing a password if the server O/S in use supports single sign-onvoid
importUpdate(java.lang.String filename)
Update the user's definition from a saved file.void
importUser(java.lang.String filename, java.lang.String username, java.lang.String password)
Create a new user from a saved definition.void
put()
Update the user's properties on the server.void
put(java.lang.String username)
Update a user's properties on the server.void
rename(java.lang.String newname)
Rename the user.void
resetPassword(java.lang.String password)
Reset the user's password -- can only be accomplished by the system manager.void
setAddress1(java.lang.String address)
Establish the first line of the user's addressvoid
setAddress2(java.lang.String address)
Established the second line of the user's addressvoid
setCompany(java.lang.String name)
Establish the user's company namevoid
setDateform(int dform)
Establish the date format that will be used by the user; to retrieve the text version of a date format, use theTdbSession.getDateform
methods.void
setDateformSep(java.lang.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 uservoid
setIsUM(boolean um)
Modify the user's UM status; this can only successfully be invoked by the SYSTEM uservoid
setLoginProcedure(java.lang.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(java.lang.String number)
Establish the user's phone numbervoid
setRealName(java.lang.String name)
Establish the user's "real" namevoid
setStartModule(int module)
Obsoletevoid
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
-
-
-
-
Constructor Detail
-
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 sessionob
- 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 Detail
-
getRealName
public java.lang.String getRealName()
Retrieve the user's "real" name- Returns:
- The user's real name, if any
-
setRealName
public void setRealName(java.lang.String name)
Establish the user's "real" name- Parameters:
name
- The user's new real name
-
getCompany
public java.lang.String getCompany()
Retrieve the user's company name- Returns:
- The user's company name, if any
-
setCompany
public void setCompany(java.lang.String name)
Establish the user's company name- Parameters:
name
- The user's new company name
-
getAddress1
public java.lang.String getAddress1()
Retrieve the first line of the user's address- Returns:
- The address line, if any
-
setAddress1
public void setAddress1(java.lang.String address)
Establish the first line of the user's address- Parameters:
address
- The first line of the user's new address
-
getAddress2
public java.lang.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(java.lang.String address)
Established the second line of the user's address- Parameters:
address
- The second line of the user's new address
-
getPhoneNumber
public java.lang.String getPhoneNumber()
Retrieve the user's phone number- Returns:
- The user's phone number, if any
-
setPhoneNumber
public void setPhoneNumber(java.lang.String number)
Establish the user's phone number- Parameters:
number
- The user's new phone number
-
getLoginProcedure
public java.lang.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(java.lang.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 java.lang.String getDateformSep()
Retrieve the separators used when formatting date strings- Returns:
- Date separators
-
setDateformSep
public void setDateformSep(java.lang.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 theTdbSession.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 theTdbSession.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(java.lang.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(java.lang.String username, java.lang.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 userpassword
- The password of the new user- Throws:
TdbException
-
delete
public void delete(java.lang.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(java.lang.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(java.lang.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(java.lang.String oldpw, java.lang.String newpw) throws TdbException
Change the current user's password.This method causes network I/O.
- Parameters:
oldpw
- The current passwordnewpw
- The password to be assigned to the currently logged-in user- Throws:
TdbException
-
rename
public void rename(java.lang.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(java.lang.String newmgr, java.lang.String oldmgr, java.lang.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 objectsoldmgr
- Name of current owner of objectsname
- Name of object to move- Throws:
TdbException
-
changeMgr
public void changeMgr(java.lang.String newmgr, java.lang.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 objectsoldmgr
- Name of current owner of objects- Throws:
TdbException
-
changeMgr
public void changeMgr(java.lang.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(java.lang.String filename, java.lang.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 definitionusername
- The name of the user to exportgroups
- If true, the user's group membership associations will also be exported- Throws:
TdbException
-
export
public void export(java.lang.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 definitiongroups
- If true, the user's group membership associations will also be exported- Throws:
TdbException
-
importUpdate
public void importUpdate(java.lang.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(java.lang.String filename, java.lang.String username, java.lang.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 definitionusername
- The name of the user to createpassword
- The password to assign to the new user- Throws:
TdbException
-
copy
public void copy(java.lang.String newname, java.lang.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 creatednewpw
- The password to be assigned to the new usergroups
- If set true, group memberships are copiedob
- If not null, the Control object pointed to will be updated with information about the new user upon completion of the operation- Throws:
TdbException
-
-