Package org.briarproject.onionwrapper
Enum TorWrapper.TorState
- java.lang.Object
-
- java.lang.Enum<TorWrapper.TorState>
-
- org.briarproject.onionwrapper.TorWrapper.TorState
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<TorWrapper.TorState>
- Enclosing interface:
- TorWrapper
public static enum TorWrapper.TorState extends java.lang.Enum<TorWrapper.TorState>
The state of the Tor wrapper.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CONNECTEDThe Tor process has started, its network connection is enabled, and it has connected to the Tor network.CONNECTINGThe Tor process has started, its network connection is enabled, and it is connecting (or reconnecting) to the Tor network.DISABLEDThe Tor process has started but its network connection is disabled.NOT_STARTEDThe wrapper has been created but theTorWrapper.start()method has not yet been called.STARTEDTheTorWrapper.start()method has been called and the Tor process has started.STARTINGTheTorWrapper.start()method has been called and the Tor process is starting.STOPPEDTheTorWrapper.stop()method has been called and the Tor process has stopped.STOPPINGTheTorWrapper.stop()method has been called and the Tor process is stopping.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TorWrapper.TorStatevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static TorWrapper.TorState[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NOT_STARTED
public static final TorWrapper.TorState NOT_STARTED
The wrapper has been created but theTorWrapper.start()method has not yet been called. This is the initial state.
-
STARTING
public static final TorWrapper.TorState STARTING
TheTorWrapper.start()method has been called and the Tor process is starting.
-
STARTED
public static final TorWrapper.TorState STARTED
TheTorWrapper.start()method has been called and the Tor process has started.No connections to the Tor network will be made in this state. The wrapper remains in this state until
TorWrapper.enableNetwork(boolean)is called.
-
CONNECTING
public static final TorWrapper.TorState CONNECTING
The Tor process has started, its network connection is enabled, and it is connecting (or reconnecting) to the Tor network.
-
CONNECTED
public static final TorWrapper.TorState CONNECTED
The Tor process has started, its network connection is enabled, and it has connected to the Tor network. In this state it should be possible to make connections via the SOCKS port.
-
DISABLED
public static final TorWrapper.TorState DISABLED
The Tor process has started but its network connection is disabled.
-
STOPPING
public static final TorWrapper.TorState STOPPING
TheTorWrapper.stop()method has been called and the Tor process is stopping.
-
STOPPED
public static final TorWrapper.TorState STOPPED
TheTorWrapper.stop()method has been called and the Tor process has stopped.A new Tor process can be started by calling the
TorWrapper.start()method again.
-
-
Method Detail
-
values
public static TorWrapper.TorState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TorWrapper.TorState c : TorWrapper.TorState.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TorWrapper.TorState valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-