authorization
Class ProcedureHandler

java.lang.Object
  extended by com.wrq.vhi.script.api.ProcedureEventHandler
      extended by authorization.ProcedureHandler
All Implemented Interfaces:
com.wrq.vhi.script.api.EventHandler

public class ProcedureHandler
extends com.wrq.vhi.script.api.ProcedureEventHandler

Guard access to a table procedure.

This ProcedureEventHandler is attached to any table procedure which needs to have access restricted to particular clients (users). In this example, this event handler is attached to all table procedures. Before access is granted to the procedure, the client user name is used as a key to look up the capabilities for that user. Access is granted to the table procedure only if the client has been granted that capability.


Field Summary
static java.lang.String description
           
 
Fields inherited from interface com.wrq.vhi.script.api.EventHandler
DEFAULT_TIMEOUT
 
Constructor Summary
ProcedureHandler()
           
 
Method Summary
 com.wrq.vhi.script.api.ProcedureRecordSet executeProcedure(com.wrq.vhi.script.api.ExecuteProcedureEvent event)
          Execute a procedure only if the client is authorized to do so.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

description

public static final java.lang.String description
See Also:
Constant Field Values
Constructor Detail

ProcedureHandler

public ProcedureHandler()
Method Detail

executeProcedure

public com.wrq.vhi.script.api.ProcedureRecordSet executeProcedure(com.wrq.vhi.script.api.ExecuteProcedureEvent event)
                                                           throws com.wrq.apptrieve.agent.ApptrieveException
Execute a procedure only if the client is authorized to do so.

This event handler retrieves the user name and the procedure name and permits access to the procedure only if the procedure name appears in the user's "capability" list.

Overrides:
executeProcedure in class com.wrq.vhi.script.api.ProcedureEventHandler
Parameters:
event - the event instance
Returns:
the procedure result
Throws:
com.wrq.apptrieve.agent.ApptrieveException