org.elkoserver.server.gatekeeper
Interface Authorizer

All Known Implementing Classes:
PasswdAuthorizer

public interface Authorizer

Interface implemented by classes that provide an authorization policy and mechanism to the Gatekeeper.

The Gatekeeper does not intrinsically implement any particular means of authenticating and authorizing the users for whom it is handling reservations. Instead, it calls upon an object implementing this interface, which it instantiates at server startup time. The server takes the fully qualified class name of the class of Authorizer to instantiate from the "conf.gatekeeper.authorizer" configuration property.

In addition to implementing this interface, an Authorizer class must also provide a zero-argument constructor).


Method Summary
 void initialize(Gatekeeper gatekeeper)
          Do whatever initialization is required to begin issuing reservations.
 void reserve(String protocol, String context, String id, String name, String password, ReservationResultHandler handler)
          Service a request to make a reservation.
 void setPassword(String id, String oldPassword, String newPassword, SetPasswordResultHandler handler)
          Service a request to change a user's password.
 void shutdown()
          Do any work required prior to shutting down the server.
 

Method Detail

initialize

void initialize(Gatekeeper gatekeeper)
Do whatever initialization is required to begin issuing reservations. This method will be called once by the Gatekeeper as part of its startup procedure.

Parameters:
gatekeeper - The Gatekeeper this Authorizer is providing authorization services for.

reserve

void reserve(String protocol,
             String context,
             String id,
             String name,
             String password,
             ReservationResultHandler handler)
Service a request to make a reservation. This method will be called each time the Gatekeeper receives a 'reserve' request from a client. The various parameters are extracted from that message. The result, once available, should be passed to the object specified by the 'handler' parameter, by invoking the handler's handleReservation() method.

Parameters:
protocol - The protocol the reservation seeker wants to use.
context - The context they wish to enter.
id - The user who is asking for the reservation.
name - Optional legible name for the user.
password - Password tendered for entry, if relevent.
handler - Object to receive results of reservation check, once available.

setPassword

void setPassword(String id,
                 String oldPassword,
                 String newPassword,
                 SetPasswordResultHandler handler)
Service a request to change a user's password. This method will be called each time the Gatekeeper recieves a 'setpassword' request from a client. The various parameters are extracted from that message. The result, once available, should be passed to the object specified by the 'handler' parameter, by invoking the handler's handle() method.

Parameters:
id - The user who is asking for this.
oldPassword - Current password, to check for permission.
newPassword - The new password.
handler - Object to receive results, when done.

shutdown

void shutdown()
Do any work required prior to shutting down the server. This method will be called by the Gatekeeper as part of its orderly shutdown procedure.