com.rbnb.sapi
Class Control

java.lang.Object
  extended by com.rbnb.sapi.Client
      extended by com.rbnb.sapi.Control
All Implemented Interfaces:
Serializable

public class Control
extends Client

A client for controlling RBNB server behavior.

Since:
V3.1
See Also:
Serialized Form
Author:
WHF

Nested Class Summary
static class Control.AccessControlEntry
          An element in a list of internet hosts which define permitted access to an RBNB server.
static class Control.Mirror
          A representation of a 'mirror', which copies data from one server to another.
 
Constructor Summary
Control()
           
 
Method Summary
 long BytesTransferred()
          Reports the total number of bytes read and written by this Client.
static Vector CreateACLFromStream(Reader isRead)
          Create an access control list from a character stream.
static Control.AccessControlEntry CreateAllowEntry(String address, String permissions)
          Create a new access control entry that allows access.
static Control.AccessControlEntry CreateDenyEntry(String address)
          Create a new access control entry that forbids access.
 Control.Mirror CreateMirrorIn(String remoteServer, String remoteSource, String localName)
          Creates a mirror to copy data from a source on the specified server address to the connected server.
 Control.Mirror CreateMirrorOut(String localSource, String remoteServer, String remoteName)
          Creates a mirror to copy data from a local source to the specified remote server.
 Vector GetAccessControlList()
          Obtains a list of access control entries from the connected server.
 void SetAccessControlList(Vector list)
          Sets the access control list on the server.
 void Terminate(String name)
          Stops the object with the given name.
 void TerminateServer()
          Stops the server to which this Control is connected.
 
Methods inherited from class com.rbnb.sapi.Client
CloseRBNBConnection, CloseRBNBConnection, GetArchiveMode, GetArchiveSize, GetCacheSize, GetChannelList, GetChannelList, GetClientName, GetServerName, OpenRBNBConnection, OpenRBNBConnection, OpenRBNBConnection, SetRingBuffer, VerifyConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Control

public Control()
Method Detail

CreateMirrorIn

public Control.Mirror CreateMirrorIn(String remoteServer,
                                     String remoteSource,
                                     String localName)
                              throws SAPIException
Creates a mirror to copy data from a source on the specified server address to the connected server.

Throws:
SAPIException

CreateMirrorOut

public Control.Mirror CreateMirrorOut(String localSource,
                                      String remoteServer,
                                      String remoteName)
                               throws SAPIException
Creates a mirror to copy data from a local source to the specified remote server.

Throws:
SAPIException

Terminate

public void Terminate(String name)
               throws SAPIException
Stops the object with the given name. It may be a server or any sort of client.

Note: this method returns after the server has acknowledged receipt of the command, but before the server executes the task. Thus the actual shutdown of the object will occur asynchronously.

Throws:
SAPIException

TerminateServer

public void TerminateServer()
                     throws SAPIException
Stops the server to which this Control is connected.

Throws:
SAPIException

GetAccessControlList

public Vector GetAccessControlList()
                            throws SAPIException
Obtains a list of access control entries from the connected server.

Throws:
SAPIException

SetAccessControlList

public void SetAccessControlList(Vector list)
                          throws SAPIException
Sets the access control list on the server.

Throws:
IllegalArgumentException - if any element in the vector is not an instance of Control.AccessControlEntry.
SAPIException

BytesTransferred

public long BytesTransferred()
Description copied from class: Client
Reports the total number of bytes read and written by this Client.

Specified by:
BytesTransferred in class Client
Returns:
The total number of bytes read and written.

CreateAllowEntry

public static Control.AccessControlEntry CreateAllowEntry(String address,
                                                          String permissions)
Create a new access control entry that allows access. The permissions object is optional. If specified it should be one or more of the following: If not set it is as if all these options were specified.

See the RBNB Server documentation for more details.


CreateDenyEntry

public static Control.AccessControlEntry CreateDenyEntry(String address)
Create a new access control entry that forbids access.


CreateACLFromStream

public static Vector CreateACLFromStream(Reader isRead)
                                  throws IOException
Create an access control list from a character stream.

Throws:
IOException