Package org.briarproject.onionwrapper
Class MacTorWrapper
java.lang.Object
org.briarproject.onionwrapper.UnixTorWrapper
org.briarproject.onionwrapper.MacTorWrapper
- All Implemented Interfaces:
net.freehaven.tor.control.EventHandler,org.briarproject.onionwrapper.TorWrapper
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.briarproject.onionwrapper.TorWrapper
org.briarproject.onionwrapper.TorWrapper.HiddenServiceProperties, org.briarproject.onionwrapper.TorWrapper.Observer, org.briarproject.onionwrapper.TorWrapper.TorState -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected final Executorprotected final Executorprotected final org.briarproject.onionwrapper.AbstractTorWrapper.NetworkStateprotected final FileFields inherited from interface org.briarproject.onionwrapper.TorWrapper
LOG -
Constructor Summary
ConstructorsConstructorDescriptionMacTorWrapper(Executor ioExecutor, Executor eventExecutor, String architecture, File torDirectory, int torSocksPort, int torControlPort) -
Method Summary
Modifier and TypeMethodDescriptionvoidbandwidthUsed(long arg0, long arg1) voidcircuitStatus(String arg0, String arg1, String arg2) voidvoidvoidenableBridges(List<String> arg0) voidenableConnectionPadding(boolean arg0) voidenableIpv6(boolean arg0) voidenableNetwork(boolean arg0) protected voidextract(InputStream in, File dest) protected Stringprotected InputStreamprotected longprotected InputStreamgetResourceInputStream(String name, String extension) protected Fileorg.briarproject.onionwrapper.TorWrapper.TorStateprotected voidprotected voidbooleanvoidvoidnewDescriptors(List<String> arg0) voidorConnStatus(String arg0, String arg1) org.briarproject.onionwrapper.TorWrapper.HiddenServicePropertiespublishHiddenService(int arg0, int arg1, String arg2) voidremoveHiddenService(String arg0) voidsetObserver(org.briarproject.onionwrapper.TorWrapper.Observer arg0) voidstart()voidstop()voidstreamStatus(String arg0, String arg1, String arg2) voidunrecognized(String arg0, String arg1) protected voidwaitForTorToStart(Process arg0) Methods inherited from class org.briarproject.onionwrapper.UnixTorWrapper
getProcessId
-
Field Details
-
ioExecutor
-
eventExecutor
-
architecture
-
torDirectory
-
state
protected final org.briarproject.onionwrapper.AbstractTorWrapper.NetworkState state
-
-
Constructor Details
-
MacTorWrapper
public MacTorWrapper(Executor ioExecutor, Executor eventExecutor, String architecture, File torDirectory, int torSocksPort, int torControlPort) - Parameters:
ioExecutor- The wrapper will use this executor to run IO tasks, some of which may run for the lifetime of the wrapper, so the executor should have an unlimited thread pool.eventExecutor- The wrapper will use this executor to call theobserver(if any). To ensure that events are observed in the order they occur, this executor should have a single thread (eg the app's main thread).architecture- The processor architecture of the Tor and pluggable transport binaries.torDirectory- The directory where the Tor process should keep its state.torSocksPort- The port number to use for Tor's SOCKS port.torControlPort- The port number to use for Tor's control port.
-
-
Method Details
-
installTorExecutable
- Throws:
IOException
-
extract
- Throws:
IOException
-
getLastUpdateTime
protected long getLastUpdateTime() -
getResourceInputStream
-
getTorExecutableFile
-
getLyrebirdExecutableFile
- Specified by:
getLyrebirdExecutableFilein interfaceorg.briarproject.onionwrapper.TorWrapper
-
setObserver
public void setObserver(@Nullable org.briarproject.onionwrapper.TorWrapper.Observer arg0) - Specified by:
setObserverin interfaceorg.briarproject.onionwrapper.TorWrapper
-
start
- Specified by:
startin interfaceorg.briarproject.onionwrapper.TorWrapper- Throws:
IOExceptionInterruptedException
-
installLyrebirdExecutable
- Throws:
IOException
-
getExecutableInputStream
-
getExecutableExtension
-
waitForTorToStart
- Throws:
InterruptedExceptionIOException
-
publishHiddenService
public org.briarproject.onionwrapper.TorWrapper.HiddenServiceProperties publishHiddenService(int arg0, int arg1, @Nullable String arg2) throws IOException - Specified by:
publishHiddenServicein interfaceorg.briarproject.onionwrapper.TorWrapper- Throws:
IOException
-
removeHiddenService
- Specified by:
removeHiddenServicein interfaceorg.briarproject.onionwrapper.TorWrapper- Throws:
IOException
-
enableNetwork
- Specified by:
enableNetworkin interfaceorg.briarproject.onionwrapper.TorWrapper- Throws:
IOException
-
enableBridges
- Specified by:
enableBridgesin interfaceorg.briarproject.onionwrapper.TorWrapper- Throws:
IOException
-
disableBridges
- Specified by:
disableBridgesin interfaceorg.briarproject.onionwrapper.TorWrapper- Throws:
IOException
-
stop
- Specified by:
stopin interfaceorg.briarproject.onionwrapper.TorWrapper- Throws:
IOExceptionInterruptedException
-
circuitStatus
- Specified by:
circuitStatusin interfacenet.freehaven.tor.control.EventHandler
-
streamStatus
- Specified by:
streamStatusin interfacenet.freehaven.tor.control.EventHandler
-
orConnStatus
- Specified by:
orConnStatusin interfacenet.freehaven.tor.control.EventHandler
-
bandwidthUsed
public void bandwidthUsed(long arg0, long arg1) - Specified by:
bandwidthUsedin interfacenet.freehaven.tor.control.EventHandler
-
newDescriptors
- Specified by:
newDescriptorsin interfacenet.freehaven.tor.control.EventHandler
-
message
- Specified by:
messagein interfacenet.freehaven.tor.control.EventHandler
-
unrecognized
- Specified by:
unrecognizedin interfacenet.freehaven.tor.control.EventHandler
-
controlConnectionClosed
public void controlConnectionClosed()- Specified by:
controlConnectionClosedin interfacenet.freehaven.tor.control.EventHandler
-
enableConnectionPadding
- Specified by:
enableConnectionPaddingin interfaceorg.briarproject.onionwrapper.TorWrapper- Throws:
IOException
-
enableIpv6
- Specified by:
enableIpv6in interfaceorg.briarproject.onionwrapper.TorWrapper- Throws:
IOException
-
getTorState
public org.briarproject.onionwrapper.TorWrapper.TorState getTorState()- Specified by:
getTorStatein interfaceorg.briarproject.onionwrapper.TorWrapper
-
isTorRunning
public boolean isTorRunning()- Specified by:
isTorRunningin interfaceorg.briarproject.onionwrapper.TorWrapper
-