Class RequestSubsystem

  • All Implemented Interfaces:
    ISubsystem

    public class RequestSubsystem
    extends java.lang.Object
    implements ISubsystem
    RequestSubsystem

    This class is responsible for managing storage of request objects in the local database.

    TODO: review this It provides: + registration of LDAP/JAVA mapping classes with the DBSubsystem + creation of RequestQueue storage in the database + retrieval of existing RequestQueue objects from the database

    Version:
    $Revision$, $Date$
    Author:
    thayes
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ID  
      static org.slf4j.Logger logger  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected com.netscape.certsrv.dbs.IDBSSession createDBSSession()  
      void createRequestQueue​(java.lang.String name)
      Creates a new request queue.
      IConfigStore getConfigStore()
      Returns the root configuration storage of this system.
      java.lang.String getId()
      Implements ISubsystem.getId
      com.netscape.certsrv.request.IRequestQueue getRequestQueue​(java.lang.String name, int increment, com.netscape.certsrv.request.IPolicy p, com.netscape.certsrv.request.IService s, com.netscape.certsrv.request.INotify n, com.netscape.certsrv.request.INotify pendingNotifier)
      Retrieves a request queue.
      void init​(IConfigStore config)
      Initializes this subsystem with the given configuration store.
      protected java.lang.String makeQueueName​(java.lang.String name)  
      void setId​(java.lang.String id)
      Sets specific to this subsystem.
      void shutdown()
      Stops this system.
      void startup()
      Implements ISubsystem.startup
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        public static org.slf4j.Logger logger
    • Constructor Detail

      • RequestSubsystem

        public RequestSubsystem()
    • Method Detail

      • createRequestQueue

        public void createRequestQueue​(java.lang.String name)
                                throws EBaseException
        Creates a new request queue. (Currently unimplemented. Just use getRequestQueue to create an in-memory queue.)

        Parameters:
        name - The name of the queue object. This name can be used in getRequestQueue to retrieve the queue later.
        Throws:
        EBaseException - failed to create request queue
      • getRequestQueue

        public com.netscape.certsrv.request.IRequestQueue getRequestQueue​(java.lang.String name,
                                                                          int increment,
                                                                          com.netscape.certsrv.request.IPolicy p,
                                                                          com.netscape.certsrv.request.IService s,
                                                                          com.netscape.certsrv.request.INotify n,
                                                                          com.netscape.certsrv.request.INotify pendingNotifier)
                                                                   throws EBaseException
        Retrieves a request queue. This operation should only be done once on each queue. For example, the RA subsystem should retrieve its queue, and store it somewhere for use by related services, and servlets.

        WARNING: retrieving the same queue twice with result in multi-thread race conditions.

        Parameters:
        name - the name of the request queue. (Ex: "ca" "ra")
        p - A policy enforcement module. This object is called to make adjustments to the request, and decide whether it needs agent approval.
        s - The service object. This object actually performs the request after it is finalized and approved.
        n - A notifier object (optional). The notify() method of this object is invoked when the request is completed (COMPLETE, REJECTED or CANCELED states).
        pendingNotifier - A notifier object (optional). Like the 'n' argument, except the notification happens if the request is made PENDING. May be the same as the 'n' argument if desired.
        Throws:
        EBaseException - failed to retrieve request queue
      • getId

        public java.lang.String getId()
        Implements ISubsystem.getId

        Specified by:
        getId in interface ISubsystem
        Returns:
        subsystem identifier
        See Also:
        ISubsystem.getId()
      • setId

        public void setId​(java.lang.String id)
                   throws EBaseException
        Description copied from interface: ISubsystem
        Sets specific to this subsystem.
        Specified by:
        setId in interface ISubsystem
        Parameters:
        id - subsystem identifier
        Throws:
        EBaseException - failed to set id
      • init

        public void init​(IConfigStore config)
        Description copied from interface: ISubsystem
        Initializes this subsystem with the given configuration store.

        Specified by:
        init in interface ISubsystem
        Parameters:
        config - configuration store
      • shutdown

        public void shutdown()
        Description copied from interface: ISubsystem
        Stops this system. The owner may call shutdown anytime after initialization.

        Specified by:
        shutdown in interface ISubsystem
      • getConfigStore

        public IConfigStore getConfigStore()
        Description copied from interface: ISubsystem
        Returns the root configuration storage of this system.

        Specified by:
        getConfigStore in interface ISubsystem
        Returns:
        configuration store of this subsystem
      • makeQueueName

        protected java.lang.String makeQueueName​(java.lang.String name)