com.enderak.procol.client.net
Class ProColClient

java.lang.Object
  |
  +--java.util.Observable
        |
        +--com.enderak.procol.common.util.EnhancedObservable
              |
              +--com.enderak.procol.client.net.ProColClient
All Implemented Interfaces:
java.lang.Runnable

public class ProColClient
extends EnhancedObservable
implements java.lang.Runnable

Main client class for ProCol - responsible for receiving all network communication from the server and starting handler threads, as well as notifying Observers of any network status changes

Author:
Justin Dieters

Field Summary
protected  boolean isRunning
           
protected  java.util.Vector userList
           
 
Constructor Summary
ProColClient()
          Constructor for the ProColClient
 
Method Summary
 void addPrivateMessage(java.lang.String messageTo, java.lang.String subject, java.lang.String message)
           
 void addTree(byte[] treeData)
           
 void authenticateUser(java.lang.String userNameIn, java.lang.String passwordIn)
          Description of the Method
 void checkOutFile(javax.swing.tree.TreePath[] selectedPaths)
           
 void close()
          Description of the Method
 void closeProject()
           
 boolean connectToServer(java.lang.String hostIn, int portIn)
          Connects the client to the server, and authenticates the user
 void deleteFile(javax.swing.tree.TreePath[] selectedPaths)
           
 void disconnect()
           
 void downloadFile(javax.swing.tree.TreePath[] selectedPaths)
           
 void downloadSnapshot()
           
 void getFileHistory(java.lang.String fileName)
           
 IncomingMessageHandler getIMH()
           
 MessageFactory getMessageFactory()
           
 OutgoingMessageHandler getOMH()
           
 PacketFactory getPacketFactory()
           
 int getPort()
          Gets the currently isRunning port number
 ProColClientProject getProject()
           
 void getProjectInfo()
           
 void getProjectInfo(java.lang.String projectIn)
           
 void getProjectList()
          Gets the projectList attribute of the ProColClient object
 java.lang.String getProperty(java.lang.String propertyIn)
          Gets the property attribute of the ProColServer class
 java.lang.String getProperty(java.lang.String propertyIn, java.lang.String defaultIn)
          Gets the property attribute of the ProColServer class
 java.lang.String getServer()
          Gets the currently isRunning server IP or hostname
 javax.net.ssl.SSLSocket getServerSocket()
          Gets the channel attribute of the ServerConnection object
 java.net.URI getSnapshotURI()
           
 ProColClientUser getUser()
          Gets the user attribute of the ProColClient object
 void getUserInfo(java.lang.String userName)
           
 java.util.Vector getUserList()
          Gets the userList attribute of the ProColClient object
 boolean isAuthenticated()
           
 boolean isConnected()
          Gets the isRunning attribute of the ProColClient object
 void joinProject(java.lang.String projectIn)
          Description of the Method
 void killServerRemotely()
           
 void newDir(javax.swing.tree.TreePath[] selectedPaths)
           
 void newFile(javax.swing.tree.TreePath[] selectedPaths)
           
 void receive()
          Description of the Method
 void renameFile(javax.swing.tree.TreePath[] selectedPaths)
           
 void run()
          Main processing method for the ProColClient - receives and handles messages from the server
 void sendFileRequest(java.net.URI fileURI, java.net.URI destURI, int request)
           
 void sendHello()
           
 void setUser(ProColClientUser userIn)
           
 void setUserList(java.util.Vector userListIn)
           
 void updateFile(ProColFile file)
           
 void uploadDirs()
           
 void uploadFiles()
           
 
Methods inherited from class com.enderak.procol.common.util.EnhancedObservable
forceNotify, forceNotify
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isRunning

protected boolean isRunning

userList

protected java.util.Vector userList
Constructor Detail

ProColClient

public ProColClient()
Constructor for the ProColClient

Method Detail

run

public void run()
Main processing method for the ProColClient - receives and handles messages from the server

Specified by:
run in interface java.lang.Runnable

receive

public void receive()
Description of the Method


connectToServer

public boolean connectToServer(java.lang.String hostIn,
                               int portIn)
Connects the client to the server, and authenticates the user

Parameters:
hostIn - IP or hostname of the server
portIn - Port to connect to on server
Returns:
true if connection and authentication successful, false otherwise

close

public void close()
Description of the Method


sendHello

public void sendHello()

authenticateUser

public void authenticateUser(java.lang.String userNameIn,
                             java.lang.String passwordIn)
Description of the Method

Parameters:
userNameIn - Description of the Parameter
passwordIn - Description of the Parameter

getProjectList

public void getProjectList()
Gets the projectList attribute of the ProColClient object


getProjectInfo

public void getProjectInfo()

getProjectInfo

public void getProjectInfo(java.lang.String projectIn)
Parameters:
projectIn - Description of the Parameter

getUserInfo

public void getUserInfo(java.lang.String userName)
Parameters:
userName - Description of the Parameter

getFileHistory

public void getFileHistory(java.lang.String fileName)
Parameters:
fileName - Description of the Parameter

downloadSnapshot

public void downloadSnapshot()

checkOutFile

public void checkOutFile(javax.swing.tree.TreePath[] selectedPaths)
Parameters:
selectedPaths - Description of the Parameter

updateFile

public void updateFile(ProColFile file)
Parameters:
file - Description of the Parameter

downloadFile

public void downloadFile(javax.swing.tree.TreePath[] selectedPaths)
Parameters:
selectedPaths - Description of the Parameter

uploadFiles

public void uploadFiles()

uploadDirs

public void uploadDirs()

deleteFile

public void deleteFile(javax.swing.tree.TreePath[] selectedPaths)
Parameters:
selectedPaths - Description of the Parameter

renameFile

public void renameFile(javax.swing.tree.TreePath[] selectedPaths)
Parameters:
selectedPaths - Description of the Parameter

newFile

public void newFile(javax.swing.tree.TreePath[] selectedPaths)
Parameters:
selectedPaths - Description of the Parameter

newDir

public void newDir(javax.swing.tree.TreePath[] selectedPaths)
Parameters:
selectedPaths - Description of the Parameter

closeProject

public void closeProject()

joinProject

public void joinProject(java.lang.String projectIn)
Description of the Method

Parameters:
projectIn - Description of the Parameter

addPrivateMessage

public void addPrivateMessage(java.lang.String messageTo,
                              java.lang.String subject,
                              java.lang.String message)
Parameters:
messageTo - Description of the Parameter
message - Description of the Parameter
subject -

disconnect

public void disconnect()

killServerRemotely

public void killServerRemotely()

sendFileRequest

public void sendFileRequest(java.net.URI fileURI,
                            java.net.URI destURI,
                            int request)
Parameters:
fileURI - Description of the Parameter
destURI - Description of the Parameter
request - Description of the Parameter

setUserList

public void setUserList(java.util.Vector userListIn)
Parameters:
userListIn -

addTree

public void addTree(byte[] treeData)
Parameters:
treeData -

getProject

public ProColClientProject getProject()
Returns:
the project

isConnected

public boolean isConnected()
Gets the isRunning attribute of the ProColClient object

Returns:
The isRunning value

isAuthenticated

public boolean isAuthenticated()
Returns:
true if user is authenticated

getServer

public java.lang.String getServer()
Gets the currently isRunning server IP or hostname

Returns:
The server IP or hostname

getPort

public int getPort()
Gets the currently isRunning port number

Returns:
The port number

getUser

public ProColClientUser getUser()
Gets the user attribute of the ProColClient object

Returns:
The user

getUserList

public java.util.Vector getUserList()
Gets the userList attribute of the ProColClient object

Returns:
The userList value

getServerSocket

public javax.net.ssl.SSLSocket getServerSocket()
Gets the channel attribute of the ServerConnection object

Returns:
The channel value

getPacketFactory

public PacketFactory getPacketFactory()
Returns:
the packet factory

getMessageFactory

public MessageFactory getMessageFactory()
Returns:
the message factory

getIMH

public IncomingMessageHandler getIMH()
Returns:
the incoming message handler

getOMH

public OutgoingMessageHandler getOMH()
Returns:
the outgoing message handler

getSnapshotURI

public java.net.URI getSnapshotURI()
Returns:
the shapshot URI

setUser

public void setUser(ProColClientUser userIn)
Parameters:
userIn -

getProperty

public java.lang.String getProperty(java.lang.String propertyIn)
Gets the property attribute of the ProColServer class

Parameters:
propertyIn - Description of the Parameter
Returns:
The property value

getProperty

public java.lang.String getProperty(java.lang.String propertyIn,
                                    java.lang.String defaultIn)
Gets the property attribute of the ProColServer class

Parameters:
propertyIn - Description of the Parameter
defaultIn - Description of the Parameter
Returns:
The property value