se.entra.phantom.server.rconsole
Class AdminConfigGroups

java.lang.Object
  extended by se.entra.phantom.server.rconsole.AdminConfigGroups

public class AdminConfigGroups
extends Object

Handles the users definition.


Constructor Summary
AdminConfigGroups(String groupID, String data)
          Creates a new user instance from the INI file.
 
Method Summary
static boolean appendChanges(Transaction trans, Hashtable old, StringBuffer buf)
          Adds changes in the group configuration to a transaction.
static void appendSlaveInformation(Transaction trans)
          Gets the transaction data used for newly connected slaves to be updated with all groups in the controller.
static void buildActiveGroupUsers()
          Builds the active groups+users table.
static void edit(VirtualPanel vp)
          Called to edit the dialog box definitions of the groups.
 boolean equals(AdminConfigGroups g)
          Checks if two groups are equal.
 String getDescription()
          Gets the description of the group.
static AdminConfigGroups getGroup(String id)
          Gets the group from an ID.
static String getGroupDescription(String id)
          Gets a description for a group.
 String getGroupID()
          Gets the group ID.
static Enumeration<AdminConfigGroups> getGroups()
          Gets all the groups.
static Enumeration<String> getSortedGroupIDs()
          Gets all the groups IDs sorted alphabetically.
static AdminConfigUser getUserInGroup(String userID, String groupID)
          Gets a user that must belong to a group.
 boolean isActive()
          Checks if the group is active.
static void loadGroupsAndUsers()
          Loads the settings for the web server, users and groups.
static boolean processChanges(Transaction input, Transaction output, StringBuffer buf)
          Processes changes in group information from a remote machine.
static void saveUsersGroups()
          Saves the settings in the 'users.ini' file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdminConfigGroups

public AdminConfigGroups(String groupID,
                         String data)
                  throws IOException
Creates a new user instance from the INI file.

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

loadGroupsAndUsers

public static void loadGroupsAndUsers()
                               throws IOException
Loads the settings for the web server, users and groups.

Throws:
IOException - when an error occurs.

buildActiveGroupUsers

public static void buildActiveGroupUsers()
Builds the active groups+users table.


appendSlaveInformation

public static void appendSlaveInformation(Transaction trans)
Gets the transaction data used for newly connected slaves to be updated with all groups in the controller.


appendChanges

public static boolean appendChanges(Transaction trans,
                                    Hashtable old,
                                    StringBuffer buf)
Adds changes in the group configuration to a transaction.

Returns:
true if there are any changes in the transaction.

processChanges

public static boolean processChanges(Transaction input,
                                     Transaction output,
                                     StringBuffer buf)
Processes changes in group information from a remote machine. A new transaction with changes that might be needed to sent to all other machines connected to this server is also built.

Returns:
true if any changes have been added to the output transaction.

getUserInGroup

public static AdminConfigUser getUserInGroup(String userID,
                                             String groupID)
Gets a user that must belong to a group. The group must be active, but not the user in order to return non-null.

Returns:
null if not found.

getGroups

public static Enumeration<AdminConfigGroups> getGroups()
Gets all the groups.


getSortedGroupIDs

public static Enumeration<String> getSortedGroupIDs()
Gets all the groups IDs sorted alphabetically.


getGroupDescription

public static String getGroupDescription(String id)
Gets a description for a group.

Returns:
null if not found.

saveUsersGroups

public static void saveUsersGroups()
                            throws IOException
Saves the settings in the 'users.ini' file.

Throws:
IOException - when an error occurs.

getGroup

public static AdminConfigGroups getGroup(String id)
Gets the group from an ID.

Returns:
null if not found.

edit

public static void edit(VirtualPanel vp)
Called to edit the dialog box definitions of the groups.


getGroupID

public String getGroupID()
Gets the group ID.


getDescription

public String getDescription()
Gets the description of the group.


isActive

public boolean isActive()
Checks if the group is active.


equals

public boolean equals(AdminConfigGroups g)
Checks if two groups are equal.



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