org.elkoserver.server.gatekeeper
Class Gatekeeper

java.lang.Object
  extended by org.elkoserver.server.gatekeeper.Gatekeeper

public class Gatekeeper
extends Object

The Gatekeeper itself as presented to its configured Authorizer object. This is the Authorizer's linkage back to the systems that do most of the real work in the Gatekeeper.


Method Summary
 void ensureAuthorizedAdmin(BasicProtocolActor from)
          Guard function to guarantee that an operation is being attempted by an actor who is authorized to do admin operations.
 ObjDB openObjectDatabase(String propRoot)
          Open an asynchronous database.
 BootProperties properties()
          Get the server's configuration properties.
 RefTable refTable()
          Get the object reference table for this gatekeeper.
 void requestReservation(String protocol, String context, String actor, ArgRunnable handler)
          Issue a request for a reservation to the Director.
 String serverName()
          Get the Gatekeeper's name.
 Trace trace()
          Get the trace object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

ensureAuthorizedAdmin

public void ensureAuthorizedAdmin(BasicProtocolActor from)
                           throws MessageHandlerException
Guard function to guarantee that an operation is being attempted by an actor who is authorized to do admin operations.

Throws:
MessageHandlerException - if this actor is not authorized to perform administrative operations.

openObjectDatabase

public ObjDB openObjectDatabase(String propRoot)
Open an asynchronous database. The location of the database (directory path or remote repository host) is specified by properties.

Parameters:
propRoot - Prefix string for all the properties describing the database that is to be opened.
Returns:
an object for communicating with the open database, or null if the database location was not properly specified.

properties

public BootProperties properties()
Get the server's configuration properties.

Returns:
the configuration properties table for this server invocation.

refTable

public RefTable refTable()
Get the object reference table for this gatekeeper.

Returns:
the object reference table.

requestReservation

public void requestReservation(String protocol,
                               String context,
                               String actor,
                               ArgRunnable handler)
Issue a request for a reservation to the Director.

Parameters:
protocol - The protocol for the requested reservation (i.e., the protocol that the client wishes to speak to the server providing the context).
context - The requested context.
actor - The requested actor.
handler - Object to handle the reservation result. When the result becomes available, it will be passed as an instance of ReservationResult.

serverName

public String serverName()
Get the Gatekeeper's name. This can be useful in diagnostic log messages and such.

Returns:
the server's name.

trace

public Trace trace()
Get the trace object. This is used for writing messages to the server log.

Returns:
the trace object for this server.