Class AbstractNamespacesStore
java.lang.Object
eu.emi.security.authn.x509.helpers.ns.AbstractNamespacesStore
- All Implemented Interfaces:
NamespacesStore
- Direct Known Subclasses:
AbstractEuGridPmaNamespacesStore
,AbstractGlobusNamespacesStore
Policy store common code.
This class it thread safe.
- Author:
- K. Benedyczak
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addPolicy
(NamespacePolicy policy, Map<String, Map<String, List<NamespacePolicy>>> policies) Adds a given policy to a given map.protected void
addPolicyToMap
(NamespacePolicy policy, Map<String, List<NamespacePolicy>> map) Adds policy to a map indexed by a policy issuer.protected List<NamespacePolicy>
getCachedPolicies
(Map<String, CachedElement<Map<String, List<NamespacePolicy>>>> policies, String definedForHash, String issuer, String path, long maxTTL) Utility method useful for lazy stores.protected abstract String
protected abstract String
protected abstract NamespacesParser
getPolicies
(X509Certificate[] chain, int position) Gets namespace policies applicable for the CA.protected void
tryLoadNsLocation
(String location, List<NamespacePolicy> policies) protected List<NamespacePolicy>
tryLoadNsPath
(String path) 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.ns.NamespacesStore
getPolicies, setPolicies
-
Field Details
-
observers
-
openssl1Mode
protected boolean openssl1Mode
-
-
Constructor Details
-
AbstractNamespacesStore
-
-
Method Details
-
getNotificationType
-
getParser
-
getFileSuffix
-
tryLoadNsPath
-
tryLoadNsLocation
-
addPolicy
protected void addPolicy(NamespacePolicy policy, Map<String, Map<String, List<NamespacePolicy>>> policies) Adds a given policy to a given map. It is assumed that the map is indexed by issuer hash and the value maps are indexed by issuer id. This method is useful only for stores which keep all their namespaces in memory.- Parameters:
policy
- policy to addpolicies
- policy map to add to
-
addPolicyToMap
Adds policy to a map indexed by a policy issuer.- Parameters:
policy
- policy to addmap
- policy map to add to
-
getPolicies
Description copied from interface:NamespacesStore
Gets namespace policies applicable for the CA. The CA must be present in the cert chain, at the position given. The subsequent chain elements might be used if there is no explicit policy defined for the CA itself: then it is checked if any of the parent CAs defined policy for this CA.- Specified by:
getPolicies
in interfaceNamespacesStore
- Parameters:
chain
- chainposition
- position- Returns:
- policies
-
getCachedPolicies
protected List<NamespacePolicy> getCachedPolicies(Map<String, CachedElement<Map<String, List<NamespacePolicy>>>> policies, String definedForHash, String issuer, String path, long maxTTL) Utility method useful for lazy stores. Retrieves a cached policies for the given ca hash and issuer. If there is no policy in the cache then it is tried to load one from disk. The loaded policy is cached before being returned.- Parameters:
policies
- policiesdefinedForHash
- defined for hashissuer
- issuerpath
- pathmaxTTL
- max TTL- Returns:
- cached policies
-