com.netscape.certsrv.request
Class ARequestNotifier

java.lang.Object
  extended by com.netscape.certsrv.request.ARequestNotifier
All Implemented Interfaces:
INotify, IRequestNotifier

public class ARequestNotifier
extends java.lang.Object
implements IRequestNotifier

The ARequestNotifier class implements the IRequestNotifier interface, which notifies all registered request listeners.

Version:
$Revision: 1665 $, $Date: 2010-12-22 16:35:59 -0800 (Wed, 22 Dec 2010) $

Constructor Summary
ARequestNotifier()
           
ARequestNotifier(ICertificateAuthority ca)
           
 
Method Summary
 void addToNotify(IRequest r)
          Notifies all registered listeners about request.
 IRequestListener getListener(java.lang.String name)
          Gets listener from the list of registered listeners.
 java.util.Enumeration getListenerNames()
          Gets list of listener names.
 java.util.Enumeration getListeners()
          Gets list of listeners.
 int getNumberOfRequests()
          Gets number of requests in publishing queue.
 IRequest getRequest()
          Gets request from publishing queue.
 boolean isPublishingQueueEnabled()
          Checks if publishing queue is enabled.
 void notify(IRequest r)
          Notifies all registered listeners about request.
 void recoverPublishingQueue(java.lang.String id)
          Recovers publishing queue.
 void registerListener(IRequestListener listener)
          Registers a request listener.
 void registerListener(java.lang.String name, IRequestListener listener)
          Registers a request listener.
 void removeListener(IRequestListener listener)
          Removes listener from the list of registered listeners.
 void removeListener(java.lang.String name)
          Removes listener from the list of registered listeners.
 void removeNotifierThread(java.lang.Thread notifierThread)
          Removes a notifier thread from the pool of publishing queue threads.
 void setPublishingQueue(boolean isPublishingQueueEnabled, int publishingQueuePriorityLevel, int maxNumberOfPublishingThreads, int publishingQueuePageSize, int savePublishingStatus)
          Sets publishing queue parameters.
 void updatePublishingStatus(java.lang.String id)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ARequestNotifier

public ARequestNotifier()

ARequestNotifier

public ARequestNotifier(ICertificateAuthority ca)
Method Detail

setPublishingQueue

public void setPublishingQueue(boolean isPublishingQueueEnabled,
                               int publishingQueuePriorityLevel,
                               int maxNumberOfPublishingThreads,
                               int publishingQueuePageSize,
                               int savePublishingStatus)
Description copied from interface: IRequestNotifier
Sets publishing queue parameters.

Specified by:
setPublishingQueue in interface IRequestNotifier
Parameters:
isPublishingQueueEnabled - publishing queue switch
publishingQueuePriorityLevel - publishing queue priority level
maxNumberOfPublishingThreads - maximum number of publishing threads
publishingQueuePageSize - publishing queue page size

registerListener

public void registerListener(IRequestListener listener)
Registers a request listener.

Specified by:
registerListener in interface IRequestNotifier
Parameters:
listener - listener to be registered

registerListener

public void registerListener(java.lang.String name,
                             IRequestListener listener)
Registers a request listener.

Specified by:
registerListener in interface IRequestNotifier
Parameters:
name - listener name
listener - listener to be registered

removeListener

public void removeListener(IRequestListener listener)
Removes listener from the list of registered listeners.

Specified by:
removeListener in interface IRequestNotifier
Parameters:
listener - listener to be removed from the list

getListenerNames

public java.util.Enumeration getListenerNames()
Gets list of listener names.

Specified by:
getListenerNames in interface IRequestNotifier
Returns:
enumeration of listener names

removeListener

public void removeListener(java.lang.String name)
Removes listener from the list of registered listeners.

Specified by:
removeListener in interface IRequestNotifier
Parameters:
name - listener name to be removed from the list

getListener

public IRequestListener getListener(java.lang.String name)
Gets listener from the list of registered listeners.

Specified by:
getListener in interface IRequestNotifier
Parameters:
name - listener name
Returns:
listener

getListeners

public java.util.Enumeration getListeners()
Gets list of listeners.

Specified by:
getListeners in interface IRequestNotifier
Returns:
enumeration of listeners

updatePublishingStatus

public void updatePublishingStatus(java.lang.String id)
Specified by:
updatePublishingStatus in interface IRequestNotifier

getRequest

public IRequest getRequest()
Gets request from publishing queue.

Specified by:
getRequest in interface IRequestNotifier
Returns:
request

getNumberOfRequests

public int getNumberOfRequests()
Gets number of requests in publishing queue.

Specified by:
getNumberOfRequests in interface IRequestNotifier
Returns:
number of requests in publishing queue

isPublishingQueueEnabled

public boolean isPublishingQueueEnabled()
Checks if publishing queue is enabled.

Specified by:
isPublishingQueueEnabled in interface IRequestNotifier
Returns:
true if publishing queue is enabled, false otherwise

removeNotifierThread

public void removeNotifierThread(java.lang.Thread notifierThread)
Removes a notifier thread from the pool of publishing queue threads.

Specified by:
removeNotifierThread in interface IRequestNotifier
Parameters:
notifierThread - Thread

notify

public void notify(IRequest r)
Notifies all registered listeners about request.

Specified by:
notify in interface INotify
Parameters:
r - request

addToNotify

public void addToNotify(IRequest r)
Notifies all registered listeners about request.

Specified by:
addToNotify in interface IRequestNotifier
Parameters:
r - request

recoverPublishingQueue

public void recoverPublishingQueue(java.lang.String id)
Recovers publishing queue.

Parameters:
id - request request