Common (Server/Client) Classes
NetworkConnection
| Responsibilities | Collaborators |
| Wrapper for java.net.socket object | None |
NetworkConnectionFactory
| Responsibilities | Collaborators |
| Creates and returns a new NetworkConnection | NetworkConnection |
Command
| Responsibilities | Collaborators |
| Process a given type of request and returns a ResultSet | DBConnection
FileInfoManager NetworkConnection ResultSet |
Session
| Responsibilities | Collaborators |
| Executes a specified Command and returns the ResultSet | Command |
SessionBuilder
| Responsibilities | Collaborators |
| Creates a specific type of session with a set of Command(s) | Command
Session |
SessionManager
| Responsibilities | Collaborators |
| Maintains all the active sessions | Session |
| Creates new Sessions using SessionBuilder | SessionBuilder |
NetworkListener
| 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
| Responsibilities | Collaborators |
| FileInfo object may initialize and load itself from an inputstream and write itself to an outputstream | NetworkConnection |
ResultSet
| Responsibilities | Collaborators |
| Write its contents to an outputstream | NetworkConnection |
Server Classes
DBConnection
| Responsibilities | Collaborators |
| Executes queries and returns java.sql.RecordSets | None |
| Executes Stored Procedures and returns results | None |
| Handles transactions - Commit & Rollback | None |
DBManager
| Responsibilities | Collaborators |
| Creates and maintans DBConnection(s) | DBConnection |
| Responsibilities | Collaborators |
| Creates and starts the NetworkListener to accept incoming network connections | NetworkListener |
| Creates and starts the DBManager to handle database connections | DBManager |
FileInfoManager
| 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
| Responsibilities | Collaborators |
| Perform synchronization requests | NetworkConnection
FileInfo |
ClientSessionController
| 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
| 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
| Responsibilities | Collaborators |
| Initialize and load itself from an inputstream and write its contents to an outputstram | NetworkConnection |
MainPanel
| Responsibilities | Collaborators |
| Creates and displays the sub-panels | DownloadPanel
LoginPanel SearchPanel |
LoginPanel
| Responsibilities | Collaborators |
| Accepts user input for logging in and passes information to ClientSessionContoller to process. | ClientSessionContoller |
SearchPanel
| 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 |
| 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 |