eu.emi.security.authn.x509.helpers.ns
Class AbstractNamespacesStore

java.lang.Object
  extended by eu.emi.security.authn.x509.helpers.ns.AbstractNamespacesStore
All Implemented Interfaces:
NamespacesStore
Direct Known Subclasses:
AbstractEuGridPmaNamespacesStore, AbstractGlobusNamespacesStore

public abstract class AbstractNamespacesStore
extends Object
implements NamespacesStore

Policy store common code.

This class it thread safe.

Author:
K. Benedyczak

Field Summary
protected  ObserversHandler observers
           
protected  boolean openssl1Mode
           
 
Constructor Summary
AbstractNamespacesStore(ObserversHandler observers, boolean openssl1Mode)
           
 
Method Summary
protected  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 getFileSuffix()
           
protected abstract  String getNotificationType()
           
protected abstract  NamespacesParser getParser(String path)
           
 List<NamespacePolicy> 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 Detail

observers

protected final ObserversHandler observers

openssl1Mode

protected boolean openssl1Mode
Constructor Detail

AbstractNamespacesStore

public AbstractNamespacesStore(ObserversHandler observers,
                               boolean openssl1Mode)
Method Detail

getNotificationType

protected abstract String getNotificationType()

getParser

protected abstract NamespacesParser getParser(String path)

getFileSuffix

protected abstract String getFileSuffix()

tryLoadNsPath

protected List<NamespacePolicy> tryLoadNsPath(String path)

tryLoadNsLocation

protected void tryLoadNsLocation(String location,
                                 List<NamespacePolicy> policies)

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 -
policies -

addPolicyToMap

protected void addPolicyToMap(NamespacePolicy policy,
                              Map<String,List<NamespacePolicy>> map)
Adds policy to a map indexed by a policy issuer.

Parameters:
policy -
map -

getPolicies

public List<NamespacePolicy> getPolicies(X509Certificate[] chain,
                                         int position)
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 interface NamespacesStore
Returns:

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 -
definedForHash -
issuer -
path -
maxTTL -
Returns:


Copyright © 2012-2014 European Middleware Initiative. All Rights Reserved.