Package org.italiangrid.voms.store.impl
Class DefaultVOMSTrustStore
- java.lang.Object
-
- org.italiangrid.voms.store.impl.DefaultVOMSTrustStore
-
- All Implemented Interfaces:
VOMSTrustStore
- Direct Known Subclasses:
DefaultUpdatingVOMSTrustStore
public class DefaultVOMSTrustStore extends java.lang.Object implements VOMSTrustStore
The default implementation for the VOMS trust store. This implementation does not refresh the trust information on a periodic basis. For an updating trust store seeDefaultUpdatingVOMSTrustStore.- Author:
- Andrea Ceccanti
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCERTIFICATE_FILENAME_SUFFIXThe filename suffix used to match certificates in the VOMS local trust directoriesstatic java.lang.StringDEFAULT_VOMS_DIRThe default directory where local VOMS trust information is rooted: "/etc/grid-security/vomsdir"protected java.lang.ObjectlistenerLockA lock to guard the setting of the status listenerstatic java.lang.StringLSC_FILENAME_SUFFIXThe filename suffix used to match LSC files in the VOMS local trust directoriesprotected java.util.concurrent.locks.LockreadA reference to the read lockprotected java.util.concurrent.locks.ReadWriteLockrwLockThe read/write lock that implements thread safety for this storeprotected java.util.concurrent.locks.LockwriteA reference to the write lock
-
Constructor Summary
Constructors Constructor Description DefaultVOMSTrustStore()Default constructor.DefaultVOMSTrustStore(java.util.List<java.lang.String> localTrustDirs)DefaultVOMSTrustStore(java.util.List<java.lang.String> localTrustDirs, VOMSTrustStoreStatusListener listener)DefaultVOMSTrustStore(VOMSTrustStoreStatusListener listener)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static java.util.List<java.lang.String>buildDefaultTrustedDirs()Builds a list of trusted directories containing onlyDEFAULT_VOMS_DIR.java.security.cert.X509CertificategetAACertificateBySubject(javax.security.auth.x500.X500Principal aaCertSubject)Returns the VOMS Attribute Authority certificate held in thisVOMSTrustStorewhose subject matches the subject passed as argument.java.util.Map<java.lang.String,java.util.Set<LSCInfo>>getAllLSCInfo()Returns all the LSC information held in thisVOMSTrustStore.java.util.List<java.security.cert.X509Certificate>getLocalAACertificates()Returns the list of VOMS Attribute Authority certificates held in thisVOMSTrustStore.java.util.List<java.lang.String>getLocalTrustedDirectories()Returns the locally trusted directories where VOMS trust information (being VOMS server certificates or LSC files) are searched for.LSCInfogetLSC(java.lang.String voName, java.lang.String hostname)Returns the LSC information held in thisVOMSTrustStorefor the vo and hostname passed as arguments.voidloadTrustInformation()Loads trust information from the sources configured for this trust store.voidsetStatusListener(VOMSTrustStoreStatusListener statusListener)Sets aVOMSTrustStoreStatusListenerthat is notified of events related to this VOMS trust store
-
-
-
Field Detail
-
DEFAULT_VOMS_DIR
public static final java.lang.String DEFAULT_VOMS_DIR
The default directory where local VOMS trust information is rooted: "/etc/grid-security/vomsdir"- See Also:
- Constant Field Values
-
CERTIFICATE_FILENAME_SUFFIX
public static final java.lang.String CERTIFICATE_FILENAME_SUFFIX
The filename suffix used to match certificates in the VOMS local trust directories- See Also:
- Constant Field Values
-
LSC_FILENAME_SUFFIX
public static final java.lang.String LSC_FILENAME_SUFFIX
The filename suffix used to match LSC files in the VOMS local trust directories- See Also:
- Constant Field Values
-
rwLock
protected final java.util.concurrent.locks.ReadWriteLock rwLock
The read/write lock that implements thread safety for this store
-
read
protected final java.util.concurrent.locks.Lock read
A reference to the read lock
-
write
protected final java.util.concurrent.locks.Lock write
A reference to the write lock
-
listenerLock
protected final java.lang.Object listenerLock
A lock to guard the setting of the status listener
-
-
Constructor Detail
-
DefaultVOMSTrustStore
public DefaultVOMSTrustStore(java.util.List<java.lang.String> localTrustDirs, VOMSTrustStoreStatusListener listener)- Parameters:
localTrustDirs- a non-null list of local trust directorieslistener- theVOMSTrustStoreStatusListenerto use for this trust store- Throws:
java.lang.IllegalArgumentException- when the list passed as argument is null
-
DefaultVOMSTrustStore
public DefaultVOMSTrustStore(VOMSTrustStoreStatusListener listener)
-
DefaultVOMSTrustStore
public DefaultVOMSTrustStore(java.util.List<java.lang.String> localTrustDirs)
-
DefaultVOMSTrustStore
public DefaultVOMSTrustStore()
Default constructor. Sets the local trusted directories to the default of "/etc/grid-security/vomsdir".
-
-
Method Detail
-
buildDefaultTrustedDirs
protected static java.util.List<java.lang.String> buildDefaultTrustedDirs()
Builds a list of trusted directories containing onlyDEFAULT_VOMS_DIR.- Returns:
- a list of default trusted directory containing the
DEFAULT_VOMS_DIR
-
getLocalTrustedDirectories
public java.util.List<java.lang.String> getLocalTrustedDirectories()
Description copied from interface:VOMSTrustStoreReturns the locally trusted directories where VOMS trust information (being VOMS server certificates or LSC files) are searched for.- Specified by:
getLocalTrustedDirectoriesin interfaceVOMSTrustStore- Returns:
- a
Listof local paths
-
getLocalAACertificates
public java.util.List<java.security.cert.X509Certificate> getLocalAACertificates()
Description copied from interface:VOMSTrustStoreReturns the list of VOMS Attribute Authority certificates held in thisVOMSTrustStore.- Specified by:
getLocalAACertificatesin interfaceVOMSTrustStore- Returns:
- the collection of VOMS Attribute Authority certificates held in
this
VOMSTrustStore, an empty list if no certificate was found.
-
getLSC
public LSCInfo getLSC(java.lang.String voName, java.lang.String hostname)
Description copied from interface:VOMSTrustStoreReturns the LSC information held in thisVOMSTrustStorefor the vo and hostname passed as arguments.- Specified by:
getLSCin interfaceVOMSTrustStore- Parameters:
voName- the name of the VO for which the LSC applieshostname- the name of the host for which the LSC applies- Returns:
- a
LSCInfoobject, or null if no LSC matching the arguments was found
-
loadTrustInformation
public void loadTrustInformation()
Description copied from interface:VOMSTrustStoreLoads trust information from the sources configured for this trust store.- Specified by:
loadTrustInformationin interfaceVOMSTrustStore
-
getAACertificateBySubject
public java.security.cert.X509Certificate getAACertificateBySubject(javax.security.auth.x500.X500Principal aaCertSubject)
Description copied from interface:VOMSTrustStoreReturns the VOMS Attribute Authority certificate held in thisVOMSTrustStorewhose subject matches the subject passed as argument.- Specified by:
getAACertificateBySubjectin interfaceVOMSTrustStore- Parameters:
aaCertSubject- a certificate subject- Returns:
- the VOMS AA
X509Certificatethat matches the subject passed as argument or null if no matching certificate is found in this store
-
getAllLSCInfo
public java.util.Map<java.lang.String,java.util.Set<LSCInfo>> getAllLSCInfo()
Description copied from interface:VOMSTrustStoreReturns all the LSC information held in thisVOMSTrustStore. The returnedMapis keyed by VO name.- Specified by:
getAllLSCInfoin interfaceVOMSTrustStore- Returns:
- a possibly empty map
LSCInfoobjects
-
setStatusListener
public void setStatusListener(VOMSTrustStoreStatusListener statusListener)
Description copied from interface:VOMSTrustStoreSets aVOMSTrustStoreStatusListenerthat is notified of events related to this VOMS trust store- Specified by:
setStatusListenerin interfaceVOMSTrustStore- Parameters:
statusListener- the status listener that will be notified
-
-