|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sshtools.j2ssh.transport.ServiceState
When a service is requested the transport layer sends an SSH_MSG_SERVICE_REQUEST message to the remote computer. This state object is used to synchronize with the input stream thread so that the transport layer can synchronously return either a new instance of the requested service or deny the service request. The object is additionally used when starting the service to indicate whether in was instansiated due to a service request (i.e is in server mode) or by the completion of a service request and the subsequent receipt of a service accept.
Field Summary | |
static int |
SERVICE_ACCEPTED
The service has been accepted |
static int |
SERVICE_REQUESTED
The service has been requested |
Constructor Summary | |
ServiceState()
Constructor for the SshServiceState object, defaults the state to service requested. |
Method Summary | |
int |
getState()
Gets the current state of the service. |
void |
setState(int state)
Sets the state of the service and notifys any waiting threads. |
void |
waitForServiceAccept()
Synchronized method that will wait on the state untill the state has changed from SERVICE_REQUEST to SERVICE_ACCEPT. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SERVICE_REQUESTED
public static final int SERVICE_ACCEPTED
Constructor Detail |
public ServiceState()
Constructor for the SshServiceState object, defaults the state to service requested.
Method Detail |
public final void setState(int state) throws InvalidStateException
Sets the state of the service and notifys any waiting threads.
state
- The new state value
InvalidStateException
- Thrown if an attempt is made to set the
state to anything other than the public static values of this classpublic int getState()
Gets the current state of the service.
public void waitForServiceAccept()
Synchronized method that will wait on the state untill the state has changed from SERVICE_REQUEST to SERVICE_ACCEPT.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |