|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.saucelabs.rest.SauceTunnel
public final class SauceTunnel
Represents a sauce tunnel server on the cloud.
This object internally holds the status information that it retrieved from the server,
and getter methods will work against this state information. To obtain the up-to-date
status information from the server, use the refresh() method.
| Method Summary | |
|---|---|
void |
connect(int remotePort,
java.lang.String localHost,
int localPort)
Establishes the remote-to-local port forwarding. |
void |
destroy()
Destroys the tunnel server. |
void |
disconnect(int remotePort)
Cancels the remote-to-local port forwarding. |
void |
disconnectAll()
Shuts down all the SSH tunnels opened between the sauce tunnel server and this JVM. |
java.util.Date |
getCreationTime()
Returns the timestamp when this tunnel was created. |
java.util.List<java.lang.String> |
getDomainNames()
Gets the list of the domain names that this tunnel maps to. |
java.lang.String |
getHost()
Gets the tunnel host name inside the Sauce OnDemand cloud. |
java.lang.String |
getId()
Gets the unique ID of this tunnel. |
java.util.Date |
getShutDownTime()
Returns the timestamp when this tunnel was destroyed. |
boolean |
isRunning()
Is this tunnel actively running? |
void |
refresh()
Retrieves the up-to-date status information by contacting the server. |
void |
waitUntilRunning(long timeout)
Waits until the tunnel transitions into the running state, or until the specified timeout expires. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public java.lang.String getId()
public java.util.Date getCreationTime()
throws java.io.IOException
java.io.IOException
public java.util.Date getShutDownTime()
throws java.io.IOException
java.io.IOException
public java.lang.String getHost()
throws java.io.IOException
java.io.IOException
public java.util.List<java.lang.String> getDomainNames()
throws java.io.IOException
java.io.IOException
public boolean isRunning()
throws java.io.IOException
While it's unclear if all the possible states of the tunnel is a committed part of the API, the tunnel appears to transition from "booting" -> "running" -> "halting". This method returns true iff the status is "running".
Note that the status information isn't updated every time you call this method, so do not
call this method in a loop without calling refresh().
java.io.IOException
public void waitUntilRunning(long timeout)
throws java.io.IOException,
java.lang.InterruptedException
The method returns normally both in case of time out and successful tunnel start up.
Use isRunning() to verify the result.
timeout - number of milli-seconds to wait, or -1 to wait forever. Timeout is approximation and not
necessarily accurately honored.
java.io.IOException
java.lang.InterruptedException
public void destroy()
throws java.io.IOException
disconnectAll().
java.io.IOException
public void connect(int remotePort,
java.lang.String localHost,
int localPort)
throws java.io.IOException
java.io.IOException
public void disconnect(int remotePort)
throws java.io.IOException
java.io.IOExceptionpublic void disconnectAll()
destroy().
public void refresh()
throws java.io.IOException
java.io.IOException - If the communication fails, or if the tunnel no longer exists.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||