Constructor and Description |
---|
WgQuickBackend(android.content.Context context,
RootShell rootShell,
ToolsInstaller toolsInstaller) |
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
getRunningTunnelNames()
Enumerate names of currently-running tunnels.
|
Tunnel.State |
getState(Tunnel tunnel)
Get the state of a tunnel.
|
Statistics |
getStatistics(Tunnel tunnel)
Get statistics about traffic and errors on this tunnel.
|
java.lang.String |
getVersion()
Determine version of underlying backend.
|
void |
setMultipleTunnels(boolean on) |
Tunnel.State |
setState(Tunnel tunnel,
Tunnel.State state,
Config config)
Set the state of a tunnel, updating it's configuration.
|
public WgQuickBackend(android.content.Context context, RootShell rootShell, ToolsInstaller toolsInstaller)
public java.util.Set<java.lang.String> getRunningTunnelNames()
Backend
getRunningTunnelNames
in interface Backend
public Tunnel.State getState(Tunnel tunnel)
Backend
public Statistics getStatistics(Tunnel tunnel)
Backend
getStatistics
in interface Backend
tunnel
- The tunnel to retrieve statistics for.public java.lang.String getVersion() throws java.lang.Exception
Backend
getVersion
in interface Backend
java.lang.Exception
- Exception raised while retrieving version.public void setMultipleTunnels(boolean on)
public Tunnel.State setState(Tunnel tunnel, Tunnel.State state, @Nullable Config config) throws java.lang.Exception
Backend
setState
in interface Backend
tunnel
- The tunnel to control the state of.state
- The new state for this tunnel. Must be UP
, DOWN
, or
TOGGLE
.config
- The configuration for this tunnel, may be null if state is DOWN
.java.lang.Exception
- Exception raised while changing state.