|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jnetstream.capture.RemoteServer
public class RemoteServer
Allows remote capture sessions to be started from non-local system. The remote server listens for incomming client network connections on a network socket and after proper authentication opens up remote sessions with the clients. The RemoteServer also provides several methods that can be used on the client side for establishing a remote session with a running server on a remote system. Once a RemoteSession is created it can be used to do nearly everything that is possible as it all operations were local. The speed of the operations has to be taken into account as all operations are transmitted accross the network, in a client/server environment, including packet buffer data, which may take considerably longer then if the same operation was done using a local session created using Captures methods.
| Constructor Summary | |
|---|---|
protected |
RemoteServer()
|
|
RemoteServer(byte[] authentication)
Creates a remote server that listens on the default port for incomming connections and establishes RemoteSessions. |
|
RemoteServer(byte[] authentication,
RemoteSession.RemoteSessionFactory handler)
Creates a remote server that listens on the default port for incomming connections and establishes RemoteSessions. |
| Method Summary | |
|---|---|
void |
close()
Closes this remote server down and will stop listenting for any more incomming connections. |
void |
listen()
Listens on a network server socket for incomming connections. |
static RemoteSession |
openSession(java.net.URI uri)
Creates an unauthenticated, but connected session to the remote server. |
static RemoteSession |
openSession(java.net.URI uri,
byte[] authentication)
Creates an empty, but connected session to the remote server. |
protected void |
setHandler(RemoteSession.RemoteSessionFactory handler)
Changes the default handler which handles the incomming connection requests. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected RemoteServer()
public RemoteServer(byte[] authentication)
throws java.io.IOException
authentication - authentication pattern that all remote clients will have to authenticate
against
java.io.IOException
public RemoteServer(byte[] authentication,
RemoteSession.RemoteSessionFactory handler)
throws java.io.IOException
authentication - authentication pattern that all remote clients will have to authenticate
againsthandler - a custom handler that is registered to handle the work
java.io.IOException - any IO errors| Method Detail |
|---|
protected void setHandler(RemoteSession.RemoteSessionFactory handler)
handler - user supplied handler to handling incomming connections
public void listen()
throws java.io.IOException
java.io.IOException - any IO errors
public void close()
throws java.io.IOException
java.io.IOException - any IO errors
public static RemoteSession openSession(java.net.URI uri)
throws java.io.IOException,
RemoteAuthenticationException
server - server to connect toauthentication - authentication parameter used to authenticate the remote
session
RemoteAuthenticationException - if the server requires remote authentication this method will always
throw this exception
java.io.IOException
public static RemoteSession openSession(java.net.URI uri,
byte[] authentication)
throws java.io.IOException,
RemoteAuthenticationException
Creates an empty, but connected session to the remote server. At that point any of the RemoteSession commands can be invoked and new remote captures started. Here is a short example:
RemoteSession session = RemoteServer.openSession(new URI("192.168.1.100"));
LiveCapture capture = session.openLive();
while (capture.hasNext()) {
System.out.println("Got a packet=" + capture.next().toString());
}
session.close(); // Closes down everything
If the supplied authentication byte pattern does not authenticate the remote session correctly, RemoteAuthenticationException will be thrown.
server - server to connect toport - use the specified port instead of the default remote session
portauthentication - authentication parameter used to authenticate the remote
session
RemoteAuthenticationException - if the authentication fails with the server
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||