Synergy Home Page

au.edu.swin.synergy.plugin.syndicate
Class BSyndServer

java.lang.Object
  |
  +--au.edu.swin.synergy.kernel.BPlugin
        |
        +--au.edu.swin.synergy.plugin.syndicate.BSyndServer

public class BSyndServer
extends BPlugin

This class provides the syndicate server. To load type: load au.edu.swin.synergy.plugin.syndicate.BSyndServer


Inner Class Summary
 class BSyndServer.BConnectionComplete
          This completion class responds to the return of a BSQLGetConnectionCE event.
 
Field Summary
protected  Connection connection
          The database connection.
protected  SimpleDateFormat dateFormat
          Formatter used for doing dates "properly"
protected static String kDBURL
          The database URL.
protected  Hashtable userMap
          User information (mapping usernames to ID heirachies).
 
Fields inherited from class au.edu.swin.synergy.kernel.BPlugin
kernel
 
Constructor Summary
BSyndServer()
          Creates a new BSyndServer object.
 
Method Summary
 void doAddTask(BSyndAddTaskCE taskEvent)
          Adds a task to the syndicate database.
protected  void doGetTasks(BSyndGetTasksCE taskEvent)
          Gets a list of tasks according to the parameters in event, and returns the tasks in the completion event.
protected  void doLogEntry(BSyndAddLogCE logEvent)
          Adds a log entry to the database, and sends a confirmation completion status.
protected  void findParents(int userIndex, Vector userIDs, Vector parentIDs, Vector result)
          Finds a "tree" of parents for a given user.
protected  void getUserInfo()
          Fills the user map with dat from the database.
 void onBCommandEvent(Object sender, BCommandEvent event)
          This method receives events from the kernel.
 void setup(BStringList params)
          This method is called when the kernel is loading the plugins
 
Methods inherited from class au.edu.swin.synergy.kernel.BPlugin
dispatchEvent, dispatchEventAndWait, dispatchEventServer, dispatchEventServerAndWait, dispatchEventTo, dispatchEventToAndWait, getDependancies, getKernel, setKernel, setup, unload
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

kDBURL

protected static String kDBURL
The database URL.

connection

protected Connection connection
The database connection.

userMap

protected Hashtable userMap
User information (mapping usernames to ID heirachies).

dateFormat

protected SimpleDateFormat dateFormat
Formatter used for doing dates "properly"
Constructor Detail

BSyndServer

public BSyndServer()
Creates a new BSyndServer object.
Method Detail

setup

public void setup(BStringList params)
This method is called when the kernel is loading the plugins
Overrides:
setup in class BPlugin

onBCommandEvent

public void onBCommandEvent(Object sender,
                            BCommandEvent event)
This method receives events from the kernel.
Parameters:
sender - The object that generated the event.
event - The event itself.
Overrides:
onBCommandEvent in class BPlugin

doGetTasks

protected void doGetTasks(BSyndGetTasksCE taskEvent)
Gets a list of tasks according to the parameters in event, and returns the tasks in the completion event.
Parameters:
taskEvent - The get tasks event.

doLogEntry

protected void doLogEntry(BSyndAddLogCE logEvent)
Adds a log entry to the database, and sends a confirmation completion status.
Parameters:
logEvent - The event describing the log entry.

doAddTask

public void doAddTask(BSyndAddTaskCE taskEvent)
Adds a task to the syndicate database.
Parameters:
taskEvent - The task addition event.

getUserInfo

protected void getUserInfo()
Fills the user map with dat from the database.

findParents

protected void findParents(int userIndex,
                           Vector userIDs,
                           Vector parentIDs,
                           Vector result)
Finds a "tree" of parents for a given user. The first element is the userID of the user, then its parent, then its parent's parent, and so on. Called Recursively.
Parameters:
userID - The index into userIDs of the user we want the tree for.
userIDs - A Vector of Integers, containing all userIDs.
parentIDs - A Vector of Integers, containing all parentIDs for each of the userIDs.
result - The result vector (of Integers) containing all parents of userID, this should be cleared before function is called.

Synergy Home Page