Class RequestQueue

  • All Implemented Interfaces:
    com.netscape.certsrv.request.IRequestQueue, com.netscape.certsrv.request.ldap.IRequestMod

    public class RequestQueue
    extends ARequestQueue
    implements com.netscape.certsrv.request.ldap.IRequestMod
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.slf4j.Logger logger  
      protected java.lang.String mBaseDN  
      protected com.netscape.cmscore.request.RequestRepository mRepository  
    • Constructor Summary

      Constructors 
      Constructor Description
      RequestQueue​(DBSubsystem dbSubsystem, 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 pendingNotify)  
    • Field Detail

      • logger

        public static org.slf4j.Logger logger
      • mBaseDN

        protected java.lang.String mBaseDN
      • mRepository

        protected com.netscape.cmscore.request.RequestRepository mRepository
    • Constructor Detail

      • RequestQueue

        public RequestQueue​(DBSubsystem dbSubsystem,
                            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 pendingNotify)
                     throws EBaseException
        Throws:
        EBaseException
    • Method Detail

      • newRequestId

        protected com.netscape.certsrv.request.RequestId newRequestId()
                                                               throws EBaseException
        Description copied from class: ARequestQueue
        Create a new (unique) RequestId. (abstract)

        This method must be implemented by the specialized class to generate a new id from data in the persistant store. This id is used to create a new request object.

        Specified by:
        newRequestId in class ARequestQueue
        Returns:
        a new RequestId object.
        Throws:
        EBaseException - indicates that creation of the new id could not be completed.
        See Also:
        RequestId
      • newEphemeralRequestId

        protected com.netscape.certsrv.request.RequestId newEphemeralRequestId()
        Description copied from class: ARequestQueue
        Create a new synchronous request ID
        Specified by:
        newEphemeralRequestId in class ARequestQueue
      • addRequest

        protected void addRequest​(com.netscape.certsrv.request.IRequest r)
                           throws EBaseException
        Description copied from class: ARequestQueue
        Add the request to the store. (abstract)

        This function is called when a new request immediately after creating a new request.

        Specified by:
        addRequest in class ARequestQueue
        Parameters:
        r - the request to add.
        Throws:
        EBaseException - TODO: this is not implemented yet
      • modifyRequest

        protected void modifyRequest​(com.netscape.certsrv.request.IRequest r)
        Description copied from class: ARequestQueue
        Modify the request in the store. (abstract)

        Update the persistant copy of this request with the current values in the object.

        Currently there are no hints for what has changed, so the entire request should be updated.

        Specified by:
        modifyRequest in class ARequestQueue
      • modRequestStatus

        public void modRequestStatus​(com.netscape.certsrv.request.IRequest r,
                                     com.netscape.certsrv.request.RequestStatus s)
        Description copied from interface: com.netscape.certsrv.request.ldap.IRequestMod
        Modifies request status.
        Specified by:
        modRequestStatus in interface com.netscape.certsrv.request.ldap.IRequestMod
        Parameters:
        r - request
        s - request status
      • modCreationTime

        public void modCreationTime​(com.netscape.certsrv.request.IRequest r,
                                    java.util.Date d)
        Description copied from interface: com.netscape.certsrv.request.ldap.IRequestMod
        Modifies request creation time.
        Specified by:
        modCreationTime in interface com.netscape.certsrv.request.ldap.IRequestMod
        Parameters:
        r - request
        d - date
      • modModificationTime

        public void modModificationTime​(com.netscape.certsrv.request.IRequest r,
                                        java.util.Date d)
        Description copied from interface: com.netscape.certsrv.request.ldap.IRequestMod
        Modifies request modification time.
        Specified by:
        modModificationTime in interface com.netscape.certsrv.request.ldap.IRequestMod
        Parameters:
        r - request
        d - date
      • resetSerialNumber

        public void resetSerialNumber​(java.math.BigInteger serial)
                               throws EBaseException
        Resets serial number.
        Specified by:
        resetSerialNumber in interface com.netscape.certsrv.request.IRequestQueue
        Throws:
        EBaseException
      • removeAllObjects

        public void removeAllObjects()
                              throws EBaseException
        Removes all objects with this repository.
        Specified by:
        removeAllObjects in interface com.netscape.certsrv.request.IRequestQueue
        Throws:
        EBaseException
      • getLastRequestIdInRange

        public java.math.BigInteger getLastRequestIdInRange​(java.math.BigInteger reqId_low_bound,
                                                            java.math.BigInteger reqId_upper_bound)
        Specified by:
        getLastRequestIdInRange in interface com.netscape.certsrv.request.IRequestQueue
      • findRequestBySourceId

        public com.netscape.certsrv.request.RequestId findRequestBySourceId​(java.lang.String id)
        Implements IRequestQueue.findRequestBySourceId

        Specified by:
        findRequestBySourceId in interface com.netscape.certsrv.request.IRequestQueue
        Parameters:
        id - a unique identifier for the record that is based on the source of the request, and possibly an identify assigned by the source.
        Returns:
        The requestid corresponding to this source id. null is returned if the source id does not exist.
        See Also:
        IRequestQueue.findRequestBySourceId(java.lang.String)
      • findRequestsBySourceId

        public com.netscape.certsrv.request.IRequestList findRequestsBySourceId​(java.lang.String id)
        Implements IRequestQueue.findRequestsBySourceId

        Specified by:
        findRequestsBySourceId in interface com.netscape.certsrv.request.IRequestQueue
        Parameters:
        id - an identifier for the record that is based on the source of the request
        Returns:
        A list of requests corresponding to this source id. null is returned if the source id does not exist.
        See Also:
        IRequestQueue.findRequestsBySourceId(java.lang.String)
      • getRawList

        protected java.util.Enumeration<com.netscape.certsrv.request.RequestId> getRawList()
        Description copied from class: ARequestQueue
        Get complete list of RequestId values found i this queue.

        This method can form the basis for creating other types of search/list operations (although there are probably more efficient ways of doing this. ARequestQueue implements default versions of some of the searching by using this method as a basis.

        TODO: return IRequestList -or- just use listRequests as the basic engine.

        Specified by:
        getRawList in class ARequestQueue
        Returns:
        an Enumeration that generates RequestId objects.
      • listRequestsByFilter

        public com.netscape.certsrv.request.IRequestList listRequestsByFilter​(java.lang.String f)
        Description copied from interface: com.netscape.certsrv.request.IRequestQueue
        Returns an enumerator that lists all RequestIds for requests that match the filter.

        NOTE: This interface will not be useful for large databases. This needs to be replace by a VLV (paged) search object.

        Specified by:
        listRequestsByFilter in interface com.netscape.certsrv.request.IRequestQueue
        Parameters:
        f - search filter
        Returns:
        request list
      • listRequestsByFilter

        public com.netscape.certsrv.request.IRequestList listRequestsByFilter​(java.lang.String f,
                                                                              int maxSize)
        Description copied from interface: com.netscape.certsrv.request.IRequestQueue
        Returns an enumerator that lists all RequestIds for requests that match the filter.

        NOTE: This interface will not be useful for large databases. This needs to be replace by a VLV (paged) search object.

        Specified by:
        listRequestsByFilter in interface com.netscape.certsrv.request.IRequestQueue
        Parameters:
        f - search filter
        maxSize - max size to return
        Returns:
        request list
      • listRequestsByFilter

        public com.netscape.certsrv.request.IRequestList listRequestsByFilter​(java.lang.String f,
                                                                              int maxSize,
                                                                              int timeLimit)
        Description copied from interface: com.netscape.certsrv.request.IRequestQueue
        Returns an enumerator that lists all RequestIds for requests that match the filter.

        NOTE: This interface will not be useful for large databases. This needs to be replace by a VLV (paged) search object.

        Specified by:
        listRequestsByFilter in interface com.netscape.certsrv.request.IRequestQueue
        Parameters:
        f - search filter
        maxSize - max size to return
        timeLimit - timeout value for the search
        Returns:
        request list
      • listRequestsByStatus

        public com.netscape.certsrv.request.IRequestList listRequestsByStatus​(com.netscape.certsrv.request.RequestStatus s)
        Description copied from class: ARequestQueue
        Implements IRequestQueue.listRequestsByStatus

        Should be overridden by the specialized class if a more efficient method is available for implementing this operation.

        Specified by:
        listRequestsByStatus in interface com.netscape.certsrv.request.IRequestQueue
        Overrides:
        listRequestsByStatus in class ARequestQueue
        Parameters:
        s - request status
        Returns:
        request list
        See Also:
        IRequestQueue.listRequestsByStatus(com.netscape.certsrv.request.RequestStatus)
      • getPagedRequests

        public com.netscape.certsrv.request.IRequestVirtualList getPagedRequests​(int pageSize)
        Description copied from interface: com.netscape.certsrv.request.IRequestQueue
        Gets a pageable list of IRequest entries in this queue.
        Specified by:
        getPagedRequests in interface com.netscape.certsrv.request.IRequestQueue
        Parameters:
        pageSize - page size
        Returns:
        request list
      • getPagedRequestsByFilter

        public com.netscape.certsrv.request.IRequestVirtualList getPagedRequestsByFilter​(java.lang.String filter,
                                                                                         int pageSize,
                                                                                         java.lang.String sortKey)
        Description copied from interface: com.netscape.certsrv.request.IRequestQueue
        Gets a pageable list of IRequest entries in this queue.
        Specified by:
        getPagedRequestsByFilter in interface com.netscape.certsrv.request.IRequestQueue
        Parameters:
        filter - search filter
        pageSize - page size
        sortKey - the attributes to sort by
        Returns:
        request list
      • getPagedRequestsByFilter

        public com.netscape.certsrv.request.IRequestVirtualList getPagedRequestsByFilter​(com.netscape.certsrv.request.RequestId from,
                                                                                         java.lang.String filter,
                                                                                         int pageSize,
                                                                                         java.lang.String sortKey)
        Description copied from interface: com.netscape.certsrv.request.IRequestQueue
        Gets a pageable list of IRequest entries in this queue.
        Specified by:
        getPagedRequestsByFilter in interface com.netscape.certsrv.request.IRequestQueue
        Parameters:
        from - request id to start with
        filter - search filter
        pageSize - page size
        sortKey - the attributes to sort by
        Returns:
        request list
      • getPagedRequestsByFilter

        public com.netscape.certsrv.request.IRequestVirtualList getPagedRequestsByFilter​(com.netscape.certsrv.request.RequestId from,
                                                                                         boolean jumpToEnd,
                                                                                         java.lang.String filter,
                                                                                         int pageSize,
                                                                                         java.lang.String sortKey)
        Description copied from interface: com.netscape.certsrv.request.IRequestQueue
        Gets a pageable list of IRequest entries in this queue. This jumps right to the end of the list
        Specified by:
        getPagedRequestsByFilter in interface com.netscape.certsrv.request.IRequestQueue
        Parameters:
        from - request id to start with
        jumpToEnd - jump to end of list (set fromId to null)
        filter - search filter
        pageSize - page size
        sortKey - the attributes to sort by
        Returns:
        request list
      • getRequestRepository

        public com.netscape.certsrv.dbs.repository.IRepository getRequestRepository()
        Description copied from interface: com.netscape.certsrv.request.IRequestQueue
        Gets request repository.
        Specified by:
        getRequestRepository in interface com.netscape.certsrv.request.IRequestQueue
        Returns:
        request repository
      • getPublishingStatus

        public java.lang.String getPublishingStatus()
        Specified by:
        getPublishingStatus in interface com.netscape.certsrv.request.IRequestQueue
      • setPublishingStatus

        public void setPublishingStatus​(java.lang.String status)
        Specified by:
        setPublishingStatus in interface com.netscape.certsrv.request.IRequestQueue