live.struts.actions
Class ChangeNetworkMembers

java.lang.Object
  extended byorg.apache.struts.action.Action
      extended bylive.struts.actions.CheckedAction
          extended bylive.struts.actions.SwitchedAction
              extended bylive.struts.actions.ChangeNetworkMembers

public class ChangeNetworkMembers
extends SwitchedAction

Action for changing the members of a network

Author:
Evan Driscoll

Nested Class Summary
 
Nested classes inherited from class live.struts.actions.CheckedAction
CheckedAction.ActionInfo
 
Field Summary
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
ChangeNetworkMembers()
           
 
Method Summary
 org.apache.struts.action.ActionForward displayPage(CheckedAction.ActionInfo info)
          This function is called when a request was submitted by an HTTP GET request.
 org.apache.struts.action.ActionForward performAction(CheckedAction.ActionInfo info)
          This function is called when a request was submitted by an HTTP POST request.
private  void tellThreadAboutConnections(HashSet users, CheckedAction.ActionInfo info, Runner runner, String netName, ThreadedZVMTasks.FindCommonFreeAddress addySource)
          This thread adds a connection request for everyone who isn't connected and should be.
private  void tellThreadAboutDisconnections(HashSet users, CheckedAction.ActionInfo info, Runner runner, String netName)
          This thread adds a detach request for everyone who is connected and shouldn't be
 
Methods inherited from class live.struts.actions.SwitchedAction
act
 
Methods inherited from class live.struts.actions.CheckedAction
execute
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeNetworkMembers

public ChangeNetworkMembers()
Method Detail

displayPage

public org.apache.struts.action.ActionForward displayPage(CheckedAction.ActionInfo info)
Description copied from class: SwitchedAction
This function is called when a request was submitted by an HTTP GET request. Implement this in subclasses to display a page where the user can enter any information necessary to actually do something, confirm that they want to actually do something, etc.

Specified by:
displayPage in class SwitchedAction
Parameters:
info - The request info passed to SwitchedAction.act(CheckedAction.ActionInfo)
Returns:
The forward to go to
See Also:
SwitchedAction.displayPage(live.struts.actions.CheckedAction.ActionInfo)

performAction

public org.apache.struts.action.ActionForward performAction(CheckedAction.ActionInfo info)
Description copied from class: SwitchedAction
This function is called when a request was submitted by an HTTP POST request. This function should actually perform whatever action the user wanted. You should probably strive to make it so that the URL that calls this action can only be POSTed to from the page displayed by SwitchedAction.displayPage(CheckedAction.ActionInfo) so that you know that the user is coming from that page.

Specified by:
performAction in class SwitchedAction
Parameters:
info - The request info passed to SwitchedAction.act(CheckedAction.ActionInfo)
Returns:
The forward to go to
See Also:
SwitchedAction.performAction(live.struts.actions.CheckedAction.ActionInfo)

tellThreadAboutConnections

private void tellThreadAboutConnections(HashSet users,
                                        CheckedAction.ActionInfo info,
                                        Runner runner,
                                        String netName,
                                        ThreadedZVMTasks.FindCommonFreeAddress addySource)
This thread adds a connection request for everyone who isn't connected and should be.

Parameters:
users - HashSet of guest names to connect.
info - Action information for this action.
runner - What we use to schedule the thread.
netName - Network name to connect people to.
addySource - The lowest common free address for all the members we're adding to the network

tellThreadAboutDisconnections

private void tellThreadAboutDisconnections(HashSet users,
                                           CheckedAction.ActionInfo info,
                                           Runner runner,
                                           String netName)
This thread adds a detach request for everyone who is connected and shouldn't be

Parameters:
users - HashSet of guest names to detach.
info - Action information.
runner - What we need to schedule this thread.
netName - Name of network to detach from.


Copyright © 2005