be.SIRAPRISE.client
Class MonitorConnection

java.lang.Object
  extended by be.SIRAPRISE.client.MonitorConnection

public final class MonitorConnection
extends java.lang.Object

Class used to communicate between a program and the SIRA_PRISE monitor.

Author:
Erwin Smout

Constructor Summary
MonitorConnection(java.net.InetAddress netAddress, int monitorPort)
           
MonitorConnection(java.net.InetAddress netAddress, int monitorPort, java.util.Set<java.lang.String> signatureAlgorithmNames, java.lang.String clientID, Signer signer)
           
MonitorConnection(java.lang.String host, int monitorPort)
          Creates a monitor connection to the specified host and port for an anonymous client.
MonitorConnection(java.lang.String host, int monitorPort, java.util.Set<java.lang.String> signatureAlgorithmNames, java.lang.String clientID, Signer signer)
          Creates the monitor connection to the specified host and port.
 
Method Summary
 void end()
          Simply closes the connection.
 AbstractRelation execCommand(java.lang.String command, java.lang.String userID, Signer userIDSigner, boolean userIDAuthenticatedByClient)
          Sends a monitor command to the server and returns the result obtained.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MonitorConnection

public MonitorConnection(java.net.InetAddress netAddress,
                         int monitorPort)
                  throws CommunicationProtocolException,
                         java.io.IOException,
                         DBException
Parameters:
netAddress -
monitorPort -
Throws:
java.io.IOException
DBException
CommunicationProtocolException

MonitorConnection

public MonitorConnection(java.net.InetAddress netAddress,
                         int monitorPort,
                         java.util.Set<java.lang.String> signatureAlgorithmNames,
                         java.lang.String clientID,
                         Signer signer)
                  throws CommunicationProtocolException,
                         java.io.IOException,
                         DBException
Parameters:
netAddress -
monitorPort -
signatureAlgorithmNames -
clientID -
signer -
Throws:
java.io.IOException
DBException
CommunicationProtocolException

MonitorConnection

public MonitorConnection(java.lang.String host,
                         int monitorPort)
                  throws java.io.IOException,
                         CommunicationProtocolException,
                         DBException
Creates a monitor connection to the specified host and port for an anonymous client.

Parameters:
host - The identification of the host. It may either be its DNS name or its ip address in dotted decimal.
monitorPort - The port to which to connect.
Throws:
java.io.IOException
CommunicationProtocolException
DBException

MonitorConnection

public MonitorConnection(java.lang.String host,
                         int monitorPort,
                         java.util.Set<java.lang.String> signatureAlgorithmNames,
                         java.lang.String clientID,
                         Signer signer)
                  throws java.io.IOException,
                         CommunicationProtocolException,
                         DBException
Creates the monitor connection to the specified host and port.

Parameters:
host - The identification of the host. It may either be its DNS name or its ip address in dotted decimal.
monitorPort - The port to which to connect.
signatureAlgorithmNames - The set of Signature algorithm names that can be used to authenticate the client
clientID - The client ID
signer - The object that will be called upon to compute the authentication signature
Throws:
java.io.IOException
CommunicationProtocolException
DBException
Method Detail

end

public void end()
         throws DBException
Simply closes the connection.

Throws:
DBException - If the sira_prise monitor reports an error it encountered

execCommand

public AbstractRelation execCommand(java.lang.String command,
                                    java.lang.String userID,
                                    Signer userIDSigner,
                                    boolean userIDAuthenticatedByClient)
                             throws DBException
Sends a monitor command to the server and returns the result obtained. The monitor connection is immediately closed again.

Parameters:
command - The monitor command to be executed
userID - The Identification of the user issuing the request
userIDSigner - The Object that can be called upon to provide the private key needed to sign/authenticate user identity
userIDAuthenticatedByClient - true if the identity of the user has been authenticated by the client
Returns:
The result of the command
Throws:
DBException - If the sira_prise monitor reports an error it encountered