Collaborative
Tool
Initial Software Architecture and
Design
1.0 System
Layering and Distribution
2.1.1 Interface
AMCClient.ChannelListenerI
2.1.2 Class
AMCClient.HandleResponse
2.1.8 Class
ClientConn.HandleRequest
2.2.1 Class
AuthenticationClient
2.2.2 Class
AuthenticationServer
2.5.2 Class
DirectoryException
2.5.5 Class
DirectoryStructure
2.7.2 Class PersistentStoreClient
2.7.3 Class
PersistentStoreServer
2.10.1 Class
ApplicationServer
2.11.2 Class
SessionManagerClient
2.11.3 Class
SessionManagerServer
3.0 Persistent
Data and Communication
3.1 Remote
Procedure Call Mechanism
5.3 Create
Account – Directory and Persistent Store Interaction
Figure
1 Component Model Diagram
Figure 2 Sub-Modules (Client/Server)
Figure 4 Usage of the directory structure
Figure 5 Static Class Diagram for the
Directory Package
Figure 6 General RPC Request Interaction Diagram
Figure 7 General RPC Response Interaction Diagram
Figure 8 Create Account – Directory and Persistent Store
Interaction Diagram
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.

Figure 2
Sub-Modules (Client/Server)
Client registers processRequest()
Server registers processResponse()
Figure 3
Login Example
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.
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.
Enclosing interface:
public static interface AMCClient.ChannelListenerI
The object that wants to receive input from a channel must implement this interface.
|
|
|
public void receive(java.lang.String data)
Called when the AMCC receives input for that objects channel.
All Implemented Interfaces:
Enclosing class:
class AMCClient.HandleResponse
extends java.lang.Object
implements Connection.ReceiverI
|
|
|
|
Method Summary |
|
|
|
|
AMCClient.HandleResponse()
|
Method Detail |
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.
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 |
|
|
|
|
|
|
|
|
Method Summary |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public AMCClient(java.lang.String host, int port)
Create an AMCC Client.
Parameters:
host - host name of
server
port - port of server
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 |
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.
public void detach()
Drop the connection to the AMC server. No further AMC commands can be issued after this.
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.
public void unlisten(int channel)
Stops reception from a channel.
Parameters:
channel - - channel
number to stop listening on.
public int getFreeChannel()
Get an unused channel. Channel returned is in the range 256 to 231-1.
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
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 |
|
|
|
|
|
Method Summary |
|
|
|
|
|
|
|
|
Constructor Detail |
AMCDriver()
|
Method Detail |
static void pause(int ms)
public static void main(java.lang.String[] args)
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 |
|
|
|
|
|
|
|
|
Method
Summary |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Constructor Detail |
public AMCServer()
Create an AMCC
Server object using default server port. To complete initialization you need to
call initialize().
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 |
public void setPort(int port)
Set the port the server should listen on.
Parameters:
port - - port to listen
on
public void initialize()
This routine is called to start up the AMCC listener.
void dispatch(ClientConn conn, java.lang.String data)
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.
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.
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.
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.
void detach(ClientConn conn)
This routine is called to disconnect a client from the multicasting environment.
Parameters:
conn - - client to
disconnect.
public void close()
This method shuts down the AMC Server connections and listener. Added with Version 1.1.
public void connectionState()
This method provides a snapshot of current connections and channel state. It is useful in debugging.
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 |
|
|
|
|
|
Method Summary |
|
|
|
|
|
|
|
java.lang.Object item
|
Constructor Detail |
public Buffer()
|
Method Detail |
public void add(java.lang.Object o)
This method is called by the result from an RPC.
Parameters:
o - item to be returned
public java.lang.Object remove()
This method is called by the real routine to get its result.
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 |
|
|
|
|
|
Method Summary |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
All Implemented Interfaces:
Enclosing class:
class ClientConn.HandleRequest
extends java.lang.Object
implements Connection.ReceiverI
|
Constructor Summary |
|
|
|
|
|
Method Summary |
|
|
|
|
|
Method Detail |
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.
All Implemented Interfaces:
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 |
|
|
|
|
|
Method Summary |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Direct Known Subclasses:
public abstract class ClientStub
extends java.lang.Object
Client Stub template for all stubs in CT.
|
Constructor Summary |
|
|
|
|
|
Method Summary |
|
|
|
|
|
|
|
|
|
|
Direct Known Subclasses:
public abstract class Server
extends java.lang.Object
Server Template for all servers in CT
|
Constructor Summary |
|
|
|
|
|
|
|
|
Method Summary |
|
|
|
|
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 |
|
|
|
|
|
|
|
|
Method Summary |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Constructor Detail |
public AuthenticationClient(AMCClient client)
Constructs an AuthenticationClient object with the specified AMC client and default channel.
Parameters:
client - AMC client to
be specified.
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 |
protected void processResponse(java.lang.String response)
Processes RPC encoded response.
Specified by:
processResponse in class Client
Parameters:
response – encoded
callback response.
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.
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.
public void logout(java.lang.String userID)
Logs out a user.
Parameters:
userID -
user/participant ID.
public class AuthenticationServer
extends Server
Server for the Authentication Application Logic - It provides services to every Authentication Client.
|
Constructor Summary |
|
|
|
|
|
|
|
Method Summary |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Constructor Detail |
public AuthenticationServer()
Constructs an AuthenticationServer object.
public AuthenticationServer(int channel)
Constructs an AuthenticationServer object with the specific channel and default port and host.
Parameters:
channel - desired
channel.
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 |
public void shutDown()
Shuts down the authentication server.
Overrides:
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.
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.
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.
public void logout(java.lang.String userID)
Logs out a user.
Parameters:
userID -
user/participant ID.
public class ApplicationClient
extends java.lang.Object
Stores references to client stubs for all modules in the system on the client side
|
Constructor Summary |
|
|
|
|
|
Method Summary |
|
|
|
|
|
Constructor Detail |
public ApplicationClient()
|
Method Detail |
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.
public AuthenticationClient getAuthenticationClient()
public ProjectClient getProjectClient()
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 |
|
|
|
|
|
Method Summary |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Constructor Detail |
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 |
public void shutDown()
Detaches all AMC clients.
protected abstract void processResponse(java.lang.String response)
Interprets the received message and performs the corresponding actions.
Parameters:
response - the message
to interpret.
protected int getReturnChannel()
Gets the return channel's channel number.
Returns:
the channel number of the return channel.
protected int getServiceChannel()
Gets the service channel's channel number.
Returns:
the channel number of the service channel.
public class DocumentInfo
extends java.lang.Object
This class implement a document.
|
Constructor Summary |
|
|
|
|
|
|
|
|
Method Summary |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Constructor Detail |
public DocumentInfo()
Constructs a DocumentInfo object with version number set to 1 by default.
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 |
public java.lang.String getdocName()
Get the document name of the document object.
Returns:
Document name of the document object.
public int getVersionNum()
Get the version number of the document object.
Returns:
Version number of the document object.
public java.util.Vector getContent()
Get the text content of the document object.
Returns:
Text content of the document object.
public void setVesionNum(int vesionNum)
Set the version number of the document object.
public void setDocName(java.lang.String docName)
Set the document name of the document object.
Parameters:
docName - Desired
document name to be set.
public void setContent(java.util.Vector text)
Set the text content of the document object.
Parameters:
text - Desired text
content to be set.
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 |
|
|
|
|
|
Method Summary |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Constructor Detail |
public ParticipantInfo()
Default constructor - constructs a ParticipantInfo object.
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 |
public java.lang.String getUserID()
Gets the user ID.
Returns:
user ID in string format.
public void setUserPW(java.lang.String pasword)
Sets the password.
Parameters:
pasword - password to
be set.
public java.lang.String getUserPW()
Gets the password.
Returns:
the password in string format.
public boolean addPartProject(java.lang.String projID)
Adds a project.
Parameters:
projID - project ID.
Returns:
true if the project is sucessfully added, false otherwise.
public boolean removePartProject(java.lang.String projID)
Removes a project.
Parameters:
projID - project ID.
Returns:
true if the project is sucessfully removed, false otherwise.
public java.util.Vector getPartProject()
Gets the list of projects.
Returns:
the list of projects.
public void addChairedProject(java.lang.String projID)
Adds a project with chair control.
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.
public java.util.Vector getChairedProject()
Get a list of chaired projects.
Returns:
list of chaired projects.
All Implemented Interfaces:
java.io.Serializable
public class ProjectInfo
extends java.lang.Object
implements java.io.Serializable
Store project information
|
Constructor Summary |
|
|
|
|
|
|
|
|
Method Summary |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Constructor Detail |
public ProjectInfo()
Default constructor - construct a ProjectInfo object.
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 |
public java.lang.String getProjID()
Gets the project ID.
Returns:
project ID in string format.
public java.lang.String getChairID()
Gets the chair ID.
Returns:
chair ID in string format.
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.
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.
public java.util.Vector getParticipantList()
Gets the list of participants.
Returns:
list of participants.
public void addDocument(java.lang.String docID)
Adds a document.
Parameters:
docID - the document
ID.
public boolean removeDocument(java.lang.String docID)
Removes a document.
Parameters:
docID - the document
ID.
Returns:
true if document is successfully removed, false otherwise.
public java.util.Vector getDocumentList()
Gets the list of documents.
Returns:
list of documents.
public void addTranscript(java.lang.String tranID)
Adds a transcript.
Parameters:
tranID - transcript ID.
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.
public java.util.Vector getTranscriptList()
Get a list of transcripts.
Returns:
the list of transcripts.
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.
All Implemented Interfaces:
java.io.Serializable
public class TranscriptInfo
extends java.lang.Object
implements java.io.Serializable
Stores Transcript information.
|
Constructor Summary |
|
|
|
|
|
Method Summary |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Constructor Detail |
public TranscriptInfo()
Constructs a new instance of TranscriptInfo.
|
Method Detail |
public void setCreationDate(java.util.Date date)
Set creation date.
Parameters:
date - creation date.
public void addSystemMessage(java.lang.String msg)
Adds a system message.
Parameters:
msg - system message to
be added.
public void addDialogMessage(java.lang.String msg)
Adds a dialogue message.
Parameters:
msg - dialogue message
to be added.
public java.util.Vector getDialogMessage()
Get dialogue message.
Returns:
dialogue message vector.
public java.util.Vector getAllMessage()
Get all messages.
Returns:
vector of messages.
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 |
|
|
|
|
|
Method Summary |
|
|
|
|
|
|
|
|
Constructor Detail |
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.
public TranscriptMessage()
TranscriptMessage Constructor - constructs a new transcript message.
|
Method Detail |
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.
public java.lang.String getMessage()
Aquires the message body.
Returns:
the message body.
All Implemented Interfaces:
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 |
|
|
|
|
|
|
|
|
Method Summary |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Constructor Detail |
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.
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 |
public boolean hasNode(java.lang.String path)
Specified by:
hasNode in interface DirectoryServices
public boolean createNode(java.lang.String path)
Specified by:
createNode in interface DirectoryServices
public boolean addNode(java.lang.String path, DirectoryNode newDirectory)
Specified by:
addNode in interface DirectoryServices
public boolean deleteNode(java.lang.String path)
Specified by:
deleteNode in interface DirectoryServices
public DirectoryNode getNode(java.lang.String path)
Specified by:
getNode in interface DirectoryServices
public boolean setAttribute(java.lang.String path, java.lang.Object value)
Specified by:
setAttribute in interface DirectoryServices
public java.lang.Object getAttribute(java.lang.String path)
Specified by:
getAttribute in interface DirectoryServices
public void shutDown()
Shuts down the DirectoryClient by detaching the amcClient.
public static void main(java.lang.String[] args)
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 |
|
|
|
|
|
Constructor Detail |
public DirectoryException()
Constructs a new DirectoryException with no detail message.
public DirectoryException(java.lang.String msg)
Constructs a new DirectoryException with the specified detail message.
Parameters:
msg - the detail
message.
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 |
|
|
|
|
|
Method Summary |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|