Package org.italiangrid.voms.store.impl
Class DefaultUpdatingVOMSTrustStore
java.lang.Object
org.italiangrid.voms.store.impl.DefaultVOMSTrustStore
org.italiangrid.voms.store.impl.DefaultUpdatingVOMSTrustStore
- All Implemented Interfaces:
Updateable,UpdatingVOMSTrustStore,VOMSTrustStore
public class DefaultUpdatingVOMSTrustStore
extends DefaultVOMSTrustStore
implements UpdatingVOMSTrustStore
A VOMS trust store that periodically updates itself. The update frequency is
set once at VOMS trust store creation time.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longDefault trust store update frequency (10 minutes).private final ScheduledExecutorServiceThe scheduler used to schedule the update tasks.private longThis trust store update frequency in milliseconds.Fields inherited from class org.italiangrid.voms.store.impl.DefaultVOMSTrustStore
CERTIFICATE_FILENAME_SUFFIX, DEFAULT_VOMS_DIR, listenerLock, LSC_FILENAME_SUFFIX, read, rwLock, write -
Constructor Summary
ConstructorsConstructorDescriptionBuilds a trust store.DefaultUpdatingVOMSTrustStore(long updateFrequency) Builds a trust store configured as defined in the parameters.DefaultUpdatingVOMSTrustStore(List<String> localTrustDirs) Builds a trust store configured as defined in the parameters.DefaultUpdatingVOMSTrustStore(List<String> localTrustDirs, long updateFrequency) Builds a trust store configured as defined in the parameters.DefaultUpdatingVOMSTrustStore(List<String> localTrustDirs, long updateFrequency, VOMSTrustStoreStatusListener listener) Builds a trust store configured as defined in the parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancel the background tasks which updates this store.longReturns the update frequency, in milliseconds, for this store.protected voidvoidupdate()Updates the information in this storeprotected voidupdateFrequencySanityChecks(long updateFrequency) Methods inherited from class org.italiangrid.voms.store.impl.DefaultVOMSTrustStore
buildDefaultTrustedDirs, getAACertificateBySubject, getAllLSCInfo, getLocalAACertificates, getLocalTrustedDirectories, getLSC, loadTrustInformation, setStatusListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.italiangrid.voms.store.VOMSTrustStore
getAACertificateBySubject, getAllLSCInfo, getLocalAACertificates, getLocalTrustedDirectories, getLSC, loadTrustInformation, setStatusListener
-
Field Details
-
DEFAULT_UPDATE_FREQUENCY
public static final long DEFAULT_UPDATE_FREQUENCYDefault trust store update frequency (10 minutes). -
updateFrequency
private long updateFrequencyThis trust store update frequency in milliseconds. -
scheduler
The scheduler used to schedule the update tasks.
-
-
Constructor Details
-
DefaultUpdatingVOMSTrustStore
public DefaultUpdatingVOMSTrustStore(List<String> localTrustDirs, long updateFrequency, VOMSTrustStoreStatusListener listener) Builds a trust store configured as defined in the parameters.- Parameters:
localTrustDirs- where VOMS trust information will be looked forupdateFrequency- the update frequency in millisecondslistener- a listener that is notified of interesting events related to this store
-
DefaultUpdatingVOMSTrustStore
public DefaultUpdatingVOMSTrustStore(long updateFrequency) Builds a trust store configured as defined in the parameters.- Parameters:
updateFrequency- the update frequency in milliseconds
-
DefaultUpdatingVOMSTrustStore
Builds a trust store configured as defined in the parameters.- Parameters:
localTrustDirs- where VOMS trust information will be looked forupdateFrequency- the update frequency in milliseconds
-
DefaultUpdatingVOMSTrustStore
Builds a trust store configured as defined in the parameters.- Parameters:
localTrustDirs- where VOMS trust information will be looked for
-
DefaultUpdatingVOMSTrustStore
public DefaultUpdatingVOMSTrustStore()Builds a trust store. VOMS information will be searched in the default VOMS dir location (DefaultVOMSTrustStore.DEFAULT_VOMS_DIR). This store will be refreshed according to the value ofDEFAULT_UPDATE_FREQUENCY.
-
-
Method Details
-
updateFrequencySanityChecks
protected void updateFrequencySanityChecks(long updateFrequency) -
scheduleUpdate
protected void scheduleUpdate() -
getUpdateFrequency
public long getUpdateFrequency()Returns the update frequency, in milliseconds, for this store.- Specified by:
getUpdateFrequencyin interfaceUpdateable- Returns:
- the frequency (in milliseconds) currently set for this
Updateableobject.
-
update
public void update()Updates the information in this store- Specified by:
updatein interfaceUpdateable
-
cancel
public void cancel()Cancel the background tasks which updates this store.- Specified by:
cancelin interfaceUpdateable
-