candy.server
Class ServerApp

java.lang.Object
  |
  +--candy.server.ServerApp

public class ServerApp
extends java.lang.Object

server application for the system interacts with the javaspace for server-side issues like adding/removing users

Author:
Jeremy Mullendore

Field Summary
 Channel channel
          Channel upon which atomic items are received
(package private)  MembershipEventListener membershipListener
           
static java.lang.String SERVER
           
(package private)  MemberStatusEventListener statusListener
           
(package private)  WhiteboardEventListener whiteboardListener
           
 
Constructor Summary
ServerApp()
           
 
Method Summary
 void addUser(java.lang.String ID, java.lang.String first, java.lang.String last, java.lang.String email)
          adds a new Member to the system
 void addWBMember(candy.core.packet.WBMemberJoinPacket wbmjp)
           
 void addWBPacket(candy.core.packet.WBPacket wbp)
          notified from Listener -- add a WBPrimitivePacket to a WB that is in my wboards table
 void addWBPrimitive(candy.core.packet.WBPrimitivePacket wbpp)
           
 void addWhiteboard(Whiteboard wb)
          adds a whiteboard to the list ...
 void createChannel()
          create the Channel
 void createRegistry(java.util.Vector members)
          creates the member registry from a Vector of member objects
 Channel getChannel()
          get the channel
 void killServer()
          killServer -- attempt a graceful server shutdown
 void killWB(candy.core.packet.WBKillPacket wbkp)
           
static void main(java.lang.String[] args)
           
 candyObject read(candyObject tmpl)
          reads a packet of the given template from the JavaSpace
 void removeUser(java.lang.String ID)
          removes a Member from the system
 void removeWBMember(candy.core.packet.WBMemberLeavePacket wbmlp)
           
 void sendOnChannel(candy.core.packet.ChannelPacket p)
           
 void sendWBPTD(candy.core.packet.WBRequestPTD wbptd)
          Locates the WB designated by the WBRequestPTD packet and sends the wb packet list to the requester
 void startReceiving()
          startReceiving invokes a receiver on a transaction channel
 candyObject take(net.jini.core.entry.Entry tmpl)
          takes a packet of the given template from the JavaSpace
 candyObject takeIfExists(net.jini.core.entry.Entry tmpl)
          takes a packet of the given template from the JavaSpace if it Exists
 void write(candyObject p)
          places Entry into javaspace so as to update other users of some change
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVER

public static final java.lang.String SERVER

channel

public Channel channel
Channel upon which atomic items are received

membershipListener

MembershipEventListener membershipListener

statusListener

MemberStatusEventListener statusListener

whiteboardListener

WhiteboardEventListener whiteboardListener
Constructor Detail

ServerApp

public ServerApp()
Method Detail

addWBPacket

public void addWBPacket(candy.core.packet.WBPacket wbp)
notified from Listener -- add a WBPrimitivePacket to a WB that is in my wboards table

addWBPrimitive

public void addWBPrimitive(candy.core.packet.WBPrimitivePacket wbpp)

addWBMember

public void addWBMember(candy.core.packet.WBMemberJoinPacket wbmjp)

removeWBMember

public void removeWBMember(candy.core.packet.WBMemberLeavePacket wbmlp)

killWB

public void killWB(candy.core.packet.WBKillPacket wbkp)

createChannel

public void createChannel()
create the Channel

createRegistry

public void createRegistry(java.util.Vector members)
creates the member registry from a Vector of member objects
Parameters:
members - a Vector containing Member objects (system users)

addUser

public void addUser(java.lang.String ID,
                    java.lang.String first,
                    java.lang.String last,
                    java.lang.String email)
adds a new Member to the system
Parameters:
ID - the screen name of the new Member
name - the given name of the new Member
email - the email address of the new Member

addWhiteboard

public void addWhiteboard(Whiteboard wb)
adds a whiteboard to the list ...

killServer

public void killServer()
killServer -- attempt a graceful server shutdown

removeUser

public void removeUser(java.lang.String ID)
removes a Member from the system
Parameters:
ID - the screen name of the member to be removed

getChannel

public Channel getChannel()
get the channel

read

public candyObject read(candyObject tmpl)
reads a packet of the given template from the JavaSpace
Parameters:
tmpl - The template packet

sendOnChannel

public void sendOnChannel(candy.core.packet.ChannelPacket p)

sendWBPTD

public void sendWBPTD(candy.core.packet.WBRequestPTD wbptd)
Locates the WB designated by the WBRequestPTD packet and sends the wb packet list to the requester

startReceiving

public void startReceiving()
startReceiving invokes a receiver on a transaction channel

take

public candyObject take(net.jini.core.entry.Entry tmpl)
takes a packet of the given template from the JavaSpace
Parameters:
tmpl - The template packet

takeIfExists

public candyObject takeIfExists(net.jini.core.entry.Entry tmpl)
takes a packet of the given template from the JavaSpace if it Exists
Parameters:
tmpl - The template packet

write

public void write(candyObject p)
places Entry into javaspace so as to update other users of some change
Parameters:
p - candyObject

main

public static void main(java.lang.String[] args)