Package com.sshtools.j2ssh.util
Class State
java.lang.Object
com.sshtools.j2ssh.util.State
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ChannelState,IOStreamConnectorState,OpenClosedState,ServiceState,StartStopState,TransportProtocolState
- Version:
- $Revision: 1.18 $
- Author:
- $author$
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidintgetValue()abstract booleanisValidState(int state) voidsetValue(int state) booleanwaitForState(int state) booleanwaitForState(int state, long timeout) int
-
Field Details
-
state
protected int state
-
-
Constructor Details
-
State
public State(int initialState) Creates a new State object.- Parameters:
initialState-
-
-
Method Details
-
isValidState
public abstract boolean isValidState(int state) - Parameters:
state-- Returns:
-
setValue
- Parameters:
state-- Throws:
InvalidStateException
-
getValue
public int getValue()- Returns:
-
breakWaiting
public void breakWaiting() -
waitForState
- Parameters:
state-- Returns:
- Throws:
InvalidStateExceptionInterruptedException
-
waitForState
public boolean waitForState(int state, long timeout) throws InvalidStateException, InterruptedException - Parameters:
state-timeout-- Returns:
- Throws:
InvalidStateExceptionInterruptedException
-
waitForStateUpdate
- Returns:
- Throws:
InterruptedException
-