se.entra.phantom.server.rconsole
Class AdminConfigUser

java.lang.Object
  extended by se.entra.phantom.server.VirtualPanelAdapter
      extended by se.entra.phantom.server.VirtualComponentAdapter
          extended by se.entra.phantom.server.rconsole.AdminConfigUser
All Implemented Interfaces:
Cloneable, VirtualComponentListener, VirtualPanelListener

public class AdminConfigUser
extends VirtualComponentAdapter
implements Cloneable

Handles a user definition.


Field Summary
 
Fields inherited from interface se.entra.phantom.server.VirtualPanelListener
ICON_CRITICAL, ICON_INFORMATION, ICON_NOICON, ICON_QUERY, ICON_QUESTION, ICON_WARNING, MB_ABORTRETRYIGNORE, MB_CANCEL, MB_ENTER, MB_ENTERCANCEL, MB_OK, MB_OKCANCEL, MB_RETRYCANCEL, MB_YESNO, MB_YESNOCANCEL, MBID_CANCEL, MBID_DEFAULT, MBID_ENTER, MBID_IGNORE, MBID_NO, MBID_OK, MBID_RETRY, MBID_YES
 
Constructor Summary
AdminConfigUser()
          Creates a new user instance.
AdminConfigUser(AdminConfigUser original)
          Creates a new user copy.
AdminConfigUser(String userID, String data)
          Creates a new user from a string in the INI file.
AdminConfigUser(Transaction trans)
          Creates a new user from a transaction.
 
Method Summary
 void addInvalidLogin(String source)
          Adds a new invalid login for this user.
 void appendSlaveInformation(Transaction trans)
          Gets the transaction data used for informing slaves of changes for this user.
static AdminConfigUser changeUserFromController(Transaction trans, String issuingServer)
          Changes the group table to reflect changes from a controller computer.
 void edit(VirtualSessionManager vsm, VirtualComponentAdapter parent)
          Starts editing the dialog box.
 boolean equals(AdminConfigUser u)
          Checks if a user defintion is equal to another one.
 AdminConfigUser getCopy()
          Clones this entry.
 byte[] getDigestA1(String userName, String realm)
          Gets the Digest A1 byte array (MD5) for a user ID used in WWW-authentication.
 Hashtable getGlobalVariables(String profileName)
          Gets the Global Variables for a SecureLogin profile.
 Hashtable getGroups()
          Get the groups the user is member of.
 String getListBoxString()
          Gets the users list box string.
 int getLoginRetryCount()
          Gets the login retry count for this user (0=unlimited).
 String getPassword()
          Gets the password for a user that has not group assigned to it or if it is inactive (a password user).
 Hashtable getSessionVariables(String profileName)
          Gets the HTTP session variables for a SecureLogin profile.
 String getUserID()
          Gets the user ID.
 boolean isActive()
          Checks if a user is active.
 boolean isGroupMember(String groupID)
          Checks if a user is a member of a group.
 boolean isPasswordChangeRequired()
          Checks if the user requires the password to be changed.
 boolean isPasswordMatching(String password, String source)
          Checks if a password is matching.
 boolean isPasswordUser()
          Checks if this user has not group assigned to it or if it is inactive.
 boolean isPhoneNumberRegistered(String number)
          Checks if this phone number is one of the registered ones for the user.
 boolean isPinCodeMatching(String pinCode)
          Checks if the pin code matches.
 void onAction(VirtualPanel vp, String controlID)
          Push buttons and menu items generates this event when selected.
 void onCheckedChange(VirtualPanel vp, VirtualControl control, String controlID, int state)
          Check boxes and radio buttons generates this event when state is changed on the client side.
 boolean onPanelClosing(VirtualPanel vp)
          Called when the close button of a panel is pressed, but before any other processing has been done.
 void onSelectionChanged(VirtualPanel vp, VirtualCListBox list, String controlID, int line, int column)
          List boxes generates this message.
 void resetInvalidLogin()
          Resets the bad login count.
 void setItem(IniFile ini)
          Sets the item in the ini file.
 void setNewPassword(String password)
          Sets a new password.
 
Methods inherited from class se.entra.phantom.server.VirtualComponentAdapter
onAction, onAction, onContentChanged, onContentChanged, onControlEvent, onFocusGained, onFocusLost, onMenuAction, onPropertyChange
 
Methods inherited from class se.entra.phantom.server.VirtualPanelAdapter
onModalPanelCreate, onModalPanelProcessing, onPageActivated, onPanelClose, onPanelCreate, onPanelDestroy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface se.entra.phantom.server.VirtualPanelListener
onPageActivated, onPanelClose, onPanelCreate, onPanelDestroy
 

Constructor Detail

AdminConfigUser

public AdminConfigUser()
Creates a new user instance.


AdminConfigUser

public AdminConfigUser(AdminConfigUser original)
Creates a new user copy.


AdminConfigUser

public AdminConfigUser(Transaction trans)
                throws IOException
Creates a new user from a transaction.

Throws:
IOException - when the data doesn't have the correct format.

AdminConfigUser

public AdminConfigUser(String userID,
                       String data)
                throws IOException
Creates a new user from a string in the INI file.

Throws:
IOException - when the data doesn't have the correct format.
Method Detail

getCopy

public AdminConfigUser getCopy()
Clones this entry.


getUserID

public String getUserID()
Gets the user ID.


isActive

public boolean isActive()
Checks if a user is active.


isGroupMember

public boolean isGroupMember(String groupID)
Checks if a user is a member of a group.


isPinCodeMatching

public boolean isPinCodeMatching(String pinCode)
Checks if the pin code matches.


isPhoneNumberRegistered

public boolean isPhoneNumberRegistered(String number)
Checks if this phone number is one of the registered ones for the user.


getLoginRetryCount

public int getLoginRetryCount()
Gets the login retry count for this user (0=unlimited).


addInvalidLogin

public void addInvalidLogin(String source)
Adds a new invalid login for this user.


resetInvalidLogin

public void resetInvalidLogin()
Resets the bad login count.

Calls to this method should synchronize on the user.


isPasswordUser

public boolean isPasswordUser()
Checks if this user has not group assigned to it or if it is inactive.


getPassword

public String getPassword()
Gets the password for a user that has not group assigned to it or if it is inactive (a password user).

Returns:
null if the user is not a valid user.

isPasswordMatching

public boolean isPasswordMatching(String password,
                                  String source)
Checks if a password is matching.


isPasswordChangeRequired

public boolean isPasswordChangeRequired()
Checks if the user requires the password to be changed.


setNewPassword

public void setNewPassword(String password)
Sets a new password.


setItem

public void setItem(IniFile ini)
Sets the item in the ini file.


getDigestA1

public byte[] getDigestA1(String userName,
                          String realm)
                   throws IOException
Gets the Digest A1 byte array (MD5) for a user ID used in WWW-authentication.

Returns:
byte [] - the digested userName:realm:password as defined in the HTTP 1.1 specification.
Throws:
IOException - for failure.

edit

public void edit(VirtualSessionManager vsm,
                 VirtualComponentAdapter parent)
Starts editing the dialog box.


getListBoxString

public String getListBoxString()
Gets the users list box string.


onPanelClosing

public boolean onPanelClosing(VirtualPanel vp)
Called when the close button of a panel is pressed, but before any other processing has been done. If this function returns false, the application close object will be called (if defined), otherwise a faked keypress of the Escape key is performed. If these two actions failed (because there is no close object or no button or menu item is connected to the Escape key), then the function onPanelClose is called.

Specified by:
onPanelClosing in interface VirtualPanelListener
Overrides:
onPanelClosing in class VirtualPanelAdapter
Returns:
true to cancel all default processing.
See Also:
VirtualPanelAdapter.onPanelClose(se.entra.phantom.server.VirtualPanel)

onAction

public void onAction(VirtualPanel vp,
                     String controlID)
Push buttons and menu items generates this event when selected.

Overrides:
onAction in class VirtualComponentAdapter

onSelectionChanged

public void onSelectionChanged(VirtualPanel vp,
                               VirtualCListBox list,
                               String controlID,
                               int line,
                               int column)
List boxes generates this message. The line and column parameter are individually set to -1 if no line or column is selected respectively.

Specified by:
onSelectionChanged in interface VirtualComponentListener
Overrides:
onSelectionChanged in class VirtualComponentAdapter

onCheckedChange

public void onCheckedChange(VirtualPanel vp,
                            VirtualControl control,
                            String controlID,
                            int state)
Check boxes and radio buttons generates this event when state is changed on the client side.

The state is 0=unchecked, 1=checked and 2=third state (only for check boxes, or PhantomCCheckBox.STATE_UNDETERMINED).

Specified by:
onCheckedChange in interface VirtualComponentListener
Overrides:
onCheckedChange in class VirtualComponentAdapter

getGroups

public Hashtable getGroups()
Get the groups the user is member of.


getSessionVariables

public Hashtable getSessionVariables(String profileName)
Gets the HTTP session variables for a SecureLogin profile.


getGlobalVariables

public Hashtable getGlobalVariables(String profileName)
Gets the Global Variables for a SecureLogin profile.


appendSlaveInformation

public void appendSlaveInformation(Transaction trans)
Gets the transaction data used for informing slaves of changes for this user.


changeUserFromController

public static AdminConfigUser changeUserFromController(Transaction trans,
                                                       String issuingServer)
Changes the group table to reflect changes from a controller computer.

Returns:
null for failure.

equals

public boolean equals(AdminConfigUser u)
Checks if a user defintion is equal to another one.



Phantom® and NetPhantom® are registered trademarks of Codectica Systems SARL.
© Copyright Codectica Systems SARL, 2008. All rights reserved.