com.ibm.security.certclient.base

Class PkSource

  1. java.lang.Object
  2. extended bycom.ibm.security.certclient.base.PkSource
Direct known subclasses:
PkActiveSource, PkPipe

  1. public class PkSource
  2. extends Object
A PkSource is the superclass of instances that can be a source of PkEvents. It contains functionality to add, remove and replace PkListeners and to propagate events to the listener. Only one listener is allowed.
Author:
Rod Mancisidor

Field Summary

Modifier and Type Field and Description
  1. protected
  2. boolean
isInitialized
Boolean to protect against more than one initialization.

Constructor Summary

Constructor and Description
PkSource()
Create a PkSource that has as its listener a PkSink.instance.

Method Summary

Modifier and Type Method and Description
  1. void
addPkListener(PkListener listener)
Adds a listener to this source.
  1. protected
  2. void
init(int level,PkAttrs attrs)
Initialize this bean.
  1. void
initialize(int level,PkAttrs attrs)
First method invoked on a bean.
  1. protected
  2. void
initNext(int level,PkAttrs attrs)
Initialize the listener(s).
  1. PkCertRepEvent
propagate(PkCertReqEvent req)
Propagates the request to the listener, returns whatever reply the listener returns.
  1. PkGnrlRepEvent
propagate(PkGnrlReqEvent req)
Propagates the request to the listener, returns whatever reply the listener returns.
  1. PkHttpRepEvent
propagate(PkHttpReqEvent req)
Propagates the request to the listener, returns whatever reply the listener returns.
  1. PkInitRepEvent
propagate(PkInitReqEvent req)
Propagates the request to the listener, returns whatever reply the listener returns.
  1. PkKrecRepEvent
propagate(PkKrecReqEvent req)
Propagates the request to the listener, returns whatever reply the listener returns.
  1. PkKupdRepEvent
propagate(PkKupdReqEvent req)
Propagates the request to the listener, returns whatever reply the listener returns.
  1. PkCertRepEvent
propagate(PkPollReqEvent req)
Propagates the request to the listener, returns whatever reply the listener returns.
  1. PkRepEvent
propagate(PkReqEvent req)
Propagates the request to the listener, returns whatever reply the listener returns.
  1. PkRevoRepEvent
propagate(PkRevoReqEvent req)
Propagates the request to the listener, returns whatever reply the listener returns.
  1. PkSecnRepEvent
propagate(PkSecnReqEvent req)
Propagates the request to the listener, returns whatever reply the listener returns.
  1. PkXcerRepEvent
propagate(PkXcerReqEvent req)
Propagates the request to the listener, returns whatever reply the listener returns.
  1. void
removePkListener(PkListener listener)
Removes the listener from this source.
  1. void
replacePkListener(PkListener listener)
Replaces the current listener with a new one.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

isInitialized

  1. protected boolean isInitialized
Boolean to protect against more than one initialization.

Initialization always takes place in the context of a single thread, so this field needs no synchronization

Constructor Detail

PkSource

  1. public PkSource()
Create a PkSource that has as its listener a PkSink.instance.

Method Detail

initialize

  1. public void initialize(int level,
  2. PkAttrs attrs)
  3. throws PkException
First method invoked on a bean. It can be used to initialize the bean. This method may be invoked more than once. Beans that have been positioned earlier in the pipeline have their init method invoked before beans that come later in the pipeline, although the algorithm is depth-first, so if there are distributors (PkSwitch, PkIfThenElse) in the pipeline, one branch will be fully initialized before the other. The initialize method is meant to first invoke the init method and then potentially invoke the initialize method on the Pklisteners to this bean.
Parameters:
level - the level of the bean in the pipeline. 0 implies the bean is a PkActiveSource. 1 is given to the next bean after the active source, and so on.
attrs - a set of parameters that can be used to place information that is used by beans downstream during initialization.
Throws:

init

  1. protected void init(int level,
  2. PkAttrs attrs)
  3. throws PkException
Initialize this bean. The default implementation is empty.
Parameters:
level - the level of the bean in the pipeline. 0 implies the bean is a PkActiveSource. 1 is given to the next bean after the active source, and so on.
attrs - a set of parameters that can be used to place information that is used by beans downstream during initialization.
Throws:

initNext

  1. protected void initNext(int level,
  2. PkAttrs attrs)
  3. throws PkException
Initialize the listener(s). The default implementation initializes the listener as defined in PkSource.
Parameters:
level - the level of the bean in the pipeline. 0 implies the bean is a PkActiveSource. 1 is given to the next bean after the active source, and so on.
attrs - a set of parameters that can be used to place information that is used by beans downstream during initialization.
Throws:

propagate

  1. public final PkRepEvent propagate( PkReqEvent req)
  2. throws PkException
Propagates the request to the listener, returns whatever reply the listener returns.
Throws:

propagate

  1. public final PkHttpRepEvent propagate( PkHttpReqEvent req)
  2. throws PkException
Propagates the request to the listener, returns whatever reply the listener returns.
Throws:

propagate

  1. public final PkCertRepEvent propagate( PkPollReqEvent req)
  2. throws PkException
Propagates the request to the listener, returns whatever reply the listener returns.
Throws:

propagate

  1. public final PkCertRepEvent propagate( PkCertReqEvent req)
  2. throws PkException
Propagates the request to the listener, returns whatever reply the listener returns.
Throws:

propagate

  1. public final PkInitRepEvent propagate( PkInitReqEvent req)
  2. throws PkException
Propagates the request to the listener, returns whatever reply the listener returns.
Throws:

propagate

  1. public final PkSecnRepEvent propagate( PkSecnReqEvent req)
  2. throws PkException
Propagates the request to the listener, returns whatever reply the listener returns.
Throws:

propagate

  1. public final PkKupdRepEvent propagate( PkKupdReqEvent req)
  2. throws PkException
Propagates the request to the listener, returns whatever reply the listener returns.
Throws:

propagate

  1. public final PkXcerRepEvent propagate( PkXcerReqEvent req)
  2. throws PkException
Propagates the request to the listener, returns whatever reply the listener returns.
Throws:

propagate

  1. public final PkGnrlRepEvent propagate( PkGnrlReqEvent req)
  2. throws PkException
Propagates the request to the listener, returns whatever reply the listener returns.
Throws:

propagate

  1. public final PkKrecRepEvent propagate( PkKrecReqEvent req)
  2. throws PkException
Propagates the request to the listener, returns whatever reply the listener returns.
Throws:

propagate

  1. public final PkRevoRepEvent propagate( PkRevoReqEvent req)
  2. throws PkException
Propagates the request to the listener, returns whatever reply the listener returns.
Throws:

addPkListener

  1. public void addPkListener(PkListener listener)
  2. throws TooManyListenersException
Adds a listener to this source. If there is already a listener, then throw TooManyListenersException.
Parameters:
listener - The listener to add.
Throws:
TooManyListenersException - if there is already a listener.

removePkListener

  1. public void removePkListener(PkListener listener)
Removes the listener from this source. If the listener passed in is not the current listener, then it fails silently.
Parameters:
listener - The listener to remove.

replacePkListener

  1. public void replacePkListener(PkListener listener)
Replaces the current listener with a new one.
Parameters:
listener - The replacement listener.