This site hosted by Free.ProHosting.com
Google

 

 

 

 

 

                    Collaborative Tool             

 

Initial Software Architecture and

Design

 

 

 


 

Table of Contents

 

Table of Contents. iii

List of Figures. v

1.0       System Layering and Distribution. 2

1.1       System Overview.. 2

1.2       Sub-Module Mappings. 3

2.0       Module Interfaces. 5

2.1       amc Package. 5

2.1.1        Interface AMCClient.ChannelListenerI 5

2.1.2        Class AMCClient.HandleResponse. 5

2.1.3        Class AMCClient 6

2.1.4        Class AMCDriver 9

2.1.5        Class AMCServer 10

2.1.6        Class Buffer 13

2.1.7        Class Channel 14

2.1.8        Class ClientConn.HandleRequest 15

2.1.9        Class ClientConn. 16

2.1.10  Class ClientStub. 17

2.1.11  Class Server 18

2.2       authentication Package. 19

2.2.1        Class AuthenticationClient 19

2.2.2        Class AuthenticationServer 21

2.3       client Package. 24

2.3.1        Class ApplicationClient 24

2.3.2        Class Client 25

2.4 datainfo Package. 26

2.4.1        Class DocumentInfo. 26

2.4.2        Class ParticipantInfo. 29

2.4.3        Class ProjectInfo. 32

2.4.4        Class TranscriptInfo. 35

2.4.5        Class TranscriptMessage. 37

2.5       directory Package. 39

2.5.1        Class DirectoryClient 39

2.5.2        Class DirectoryException. 42

2.5.3        Class DirectoryNode. 43

2.5.4        Class DirectoryServer 46

2.5.5        Class DirectoryStructure. 48

2.6       gui Package. 52

2.6.1        Class ClientGUI 52

2.6.2        Class ClientGUIControl 56

2.6.3        Class DiscussionView.. 57

2.6.4        Class DocumentView.. 58

2.6.5        Class LoginDialog. 59

2.6.6        Class MainStatusBar 60

2.6.7        Class ProjectView.. 61

2.6.8        Class ViewSelectionPane. 62

2.7       persistentStorage Package. 63

2.7.1        Class ProjectStore. 63

2.7.2 Class PersistentStoreClient 65

2.7.3        Class PersistentStoreServer 66

2.8       project Package. 67

2.8.1        Class ProjectClient 67

2.8.2        Class ProjectServer 71

2.9       rpc Package. 76

2.9.1        Class Decode. 76

2.9.2        Class Encode. 78

2.10     server Package. 81

2.10.1      Class ApplicationServer 81

2.10.2      Class Server 83

2.10.3      Class ServerGUI 85

2.11     Session. 88

2.11.1      Class Session. 88

2.11.2      Class SessionManagerClient 92

2.11.3      Class SessionManagerServer 95

3.0       Persistent Data and Communication. 98

3.1       Remote Procedure Call Mechanism.. 98

3.2       Persistent Storage. 100

3.3       Directory. 100

4.0       User Interface. 103

5.0       Interaction Diagrams. 109

5.1       General RPC Request 109

5.2       General RPC Response. 110

5.3       Create Account – Directory and Persistent Store Interaction. 111

5.4       Create Account 112

5.5       Create Project 113

Appendix A: Code Roadmap. vi

Appendix B: Procedures for Compilation and Execution........................................................ ix

Meeting Minutes. x


List of Figures

 

Figure 1 Component Model Diagram.. 2

Figure 2 Sub-Modules (Client/Server) 3

Figure 3 Login Example. 2

Figure 4 Usage of the directory structure. 2

Figure 5 Static Class Diagram for the Directory Package. 2

Figure 6 General RPC Request Interaction Diagram.. 106

Figure 7 General RPC Response Interaction Diagram.. 107

Figure 8 Create Account – Directory and Persistent Store Interaction Diagram.. 108

Figure 9 Create Account Interaction Diagram.. 109

Figure 10 Create Project Interaction Diagram.. 110


 


1.0   System Layering and Distribution

 

1.1     System Overview

 

This section includes two diagrams that indicate the overall layered architecture of the Collaborative Tool. Figure 1 below outlines the basic system architecture showing the software layers and separation. Also shown are the interconnections between the modules that make up the server side Application Layer.


Figure 1 Component Model Diagram

 

 The AMCC module will provide the transport mechanism for all messages and data that flow between the client and server side of the system. It will be isolated from the system via the RPC (Remote Procedure Call) module which will coordinate signaling and data marshalling. Refer to section 3.1 for details regarding the RPC. Further isolation is achieved using the Application Logic Stub. This stub will contain the client stubs for all of the modules that are accessible on the client side of the application.

 

 

1.2     Sub-Module Mappings


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Figure 2 Sub-Modules (Client/Server)

 

Client registers processRequest()

Server registers processResponse()

 


Overview

 

The mapping model of the major modules to client/server nodes is shown in Figure 2. In this model, each of the major modules that provides an essential service are mapped into a service client node and a service server node. Both the service client and server are actual clients of the underlying AMC Server, which manages the lower level channels and message conveyance between channels.

 

To call functions of a particular module such as the Persistent Store, the calling module first declares a Persistent Store Client. The Persistent Store Client is then used for making the function calls. The Persistent Store Server, which is started in the beginning of the program, processes the request, and returns the response back to the Persistent Store Client. The Persistent Store Client then forwards the response back to the calling module.

 

Login Example

 

To further illustrate the architecture above, we will look at the Login service of the Authentication Module. The Authentication Client is called when Login service is required. The Authentication Client then sends the Login request to the Authentication Server, which is started initially at the start of the program. The Authentication Server owns a Directory Client and a Persistent Store Client. The Authentication Server calls the Directory Client to retrieve a key, and uses this key to retrieve the ParticipantInfo through the Persistent Store Client. Both the Directory Client and Persistent Store Client send the request to the Directory Server and Persistent Store Server respectively in a similar fashion. When the responses comes back, the Authentication Server verifies the Login info of the client and returns a true or false response back to the Authentication Client. The Authentication Client in term returns this response to the module that requested it, e.g., the GUI module. The Login service interaction of the Authentication Module is shown in Figure 3 below.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Figure 3 Login Example

 

In terms of the channel, the Authentication Client first gets itself a free channel from the AMS Server to use as a return channel. The Authentication Client sends the request along with the return channel to the Authentication Server via a previously defined Authentication channel, and the response comes back through the return channel to the Authentication Client.

 

Login uses a synchronous response mechanism, that is, the function call on the service client waits for the response to come back from the service server. For asynchronous responses, such as message sending in a Session, the Session Server uses the Session channel, which is pre-registered with the Session Manager, to distribute a message to all listening Session Clients.

 

Mapping Implications

 

A further note about the sub-modules mapping is that in such a setup, some modules may theoretically live on separate servers, since they are decoupled and distributed. For example, the persistent storage may live on a file server with large storage capacity. But it is important to note that there is only a single Persistent Storage Server in the system, this architecture avoids data duplication and other access control issues.

 

 

Information Handling Between Layers

 

The CT is designed as a layered architecture. For information to flow from upper layers to lower layers, traditional function call mechanisms are used. That is, upper layers call lower layer functions with the appropriate parameters as required.

 

For information to flow from lower layers to upper layers a callback mechanism is used. This is because a standard layered architecture should structure the levels such that lower levels are unaware of upper levels. In order to set up the callback mechanism, four elements are required:

 

 


For example, both the service client and service server use the callback mechanism. The service server listens on a its service channel and registers the processRequest() callback handler. When an event comes from the channel, processRequest() is invoked with the calling parameters. The service client then listens on its return channel, and registers the processResponse() callback handler. When an event comes from the return channel, processResponse() is invoked. See Figure *** below for the data flow between the Service Server and Client as well as the underlying AMC Server.

 

 

 

 

 

 

 

 




 

 

 

 

 

 

           

The callback mechanism is particularly useful for asynchronous events such as message transmission from participants in a chat session. This message needs to be distributed asynchronously to all participants within the same session.


2.0   Module Interfaces

 

2.1     amc Package


2.1.1  Interface AMCClient.ChannelListenerI

 

Enclosing interface:

AMCClient

 

public static interface AMCClient.ChannelListenerI

The object that wants to receive input from a channel must implement this interface.


Method Summary

 void

receive(java.lang.String data)
          Called when the AMCC receives input for that objects channel.

 

Method Detail

receive

public void receive(java.lang.String data)

Called when the AMCC receives input for that objects channel.


2.1.2  Class AMCClient.HandleResponse

 

All Implemented Interfaces:

Connection.ReceiverI

Enclosing class:

AMCClient

 

class AMCClient.HandleResponse

extends java.lang.Object

implements Connection.ReceiverI


Constructor Summary

(package private)

AMCClient.HandleResponse()
           

 

Method Summary

 void

receive(java.lang.String data)
          Delivers incoming transport frame.

 

Constructor Detail

AMCClient.HandleResponse

AMCClient.HandleResponse()

Method Detail

receive

public void receive(java.lang.String data)

Description copied from interface: Connection.ReceiverI

Delivers incoming transport frame.

Specified by:

receive in interface Connection.ReceiverI

Parameters:

data - incoming data from network.


2.1.3  Class AMCClient

 

public class AMCClient

extends java.lang.Object

The EECE 419 Asynchronous Multicast Component Client (AMCC).

The AMCC Client connects to an AMCC server. The client has six commands:



 


Constructor Summary

AMCClient(java.lang.String host)
          Create an AMCC Client.

 

AMCClient(java.lang.String host, int port)
          Create an AMCC Client.

 

 

Method Summary

 void

attach()
          Attach a client to the AMCC service.

 void

detach()
          Drop the connection to the AMC server.

 int

getFreeChannel()
          Get an unused channel.

 void

listen(int channel, AMCClient.ChannelListenerI chListenerI)
          Sets up a receiver for input from the given channel.

 void

send(int chNumber, java.lang.String data)
          Send data to a channel.

 void

unlisten(int channel)
          Stops reception from a channel.

 

Constructor Detail

AMCClient

public AMCClient(java.lang.String host,
                 int port)

Create an AMCC Client.

Parameters:

host - host name of server

port - port of server


AMCClient

public AMCClient(java.lang.String host)

Create an AMCC Client. Server port will default to AMCServer.DEFAULT_SERVER_PORT.

Parameters:

host - host name of server

 

Method Detail

attach

public void attach()

Attach a client to the AMCC service. The attach opens a connection to the server which is then subsequently used by all the AMC commands.


detach

public void detach()

Drop the connection to the AMC server. No further AMC commands can be issued after this.


listen

public void listen(int channel,
                   AMCClient.ChannelListenerI chListenerI)

Sets up a receiver for input from the given channel.

Parameters:

channel - channel number to listen on

chListenerI - reference to object that will listen on an interface.


unlisten

public void unlisten(int channel)

Stops reception from a channel.

Parameters:

channel - - channel number to stop listening on.


getFreeChannel

public int getFreeChannel()

Get an unused channel. Channel returned is in the range 256 to 231-1.


send

public void send(int chNumber,
                 java.lang.String data)

Send data to a channel.

Parameters:

chNumber - channel number to send data to

data - data to be sent to the channel



2.1.4  Class AMCDriver

 

class AMCDriver

extends java.lang.Object

The EECE 419 Asynchronous Multicast Component Client.

This class is used to perform a simple unit test on the AMC. The starts an AMCServer on the local host and uses a loopback connection to test the AMC service.


Constructor Summary

(package private)

AMCDriver()
           

 

Method Summary

static void

main(java.lang.String[] args)
           

(package private) static void

pause(int ms)
           

 

Constructor Detail

AMCDriver

AMCDriver()

Method Detail

pause

static void pause(int ms)

main

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



 


2.1.5  Class AMCServer

 

public class AMCServer

extends java.lang.Object

The EECE 419 Asynchronous Multicast Component Server (AMCC).

The AMCC Server accepts connections from AMCC clients and multicasts frames to all clients listening on the same channel.

The server accepts six commands from its AMCC clients:


 

Constructor Summary

AMCServer()
          Create an AMCC Server object using default server port.

 

AMCServer(int port)
          Create an AMCC Server object and set the port it should listen on.

 

 

Method Summary

 void

close()
          This method shuts down the AMC Server connections and listener.

 void

connectionState()
          This method provides a snapshot of current connections and channel state.

(package private)  void

detach(ClientConn conn)
          This routine is called to disconnect a client from the multicasting environment.

(package private)  void

dispatch(ClientConn conn, java.lang.String data)
           

(package private)  void

getFreeChannel(ClientConn conn)
          This method returns a channel for which there are no listeners.

 void

initialize()
          This routine is called to start up the AMCC listener.

(package private)  void

listen(ClientConn conn, java.lang.String data)
          This is called when a client wants to listen on a channel.

(package private)  void

send(java.lang.String data)
          Send is called to send a frame on a channel.

 void

setPort(int port)
          Set the port the server should listen on.

(package private)  void

unlisten(ClientConn conn, java.lang.String data)
          This method may be called to stop listening on a channel.

 

Constructor Detail

AMCServer

public AMCServer()

Create an AMCC Server object using default server port. To complete initialization you need to call initialize().


AMCServer

public AMCServer(int port)

Create an AMCC Server object and set the port it should listen on. To complete initialization you need to call initialize().

Parameters:

port - - port to listen on

Method Detail

setPort

public void setPort(int port)

Set the port the server should listen on.

Parameters:

port - - port to listen on


initialize

public void initialize()

This routine is called to start up the AMCC listener.


dispatch

void dispatch(ClientConn conn,
              java.lang.String data)

send

void send(java.lang.String data)

Send is called to send a frame on a channel. The server extracts the channel number and sends a copy to all listeners on that channel.

Parameters:

data - - information to be sent to clients listening on the channel.


listen

void listen(ClientConn conn,
            java.lang.String data)

This is called when a client wants to listen on a channel. The channel is extracted and any future frames for that channel are forwarded to that client.

Parameters:

conn - - a reference to the object that is going to accept the incoming frames, namely a reference to the client connection requesting to listen on the channel.

data - - a string with the channel to listen to embedded.


unlisten

void unlisten(ClientConn conn,
              java.lang.String data)

This method may be called to stop listening on a channel.

Parameters:

conn - - client connection that is dropping the connection.

data - - String that should include the channel to unlisten.


getFreeChannel

void getFreeChannel(ClientConn conn)

This method returns a channel for which there are no listeners. The channel will be in the range 256 to 231-1. It uses a random number generator to find an unused channel.


detach

void detach(ClientConn conn)

This routine is called to disconnect a client from the multicasting environment.

Parameters:

conn - - client to disconnect.


close

public void close()

This method shuts down the AMC Server connections and listener. Added with Version 1.1.


connectionState

public void connectionState()

This method provides a snapshot of current connections and channel state. It is useful in debugging.


2.1.6  Class Buffer

 

public class Buffer

extends java.lang.Object

This class is used to synchronize the response from an RPC call. It uses a simple one item producer consumer buffer.


 

Constructor Summary

Buffer()
           

 

 

Method Summary

 void

add(java.lang.Object o)
          This method is called by the result from an RPC.

 java.lang.Object

remove()
          This method is called by the real routine to get its result.

 


item

java.lang.Object item

Constructor Detail

Buffer

public Buffer()

Method Detail

add

public void add(java.lang.Object o)

This method is called by the result from an RPC.

Parameters:

o - item to be returned


remove

public java.lang.Object remove()

This method is called by the real routine to get its result.


2.1.7  Class Channel

 

class Channel

extends java.lang.Object

The Channel class encapsulates a channel. It keeps track of its number and the physical connections listening to the channel.


Constructor Summary

(package private)

Channel(int chNumber)
           

 

Method Summary

(package private)  void

addConnection(ClientConn conn)
           

(package private)  void

deleteConnection(ClientConn conn)
           

(package private)  int

getChannelNumber()
           

(package private)  boolean

hasNoListeners()
           

(package private)  void

listConnections()
           

(package private)  void

send(java.lang.String data)
           

 



2.1.8  Class ClientConn.HandleRequest

 

All Implemented Interfaces:

Connection.ReceiverI

Enclosing class:

ClientConn

 

class ClientConn.HandleRequest

extends java.lang.Object

implements Connection.ReceiverI


Constructor Summary

(package private)

ClientConn.HandleRequest()
           

 

Method Summary

 void

receive(java.lang.String data)
          Delivers incoming transport frame.

  
 

Method Detail

receive

public void receive(java.lang.String data)

Description copied from interface: Connection.ReceiverI

Delivers incoming transport frame.

Specified by:

receive in interface Connection.ReceiverI

Parameters:

data - incoming data from network.



2.1.9  Class ClientConn

 

All Implemented Interfaces:

Connection.ReceiverI

 

class ClientConn

extends java.lang.Object

implements Connection.ReceiverI

The ClientConn class encapsulates a client connection. It keeps track of all the channels the client is listening to.


 

Constructor Summary

(package private)

ClientConn(Connection conn, AMCServer server)
           

 

Method Summary

(package private)  void

addChannelListener(Channel channel)
           

(package private)  void

close()
           

(package private)  java.util.List

getChannelList()
           

(package private)  void

listChannels()
           

 void

receive(java.lang.String data)
          Delivers incoming transport frame.

(package private)  void

send(java.lang.String data)



2.1.10  Class ClientStub

 

Direct Known Subclasses:

SessionClient

 

public abstract class ClientStub

extends java.lang.Object

Client Stub template for all stubs in CT.


 

Constructor Summary

ClientStub(AMCClient client, int channel)
          Creates new ClientStub

 

 

Method Summary

protected  int

getReturnChannel()
           

protected  int

getServiceChannel()
           

protected abstract  void

processResponse(java.lang.String response)
           

  



2.1.11  Class Server

 

Direct Known Subclasses:

SessionServer

 

public abstract class Server

extends java.lang.Object

Server Template for all servers in CT


 

Constructor Summary

Server(int channel)
          Creates a server for the given AMCClient and channel.

 

Server(java.lang.String host, int port, int channel)
          Creates new Server

 

 

Method Summary

protected abstract  void

processRequest(java.lang.String request)
           

 


2.2     authentication Package


2.2.1  Class AuthenticationClient

 

public class AuthenticationClient

extends Client

Client for the Authentication Module - Any class who wants to have access to the Authentication Module will instantiate this class.


Constructor Summary

AuthenticationClient(AMCClient client)
          Constructs an AuthenticationClient object with the specified AMC client and default channel.

 

AuthenticationClient(AMCClient client, int channel)
          Constructs an AuthenticationClient object with the specified AMC client and channel.

 

 

Method Summary

 boolean

createAccount(java.lang.String userID, java.lang.String password)
          Creates a new user account.

 boolean

login(java.lang.String userID, java.lang.String password)
          Logs in a user.

 void

logout(java.lang.String userID)
          Logs out a user.

protected  void

processResponse(java.lang.String response)
          Processes RPC encoded response.

 

Constructor Detail

AuthenticationClient

public AuthenticationClient(AMCClient client)

Constructs an AuthenticationClient object with the specified AMC client and default channel.

Parameters:

client - AMC client to be specified.


AuthenticationClient

public AuthenticationClient(AMCClient client,
                            int channel)

Constructs an AuthenticationClient object with the specified AMC client and channel.

Parameters:

client - AMC client to be specified.

channel - desired channel.

Method Detail

processResponse

protected void processResponse(java.lang.String response)

Processes RPC encoded response.

Specified by:

processResponse in class Client

Parameters:

response – encoded callback response.


createAccount

public boolean createAccount(java.lang.String userID,
                             java.lang.String password)

Creates a new user account.

Parameters:

userID - user/participant ID.

password - password to confirm the user ID.

Returns:

true if account is sucessfully created, false otherwise.


login

public boolean login(java.lang.String userID,
                     java.lang.String password)

Logs in a user.

Parameters:

userID - user/participant ID.

password - password to confirm the user ID.

Returns:

true if user sucessfully logs in, false otherwise.



logout

public void logout(java.lang.String userID)

Logs out a user.

Parameters:

userID - user/participant ID.


2.2.2  Class AuthenticationServer

 

public class AuthenticationServer

extends Server

Server for the Authentication Application Logic - It provides services to every Authentication Client.


Constructor Summary

AuthenticationServer()
          Constructs an AuthenticationServer object.

AuthenticationServer(int channel)
          Constructs an AuthenticationServer object with the specific channel and default port and host.

AuthenticationServer(java.lang.String host, int port, int channel)
          Constructs an AuthenticationServer object with the specific host, port and channel.

 

Method Summary

 boolean

createAccount(java.lang.String userID, java.lang.String password)
          Creates a new user account.

 boolean

login(java.lang.String userID, java.lang.String password)
          Logs in a user.

 void

logout(java.lang.String userID)
          Logs out a user.

protected  void

processRequest(java.lang.String request)
          Processes RPC encoded request, performs specified action and encodes response.

 void

shutDown()
          Shuts down the authentication server.

 

Constructor Detail

AuthenticationServer

public AuthenticationServer()

Constructs an AuthenticationServer object.


AuthenticationServer

public AuthenticationServer(int channel)

Constructs an AuthenticationServer object with the specific channel and default port and host.

Parameters:

channel - desired channel.


AuthenticationServer

public AuthenticationServer(java.lang.String host,
                            int port,
                            int channel)

Constructs an AuthenticationServer object with the specific host, port and channel.

Parameters:

host - desired host.

port - desired port.

channel - desired channel.

Method Detail

shutDown

public void shutDown()

Shuts down the authentication server.

Overrides:

shutDown in class Server


processRequest

protected void processRequest(java.lang.String request)

Processes request according to different commands.

Specified by:

processRequest in class Server

Parameters:

request - Processes RPC encoded request, performs specified action and encodes response.


createAccount

public boolean createAccount(java.lang.String userID,
                             java.lang.String password)

Creates a new user account.

Parameters:

userID - user/participant ID.

password - password to confirm the user ID.

Returns:

true if account is sucessfully created, false otherwise.


login

public boolean login(java.lang.String userID,
                     java.lang.String password)

Logs in a user.

Parameters:

userID - user/participant ID.

password - password to confirm the user ID.

Returns:

true if user sucessfully logs in, false otherwise.


logout

public void logout(java.lang.String userID)

Logs out a user.

Parameters:

userID - user/participant ID.

 


2.3     client Package


2.3.1  Class ApplicationClient

 

public class ApplicationClient

extends java.lang.Object

Stores references to client stubs for all modules in the system on the client side


Constructor Summary

ApplicationClient()
           

 

 

Method Summary

 AuthenticationClient

getAuthenticationClient()
           

static ApplicationClient

getInstance()
          Gets the singleton ApplicationClient object.

 ProjectClient

getProjectClient()
           

 

Constructor Detail

ApplicationClient

public ApplicationClient()

Method Detail

getInstance

public static ApplicationClient getInstance()

Gets the singleton ApplicationClient object.

Returns:

a reference to the singleton ApplicationClient object.

Throws:

java.lang.IllegalStateException - if an instance of ApplicationClient has not been created.


getAuthenticationClient

public AuthenticationClient getAuthenticationClient()

getProjectClient

public ProjectClient getProjectClient()

 

2.3.2  Class Client

 

Direct Known Subclasses:

AuthenticationClient, PersistentStoreClient, ProjectClient, SessionManagerClient

 

public abstract class Client

extends java.lang.Object

A superclass for all clients that are implemented as AMC clients.


Constructor Summary

Client(AMCClient amcClient, int channel)
          Creates an instance of Client and listens to the specifed channel.

 

 

Method Summary

protected  int

getReturnChannel()
          Gets the return channel's channel number.

protected  int

getServiceChannel()
          Gets the service channel's channel number.

protected abstract  void

processResponse(java.lang.String response)
          Interprets the received message and performs the corresponding actions.

 void

shutDown()
          Detaches all AMC clients.

  

Constructor Detail

Client

public Client(AMCClient amcClient,
              int channel)

Creates an instance of Client and listens to the specifed channel.

Parameters:

amcClient - the AMC client used to communicate with the server.

channel - the channel to listen for return messages.

Method Detail

shutDown

public void shutDown()

Detaches all AMC clients.


processResponse

protected abstract void processResponse(java.lang.String response)

Interprets the received message and performs the corresponding actions.

Parameters:

response - the message to interpret.


getReturnChannel

protected int getReturnChannel()

Gets the return channel's channel number.

Returns:

the channel number of the return channel.


getServiceChannel

protected int getServiceChannel()

Gets the service channel's channel number.

Returns:

the channel number of the service channel.


 

2.4 datainfo Package


2.4.1  Class DocumentInfo

 

public class DocumentInfo

extends java.lang.Object

This class implement a document.



 

Constructor Summary

DocumentInfo()
          Constructs a DocumentInfo object with version number set to 1 by default.

 

DocumentInfo(java.lang.String Dname, int vNum, java.util.Vector txt)
          Constructs a DocumentInfo object with desired document name, version number and text content.

 

 

Method Summary

 java.util.Vector

getContent()
          Get the text content of the document object.

 java.lang.String

getdocName()
          Get the document name of the document object.

 int

getVersionNum()
          Get the version number of the document object.

 void

setContent(java.util.Vector text)
          Set the text content of the document object.

 void

setDocName(java.lang.String docName)
          Set the document name of the document object.

 void

setVesionNum(int vesionNum)
          Set the version number of the document object.

 

Constructor Detail

DocumentInfo

public DocumentInfo()

Constructs a DocumentInfo object with version number set to 1 by default.


DocumentInfo

public DocumentInfo(java.lang.String Dname,
                    int vNum,
                    java.util.Vector txt)

Constructs a DocumentInfo object with desired document name, version number and text content.

Parameters:

Dname - document name.

vNum - version number.

txt - text content.

Method Detail

getdocName

public java.lang.String getdocName()

Get the document name of the document object.

Returns:

Document name of the document object.


getVersionNum

public int getVersionNum()

Get the version number of the document object.

Returns:

Version number of the document object.


getContent

public java.util.Vector getContent()

Get the text content of the document object.

Returns:

Text content of the document object.


setVesionNum

public void setVesionNum(int vesionNum)

Set the version number of the document object.


setDocName

public void setDocName(java.lang.String docName)

Set the document name of the document object.

Parameters:

docName - Desired document name to be set.


setContent

public void setContent(java.util.Vector text)

Set the text content of the document object.

Parameters:

text - Desired text content to be set.


 


2.4.2  Class ParticipantInfo

 

All Implemented Interfaces:

java.io.Serializable

 

public class ParticipantInfo

extends java.lang.Object

implements java.io.Serializable

Store Information on a participant of CT, inherit the properties of Serializable object.


Constructor Summary

ParticipantInfo()
          Default constructor - constructs an object of ParticipantInfo.

ParticipantInfo(java.lang.String userID, java.lang.String password)
          Constructs an object of ParticipantInfo with the specific user ID and password pair.

 

Method Summary

 void

addChairedProject(java.lang.String projID)
          Adds a project with chair control.

 boolean

addPartProject(java.lang.String projID)
          Adds a project.

 java.util.Vector

getChairedProject()
          Get a list of chaired projects.

 java.util.Vector

getPartProject()
          Gets the list of projects.

 java.lang.String

getUserID()
          Gets the user ID.

 java.lang.String

getUserPW()
          Gets the password.

 boolean

removeChairedProject(java.lang.String projID)
          Removes a chaired project.

 boolean

removePartProject(java.lang.String projID)
          Removes a project.

 void

setUserPW(java.lang.String pasword)
          Sets the password.

 

 

Constructor Detail

ParticipantInfo

public ParticipantInfo()

Default constructor - constructs a ParticipantInfo object.


ParticipantInfo

public ParticipantInfo(java.lang.String userID,
                       java.lang.String password)

Constructs a ParticipantInfo object with the specific user ID and password pair.

Parameters:

userID - user ID.

password - password which correspond to this specific user ID.

Method Detail

getUserID

public java.lang.String getUserID()

Gets the user ID.

Returns:

user ID in string format.


setUserPW

public void setUserPW(java.lang.String pasword)

Sets the password.

Parameters:

pasword - password to be set.


getUserPW

public java.lang.String getUserPW()

Gets the password.

Returns:

the password in string format.


addPartProject

public boolean addPartProject(java.lang.String projID)

Adds a project.

Parameters:

projID - project ID.

Returns:

true if the project is sucessfully added, false otherwise.


removePartProject

public boolean removePartProject(java.lang.String projID)

Removes a project.

Parameters:

projID - project ID.

Returns:

true if the project is sucessfully removed, false otherwise.


getPartProject

public java.util.Vector getPartProject()

Gets the list of projects.

Returns:

the list of projects.


addChairedProject

public void addChairedProject(java.lang.String projID)

Adds a project with chair control.


removeChairedProject

public boolean removeChairedProject(java.lang.String projID)

Removes project belonged to a chair.

Parameters:

projID - project ID.

Returns:

true if the project is successfully removed, false otherwise.


getChairedProject

public java.util.Vector getChairedProject()

Get a list of chaired projects.

Returns:

list of chaired projects.


 


2.4.3  Class ProjectInfo

 

All Implemented Interfaces:

java.io.Serializable

 

public class ProjectInfo

extends java.lang.Object

implements java.io.Serializable

Store project information


Constructor Summary

ProjectInfo()
          Default constructor - construct a ProjectInfo object.

 

ProjectInfo(java.lang.String projID, java.lang.String chairID)
          Constructs a ProjectInfo object with a specific project ID and chair ID.

 

 

Method Summary

 void

addDocument(java.lang.String docID)
          Adds a document.

 boolean

addParticipant(java.lang.String userID)
          Add a participant.

 void

addTranscript(java.lang.String tranID)
          Adds a transcript.

 java.lang.String

getChairID()
          Gets the chair ID.

 java.util.Vector

getDocumentList()
          Gets the list of documents.

 java.util.Vector

getParticipantList()
          Gets the list of participants.

 java.lang.String

getProjID()
          Gets the project ID.

 java.util.Vector

getTranscriptList()
          Get the list of transcripts.

 boolean

isChair(java.lang.String userID)
          Checks if a participant is the chair.

 boolean

removeDocument(java.lang.String docID)
          Removes a document.

 boolean

removeParticipant(java.lang.String userID)
          Removes a participant.

 boolean

removeTranscript(java.lang.String userID)
          Removes a transcript.

 

Constructor Detail

ProjectInfo

public ProjectInfo()

Default constructor - construct a ProjectInfo object.


ProjectInfo

public ProjectInfo(java.lang.String projID,
                   java.lang.String chairID)

Constructs a ProjectInfo object with specific a project ID and chair ID.

Parameters:

projID - project ID.

chairID - chair ID.

Method Detail

getProjID

public java.lang.String getProjID()

Gets the project ID.

Returns:

project ID in string format.


getChairID

public java.lang.String getChairID()

Gets the chair ID.

Returns:

chair ID in string format.


addParticipant

public boolean addParticipant(java.lang.String userID)

Add a participant.

Parameters:

userID - ID of the user to be added.

Returns:

true if user is added successfully, false otherwise.


removeParticipant

public boolean removeParticipant(java.lang.String userID)

Removes a participant.

Parameters:

userID - ID of the user to be removed.

Returns:

true if user is removed successfully, false otherwise.


getParticipantList

public java.util.Vector getParticipantList()

Gets the list of participants.

Returns:

list of participants.


addDocument

public void addDocument(java.lang.String docID)

Adds a document.

Parameters:

docID - the document ID.


removeDocument

public boolean removeDocument(java.lang.String docID)

Removes a document.

Parameters:

docID - the document ID.

Returns:

true if document is successfully removed, false otherwise.


getDocumentList

public java.util.Vector getDocumentList()

Gets the list of documents.

Returns:

list of documents.


addTranscript

public void addTranscript(java.lang.String tranID)

Adds a transcript.

Parameters:

tranID - transcript ID.


removeTranscript

public boolean removeTranscript(java.lang.String userID)

Removes a transcript.

Parameters:

userID - user ID as an index.

Returns:

true if transcript is sucessfully removed, false otherwise.


getTranscriptList

public java.util.Vector getTranscriptList()

Get a list of transcripts.

Returns:

the list of transcripts.


isChair

public boolean isChair(java.lang.String userID)

Checks if a participant is the chair.

Parameters:

userID - ID of the participant to be checked.

Returns:

true if the user is the chair, false othwise.


 

2.4.4  Class TranscriptInfo

 

All Implemented Interfaces:

java.io.Serializable

 

public class TranscriptInfo

extends java.lang.Object

implements java.io.Serializable

Stores Transcript information.


Constructor Summary

TranscriptInfo()
          Constructs a a new instance of TranscriptInfo.

 

 


 

Method Summary

 void

addDialogMessage(java.lang.String msg)
          Adds a dialogue message.

 void

addSystemMessage(java.lang.String msg)
          Adds a system message.

 java.util.Vector

getAllMessage()
          Get all messages.

 java.util.Vector

getDialogMessage()
          Get dialogue message.

 void

setCreationDate(java.util.Date date)
          Set creation date.

 

Constructor Detail

TranscriptInfo

public TranscriptInfo()

Constructs a new instance of TranscriptInfo.

Method Detail

setCreationDate

public void setCreationDate(java.util.Date date)

Set creation date.

Parameters:

date - creation date.


addSystemMessage

public void addSystemMessage(java.lang.String msg)

Adds a system message.

Parameters:

msg - system message to be added.


addDialogMessage

public void addDialogMessage(java.lang.String msg)

Adds a dialogue message.

Parameters:

msg - dialogue message to be added.


getDialogMessage

public java.util.Vector getDialogMessage()

Get dialogue message.

Returns:

dialogue message vector.


getAllMessage

public java.util.Vector getAllMessage()

Get all messages.

Returns:

vector of messages.


 

2.4.5  Class TranscriptMessage

 

All Implemented Interfaces:

java.io.Serializable

 

public class TranscriptMessage

extends java.lang.Object

implements java.io.Serializable

This class implements the structure of a transcript message. Transcript messages can belong to 2 types: System messages or Dialog messages.


 

Constructor Summary

TranscriptMessage()
          TranscriptMessage Constructor - constructs a new transcript message.

TranscriptMessage(java.lang.String msg, int messageType)
          TranscriptMessage Constructor without the need to set the message and message type -
constructs a new transcript message with the specific message and creation date.

 

Method Summary

 java.lang.String

getMessage()
          Aquires the message body.

 void

setMessage(java.lang.String msg, int messageType)
          Sets the message body of the object.

 

Constructor Detail

TranscriptMessage

public TranscriptMessage(java.lang.String msg,
                         int messageType)

TranscriptMessage Constructor without the need to set the message and message type -
constructs a new transcript message with the specific message and creation date.

Parameters:

msg - the message body.

messageType - the type of message the message body belongs to.
It can be either a SYSTEM_MESSAGE or DIALOG_MESSAGE.


TranscriptMessage

public TranscriptMessage()

TranscriptMessage Constructor - constructs a new transcript message.

Method Detail

setMessage

public void setMessage(java.lang.String msg,
                       int messageType)

Sets the message body of the object.

Parameters:

msg - the message body.

messageType - The type of message the message body belongs to. It can be either a SYSTEM_MESSAGE OR DIALOG_MESSAGE.


getMessage

public java.lang.String getMessage()

Aquires the message body.

Returns:

the message body.


 


2.5     directory Package

2.5.1  Class DirectoryClient

 

All Implemented Interfaces:

DirectoryServices

public class DirectoryClient

extends java.lang.Object

implements DirectoryServices

This class provides the directory services which reside on the client side. Note: the directory service client is instantiated in the server application of the collabrative tool.


Constructor Summary

DirectoryClient(AMCClient client)
          Constructs a new DirectoryClient using the specified AMC client.

 

DirectoryClient(AMCClient client, int serverChannel)
          Constructs a new DirectoryClient using the specified AMC client and server channel.

 

 

Method Summary

 boolean

addNode(java.lang.String path, DirectoryNode newDirectory)
           

 boolean

createNode(java.lang.String path)
           

 boolean

deleteNode(java.lang.String path)
           

 java.lang.Object

getAttribute(java.lang.String path)
           

 DirectoryNode

getNode(java.lang.String path)
           

 boolean

hasNode(java.lang.String path)
           

static void

main(java.lang.String[] args)
           

 boolean

setAttribute(java.lang.String path, java.lang.Object value)
           

 void

shutDown()
          Shuts down the DirectoryClient by detaching the amcClient.

 

Constructor Detail

DirectoryClient

public DirectoryClient(AMCClient client)

Constructs a new DirectoryClient using the specified AMC client. Assume that the directory server is listening on DirectoryServer.DEFAULT_DIRECTORY_CHANNEL

Parameters:

client - the AMC client used by this directory client to communicate with the directory server.


DirectoryClient

public DirectoryClient(AMCClient client,
                       int serverChannel)

Constructs a new DirectoryClient using the specified AMC client and server channel.

Parameters:

client - the AMC client used by this directory client to communicate with the directory server.

serverChannel - the AMC channel on which the directory server is listening.

Method Detail

hasNode

public boolean hasNode(java.lang.String path)

Specified by:

hasNode in interface DirectoryServices


createNode

public boolean createNode(java.lang.String path)

Specified by:

createNode in interface DirectoryServices


addNode

public boolean addNode(java.lang.String path,
                       DirectoryNode newDirectory)

Specified by:

addNode in interface DirectoryServices


deleteNode

public boolean deleteNode(java.lang.String path)

Specified by:

deleteNode in interface DirectoryServices


getNode

public DirectoryNode getNode(java.lang.String path)

Specified by:

getNode in interface DirectoryServices


setAttribute

public boolean setAttribute(java.lang.String path,
                            java.lang.Object value)

Specified by:

setAttribute in interface DirectoryServices


getAttribute

public java.lang.Object getAttribute(java.lang.String path)

Specified by:

getAttribute in interface DirectoryServices


shutDown

public void shutDown()

Shuts down the DirectoryClient by detaching the amcClient.


main

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

 


2.5.2  Class DirectoryException

 

All Implemented Interfaces:

java.io.Serializable

 

public class DirectoryException

extends java.lang.RuntimeException

An exception to indicate that an invalid operation has been performed on the directory. This is simply a java.lang.RuntimeException


Constructor Summary

DirectoryException()
          Constructs a new DirectoryException with no detail message.

DirectoryException(java.lang.String msg)
          Constructs a new DirectoryException with the specified detail message.

 

Constructor Detail

DirectoryException

public DirectoryException()

Constructs a new DirectoryException with no detail message.


DirectoryException

public DirectoryException(java.lang.String msg)

Constructs a new DirectoryException with the specified detail message.

Parameters:

msg - the detail message.


 


2.5.3  Class DirectoryNode

 

All Implemented Interfaces:

java.io.Serializable

 

public class DirectoryNode

extends java.lang.Object

implements java.io.Serializable

This class is a node of the recursive directory tree structure. A DirectoryNode may contain references to a list of sub-directories and one attribute (an Object stored at the node).


Constructor Summary

DirectoryNode()
          Constructs a new DirectoryNode object with no sub-directories or attribute.

 

 

Method Summary

 void

addDirectory(java.lang.String dirName, DirectoryNode directory)
          Adds the specified directory to this node.

 void

deleteDirectory(java.lang.String dirName)
          Deletes the specified sub-directory from this node.

 java.lang.Object

getAttribute()
          Gets the attribute value which has been set for this directory node.

 DirectoryNode

getDirectory(java.lang.String dirName)
          Gets the sub-directory node with the specified name.

 boolean

hasAttribute()
          Checks whether the attribute has been set at this directory node.

 boolean

hasDirectory(java.lang.String dirName)
          Checks whether a sub-directory with the specified name exists under this node.

 void

printDirectoryNode(int indent)
          System.out.println the content of this directory node and all its sub-directories recursively.

 void