Methods Summary |
---|
private static PolicyConfigurationImpl | getPolicyConfigImpl(java.lang.String contextId)
try {
rLock.lock();
return (PolicyConfigurationImpl) polConfTable.get(contextId);
} finally {
rLock.unlock();
}
|
public PolicyConfiguration | getPolicyConfiguration(java.lang.String contextId, boolean remove)This method is used to obtain an instance of the provider specific
class that implements the PolicyConfiguration interface that
corresponds to the identified policy context within the provider.
The methods of the PolicyConfiguration interface are used to
define the policy statements of the identified policy context.
If at the time of the call, the identified policy context does not
exist in the provider, then the policy context will be created
in the provider and the Object that implements the context's
PolicyConfiguration Interface will be returned. If the state of the
identified context is "deleted" or "inService" it will be transitioned to
the "open" state as a result of the call. The states in the lifecycle
of a policy context are defined by the PolicyConfiguration interface.
For a given value of policy context identifier, this method
must always return the same instance of PolicyConfiguration
and there must be at most one actual instance of a
PolicyConfiguration with a given policy context identifier
(during a process context).
To preserve the invariant that there be at most one
PolicyConfiguration object for a given policy context,
it may be necessary for this method to be thread safe.
PolicyConfigurationImpl.checkSetPolicyPermission();
if(logger.isLoggable(Level.FINE)){
logger.fine("JACC Policy Provider: Getting PolicyConfiguration object with id = "+ contextId);
}
PolicyConfigurationImpl pci = getPolicyConfigImpl(contextId);
// if the pc is not in the table, see if it was copied into the
// filesystem (e.g. by the DAS)
if (pci == null){
pci = getPolicyConfigurationImplFromDirectory(contextId,true,remove);
if (pci == null) {
pci = new PolicyConfigurationImpl(contextId);
putPolicyConfigurationImpl(contextId,pci);
}
} else {
// return the policy configuration to the open state, value of
// remove will determine if statements are removed
pci.initialize(true,remove,false);
}
return pci;
|
protected static PolicyConfigurationImpl | getPolicyConfigurationImpl(java.lang.String contextId)
PolicyConfigurationImpl pci = getPolicyConfigImpl(contextId);
if (pci == null) {
// check if pc was copied into the filesystem after the repository
// was initialized (do not open pc or remove policy statements).
pci = getPolicyConfigurationImplFromDirectory(contextId,false,false);
if (pci == null) {
logger.log(Level.WARNING,"pc.unknown_policy_context",
new Object[]{contextId});
}
}
return pci;
|
private static PolicyConfigurationImpl | getPolicyConfigurationImplFromDirectory(java.lang.String contextId, boolean open, boolean remove)
PolicyConfigurationImpl pci = null;
File f = new File(PolicyConfigurationImpl.getContextDirectoryName(contextId));
if (f.exists()) {
pci = new PolicyConfigurationImpl(f,open,remove);
if (pci != null) {
putPolicyConfigurationImpl(contextId,pci);
}
}
return pci;
|
protected static PolicyConfigurationImpl[] | getPolicyConfigurationImpls()
PolicyConfigurationImpl[] rvalue = null;
try {
rLock.lock();
Collection c = polConfTable.values();
if (c != null) {
rvalue = (PolicyConfigurationImpl[])
c.toArray( new PolicyConfigurationImpl[c.size()] );
}
} finally {
rLock.unlock();
}
return rvalue;
|
public boolean | inService(java.lang.String contextID)This method determines if the identified policy context
exists with state "inService" in the Policy provider
associated with the factory.
PolicyConfigurationImpl.checkSetPolicyPermission();
PolicyConfiguration pc = getPolicyConfigImpl(contextID);
// if the pc is not in the table, see if it was copied into the
// filesystem (e.g. by the DAS)
if (pc == null) {
pc = getPolicyConfigurationImplFromDirectory(contextID,false,false);
}
return pc == null ? false : pc.inService();
|
protected static PolicyConfigurationImpl | putPolicyConfigurationImpl(java.lang.String contextID, PolicyConfigurationImpl pci)
try {
wLock.lock();
return (PolicyConfigurationImpl) polConfTable.put(contextID,pci);
} finally {
wLock.unlock();
}
|