Class Diagrams and CRC

 
 

Common (Server/Client) Classes

        NetworkConnection

Class Description:
A NetworkConnection represent any incoming or outgoing Network connection between two Jagster clients or between a Jagster client and a server. The  NetworkConnection provides a wrapper around the java.net.socket object to provide additional functionality.
Used by both the Jagster server and the client.
Responsibilities Collaborators
Wrapper for java.net.socket object None

 

        NetworkConnectionFactory
 

Class Description:
NetworkConnectionFactory creates a specific type of NetworkConnection depending on the type of communication needed. The NetworkConnectionFactory creates a new NetworkConnection which may be either an outbound or inbound connection. The NetworkConnectionFactory hides the details of creating a specific type of NetworkConnection and allows for integrating new type of NetworkConnection objects which may support addtional features such as security, ssl, etc. into the application.
Used by both the Jagster server and the client.
Responsibilities Collaborators
Creates and returns a new NetworkConnection NetworkConnection

 
 

        Command

Class Description:
A command is a particular type of request and all of the processing logic related to fulfilling the request. This layer handles the message protocol (not the network protocol) and the message format for specific requests.  A type of a Command object is the ServerConnectionCommand which deals with a request from a Jagster client to the Jagster server to start a new session. The protocol may include the client sending a message in the form of
 
    Request  -  command=connect#userid=mike
    Response -  command=processconnect#loginsuccess=1
The ServerConnectionCommand encapsulates the logic to process the type of request it is associated with. It does not deal with network specific functionality which is handled by the NetworkConnection object.
Used by both the Jagster server and the client.
Responsibilities Collaborators
Process a given type of request and returns a ResultSet DBConnection
FileInfoManager
NetworkConnection
ResultSet


        Session

Class Description:
A Session is any communication between two Jagster clients  or between a Jagster client and a Jagster server. The Session contains a set of Command objects each of which contains the logic and protocol to process a specific type of request. The set of Command objects a particular Session contains is determined by the SessionBuilder. This allows Session objects to be very generic and only worry about general functionality across all sessions such as as constructing a new NetworkConnection and handling I/O sessions (reading input and wrting output).
Used by both the Jagster server and the client.
Responsibilities Collaborators
Executes a specified Command and returns the ResultSet Command


        SessionBuilder

Class Description:
The SessionBuilder creates a specific type of a Session. The SessionBuilder knows how to build the different types of sessions. The first type of session is an incoming request from another Jagster peer to download a file. The second type of session is the connection between the Jagster client and the Jagster server. The last type of session in an outgoing connection to another Jagster peer to request a file download.  The SessionBuilder builds the appropriate Session for the type of request/connection. The SessionBuilder is also specifies the set of Commands a particular session should be able to handle.
Used by both the Jagster server and the client.
Responsibilities Collaborators
Creates a specific type of session with a set of Command(s) Command
Session


       SessionManager
 

Class Description:
The SessionManager maintains all the Sessions. The SessionManager uses the SessionBuilder to create and start new Sessions. The SessionManager only maintains the set of Sessions and is not aware of session types or details.  The SessionManager acts as an entry point to creating a new Session and therefore may be used to control the number of new Sessions and periodically monitor any existing Sessions.
Used by both the Jagster server and the client.
Responsibilities Collaborators
Maintains all the active sessions Session
Creates new Sessions using SessionBuilder SessionBuilder


       NetworkListener

Class Description:
NetworkListener simply waits for incoming connection requests from Jagster clients. Once an incoming connection is accepted, the NetworkListener asks the SessionManager to create a new Session.
Used by both the Jagster server and the client.
Responsibilities Collaborators
Waits for incoming connections None
Accepts the incoming connection and requests the SessionManager to create a new session. Continues to wait for other incoming connections. SessionManager


       FileInfo

Class Description:
A FileInfo object represents a physical file which resides on the Jagster client's shared directory. A file objects maintains properties about a physical file such as its name, size, type, last modification date, etc. A FileInfo object may also represent any file which may have been added to or deleted from the client's shared directory.
Used by both the Jagster server and the client.
Responsibilities Collaborators
FileInfo object may initialize and load itself from an inputstream and write itself to an outputstream NetworkConnection


       ResultSet

Class Description:
A ResultSet object is simply a generic container for returned results from Commands.
Responsibilities Collaborators
Write its contents to an outputstream NetworkConnection

 

Server Classes
 

       DBConnection

Class Description:
A DBConnection object represents a connection to the database. The DBConnection provides a wrapper around the java.sql.Connection object to provide additional functionality.
Used only by the Jagster server.
Responsibilities Collaborators
Executes queries and returns java.sql.RecordSets None
Executes Stored Procedures and returns results None
Handles transactions - Commit & Rollback None


        DBManager

Class Description:
The DBManager creates and maintains all DBConnection objects on the server. The DBManager allows the application to either create new connections to the database or even return an existing DBConnection from a pool (DBConnection pool will not be implemented at this time).
Used only by the Jagster server.
Responsibilities Collaborators
Creates and maintans DBConnection(s) DBConnection
        ServerEngine
Class Description:
The ServerEngine is the entry point to Jagster server. The ServerEngine is responsible for creating and starting the DBManager and creating and starting the NetworkListener to start accepting connections from Jagster clients. The ServerEngine also acts as a daemon, periodically checking on the server components and outputing statistics.
Used only by the Jagster server.
Responsibilities Collaborators
Creates and starts the NetworkListener to accept incoming network connections NetworkListener
Creates and starts the DBManager to handle database connections DBManager


        FileInfoManager

Class Description:
The FileinfoManager handles FileInfo searches and synchronization requests. The FileInfoManager queries the database and returns a ResultSet of FileInfo object matching the specified search criteria. It also updates the database with the set of file information sent by individual clients for syncronization.
Responsibilities Collaborators
Perform synchronization requests NetworkConnection
DBConnection
FileInfo
Perform search requests and returns a ResultSet of FileInfo objects Network Connection
DBConnection
FileInfo
Initialize and loat itself from an inputstream, write its contents to an outputstream NetworkConnection
FileInfo


Client Classes
 

        FileInfoSynchronizer

Class Description:
FileInfoSynchronizer is responsible for synchronizing the file contents of the Jagster clients shared directory with the Jagster Server. The FileInfoSynchronizer maintains a list of files located in the client's shared directory and keeps track of the files which may have been added or deleted.
Used only by the Jagster client.
Responsibilities Collaborators
Perform synchronization requests NetworkConnection
FileInfo


       ClientSessionController

Class Description:
The ClientSessionController starts the user interface on the Jagster client. It also deals with validating user input and forwarding requests and returning results  from the panels to the appropriate sessions. The ClientSessionController allows the Panels to handle only UI specific issues such as refreshing, enabling and disabling widgets, etc.
Used only by the Jagster client.
Responsibilities Collaborators
Creates and displays the main user interface MainPanel
Requests a new Session using the SessionManager SessionManager
Handles all requests from the user interface - acts as a controller and forwards requests to the session MainPanel
SearchPanel
DownloadPanel
LoginPanel
Session


       ClientEngine

Class Description:
The ClientEngine is the entry point to the Jagster client application. The ClientEngine is responsible for creating and starting the FileInfoSynchronizer, SessionManager, NetworkListener and the ClientSessionController.  The ClientEngine also acts periodically interacts with the above objects to keep track of the application as a whole.
Used only by the Jagster client.
Responsibilities Collaborators
Creates and starts the FileInfoSynchronizer FileInfoSynchronizer
Creats and starts the NetworkListener NetworkListener
Creats and starts the SessionManager SessionManager
Creats and starts the ClientSessionController ClientSessionController


       Media

Class Description:
A Media is any type of media which may be indexed and searched on the Jagster server. An instance of the Media object represents a single media entry in the Database. The Media object stores the attributes of a media entry. These attributes are pre-defined and may include the media's name, size, type, etc.
Used only by the Jagster client.
Responsibilities Collaborators
Initialize and load itself from an inputstream and write its contents to an outputstram NetworkConnection


       MainPanel

Class Description:
The MainPanel is simply a container for the other panels in the Jagster client.
Used only by the Jagster client.
Responsibilities Collaborators
Creates and displays the sub-panels DownloadPanel
LoginPanel
SearchPanel


       LoginPanel

Class Description:
The LoginPanel accepts input from the user to login to the Jagster server.
Used only by the Jagster client.
Responsibilities Collaborators
Accepts user input for logging in and passes information to ClientSessionContoller to process. ClientSessionContoller


       SearchPanel

Class Description:
The SearchPanel accepts input from the user as search criteria to forward to the Jagster server and displays the results returned by the server. Its also allows the user to request to download a file in the search results.
Used only by the Jagster client.
Responsibilities Collaborators
Accepts user input for searching and passes information to ClientSessionContoller to process. ClientSessionContoller
Displays the search results (FileInfo objects) returned from the ClientSessionContoller ClientSessionController
FileInfo
Accpets user input for downloading a file from the search result as well as listing the contents of other users. All input is passed to the ClientSessionController to process. ClientSessionContoller
FileInfo
        DownloadPanel
Class Description:
The DownloadPanel allows the user to interact with the current file download from another peer (if any).
Used only by the Jagster client.
Responsibilities Collaborators
Displays the current status of a download session Session
Accepts user input to cancel an ongoing download session. The request is passed to the ClientSessionController to process.  ClientSessionController
Session
1
Hosted by www.Geocities.ws

1