java.lang.Object
java.lang.Thread
nectar.reda.io.ControllerThread
nectar.reda.client.base.ClientComThread
- All Implemented Interfaces:
- java.lang.Runnable
- public class ClientComThread
- extends nectar.reda.io.ControllerThread
Client Communication Thread -- handles all the data communication with the server.
| Nested classes inherited from class java.lang.Thread |
java.lang.Thread.UncaughtExceptionHandler |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
client
private nectar.reda.io.RedaClientConnection client
login
private java.lang.String login
password
private java.lang.String password
myUserId
private java.lang.Long myUserId
myProject
private java.lang.Long myProject
authenticated
private boolean authenticated
mainWindow
private ClientJFrame mainWindow
connStats
private ConnectionStats connStats
pump
private ActionPump pump
in
private java.io.ObjectInputStream in
out
private java.io.ObjectOutputStream out
statusDialog
private ConnectionStatusJDialog statusDialog
statusChangeListeners
protected java.beans.PropertyChangeSupport statusChangeListeners
CONNECTION_PROGRESS_PERCENT
public static final java.lang.String CONNECTION_PROGRESS_PERCENT
- Property Change Event description, indicating the percentage progress of the connection establishement.
- See Also:
- Constant Field Values
CONNECTION_PROGRESS_STRING
public static final java.lang.String CONNECTION_PROGRESS_STRING
- Property Change Event description, indicating the currently running operation in the connection establishement process.
- See Also:
- Constant Field Values
CONNECTION_STATUS
public static final java.lang.String CONNECTION_STATUS
- Property Change Event description, indicating whether the connection is established or not.
- See Also:
- Constant Field Values
progressString
protected java.lang.String progressString
progressPercent
protected int progressPercent
ClientComThread
public ClientComThread(ClientJFrame mainWindow,
ActionPump pump)
- Creates a new instance of ClientComThread
reloadConfig
public void reloadConfig(Configuration config)
throws java.io.IOException
- Reloads configuration variables from the Configuration object. This operation can *ONLY* be performed when the communication is inactive -- when the client is disconnected.
disconnect
public void disconnect()
throws java.io.IOException
- Attempts to disconnect from the server.
setStatus
public void setStatus(java.lang.String status,
int progress)
runThread
public void runThread()
- The main running loop for the communication, called when the Thread is started.
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
public void addPropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener)
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
isConnected
public boolean isConnected()
- check whether the connection is established.
isAuthenticated
public boolean isAuthenticated()
- Check whether authentication has been successful on the current connection.
sendAction
public void sendAction(nectar.reda.client.action.ClientAction action)
throws nectar.reda.client.action.ClientActionException
- Sends a ClientAction to the Server -- Note that you should use the ActionPump mechanism to send commands and receive responses.
getConnectionStats
public ConnectionStats getConnectionStats()
setStatusDialog
public void setStatusDialog(ConnectionStatusJDialog dialog)
authenticate
public boolean authenticate(java.io.ObjectInputStream in,
java.io.ObjectOutputStream out)
throws java.lang.Exception
setMyUserId
private void setMyUserId(java.lang.Long id)
getMyUserId
public java.lang.Long getMyUserId()
setMyProject
private void setMyProject(java.lang.Long project)
getMyProject
public java.lang.Long getMyProject()