Java Globus API: Class CallbackHandler

org.globus.gara
Class CallbackHandler

java.lang.Object
  |
  +--org.globus.net.BaseServer
        |
        +--org.globus.gara.CallbackHandler
All Implemented Interfaces:
java.lang.Runnable

public class CallbackHandler
extends BaseServer

The Server class acts as a basic multi-threaded HTTPS server.

Version:
$Revision: 1.11 $

Fields inherited from class org.globus.net.BaseServer
_server, accept, authorization, credentials, deactivator, SO_TIMEOUT
 
Constructor Summary
CallbackHandler()
          Construct a GARA callback handler with default user credentials.
CallbackHandler(GlobusProxy proxy, int port)
          Construct a GARA callback handler with specifed credentials and given port.
 
Method Summary
 int getNumOfRegisteredReservations()
          Returns number of registered reservations
protected  GaraReservation getReservation(java.lang.String id)
           
 java.lang.String getURL()
          Returns url of the server.
protected  void handleConnection(java.net.Socket socket)
          This method needs to be implemented by subclasses.
 void registerReservation(GaraResourceManagerContact handle, GaraReservation reservation)
          Registers reservations for status updates
 void unregisterReservation(GaraResourceManagerContact handle)
          Unregisters reservation from status updates
protected  void unregisterReservation(java.lang.String id)
           
 
Methods inherited from class org.globus.net.BaseServer
getCredentials, getHostname, getPort, getProtocol, initialize, registerDefaultDeactivator, run, setAuthorization, shutdown, start, unregisterDefaultDeactivator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallbackHandler

public CallbackHandler()
                throws java.io.IOException,
                       GlobusProxyException
Construct a GARA callback handler with default user credentials. Port will be dynamically assigned.

CallbackHandler

public CallbackHandler(GlobusProxy proxy,
                       int port)
                throws java.io.IOException,
                       GlobusProxyException
Construct a GARA callback handler with specifed credentials and given port.
Parameters:
proxy - credentials to use. if null default user credentials will be used
port - server port to listen on. if set to 0 the port will be dynamically assigned
Method Detail

registerReservation

public void registerReservation(GaraResourceManagerContact handle,
                                GaraReservation reservation)
Registers reservations for status updates

unregisterReservation

public void unregisterReservation(GaraResourceManagerContact handle)
Unregisters reservation from status updates

getURL

public java.lang.String getURL()
Returns url of the server.
Overrides:
getURL in class BaseServer
Returns:
String url of the server

getNumOfRegisteredReservations

public int getNumOfRegisteredReservations()
Returns number of registered reservations
Returns:
int number of reservations

getReservation

protected GaraReservation getReservation(java.lang.String id)

unregisterReservation

protected void unregisterReservation(java.lang.String id)

handleConnection

protected void handleConnection(java.net.Socket socket)
Description copied from class: BaseServer
This method needs to be implemented by subclasses. Optimmaly, it should be a non-blocking call starting a separate thread to handle the client. Note that to start an SSL handshake, you need to call socket.getInput(Output) stream().
Overrides:
handleConnection in class BaseServer