eu.emi.security.authn.x509.helpers.trust
Class TrustAnchorStoreBase

java.lang.Object
  extended by eu.emi.security.authn.x509.helpers.trust.TrustAnchorStoreBase
All Implemented Interfaces:
TrustAnchorStore
Direct Known Subclasses:
DirectoryTrustAnchorStore, JDKInMemoryTrustAnchorStore

public abstract class TrustAnchorStoreBase
extends Object
implements TrustAnchorStore

Base implementation of Trust Anchor stores. Provides two functions: - timed scheduling of trust anchor store refreshes (which can be disabled) - observers support

Author:
K. Benedyczak

Constructor Summary
TrustAnchorStoreBase(Timer timer, long updateInterval, Collection<? extends StoreUpdateListener> listeners)
           
 
Method Summary
 void addUpdateListener(StoreUpdateListener listener)
          Registers a listener which can react to errors found during refreshing of the trust material: trusted CAs or CRLs.
protected  void checkValidity(String location, X509Certificate certificate, boolean addSubject)
           
 void dispose()
          After calling this method no notification will be produced and subsequent updates won't be scheduled.
 long getUpdateInterval()
           
protected  void notifyObservers(String url, String type, StoreUpdateListener.Severity level, Exception e)
           
 void removeUpdateListener(StoreUpdateListener listener)
          Unregisters a previously registered CA or CRL update listener.
 void setUpdateInterval(long newInterval)
           
protected abstract  void update()
          implementation should update the contents of the trust anchor store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eu.emi.security.authn.x509.helpers.trust.TrustAnchorStore
getTrustAnchors, getTrustedCertificates
 

Constructor Detail

TrustAnchorStoreBase

public TrustAnchorStoreBase(Timer timer,
                            long updateInterval,
                            Collection<? extends StoreUpdateListener> listeners)
Method Detail

getUpdateInterval

public long getUpdateInterval()

setUpdateInterval

public void setUpdateInterval(long newInterval)

update

protected abstract void update()
implementation should update the contents of the trust anchor store. It need not to bother with scheduling.


addUpdateListener

public void addUpdateListener(StoreUpdateListener listener)
Registers a listener which can react to errors found during refreshing of the trust material: trusted CAs or CRLs. This method is useful only if the implementation supports updating of CAs or CRLs, otherwise the listener will not be invoked.

Specified by:
addUpdateListener in interface TrustAnchorStore
Parameters:
listener - to be registered

removeUpdateListener

public void removeUpdateListener(StoreUpdateListener listener)
Unregisters a previously registered CA or CRL update listener. If the listener was not registered then the method does nothing.

Specified by:
removeUpdateListener in interface TrustAnchorStore
Parameters:
listener - to be unregistered

notifyObservers

protected void notifyObservers(String url,
                               String type,
                               StoreUpdateListener.Severity level,
                               Exception e)

dispose

public void dispose()
After calling this method no notification will be produced and subsequent updates won't be scheduled. However one next update may be run.

Specified by:
dispose in interface TrustAnchorStore

checkValidity

protected void checkValidity(String location,
                             X509Certificate certificate,
                             boolean addSubject)


Copyright © 2012 European Middleware Initiative. All Rights Reserved.