private PolicyConfigurationImpl getPolicyConfigurationImplFromDirectory(String contextId, boolean open, boolean remove) { PolicyConfigurationImpl pci = null; File f = new File(getContextDirectoryName(contextId)); if (f.exists()) { pci = new PolicyConfigurationImpl(f, open, remove, this); if (pci != null) { putPolicyConfigurationImpl(contextId, pci); } } return pci; }
private PolicyConfigurationFactoryImpl getPolicyFactory() { return PolicyConfigurationFactoryImpl.getInstance(); } }
private void initLinkTable() { synchronized(refreshLock) { // get the linkSet corresponding to this context. Set linkSet = (Set) fact.getLinkTable().get(CONTEXT_ID); // remobe this context id from the linkSet (which may be shared // with other contexts), and unmap the linkSet form this context. if (linkSet != null) { linkSet.remove(CONTEXT_ID); fact.getLinkTable().remove(CONTEXT_ID); } // create a new linkSet with onlythis context id, and put it in the table. linkSet = new HashSet(); linkSet.add(CONTEXT_ID); fact.getLinkTable().put(CONTEXT_ID,linkSet); } }
public PolicyConfigurationFactoryImpl(){ repository = initializeRepository(); setInstance(this); }
protected PolicyConfigurationImpl getPolicyConfigurationImpl(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; }
throws PolicyContextException { checkSetPolicyPermission(); if(logger.isLoggable(Level.FINE)){ logger.fine("JACC Policy Provider: Getting PolicyConfiguration object with id = "+ contextId); PolicyConfigurationImpl pci = getPolicyConfigImpl(contextId); pci = getPolicyConfigurationImplFromDirectory(contextId,true,remove); if (pci == null) { pci = new PolicyConfigurationImpl(contextId, this); putPolicyConfigurationImpl(contextId,pci);
/** * This method determines if the identified policy context * exists with state "inService" in the Policy provider * associated with the factory. * <P> * @param contextID A string identifying a policy context * * @return true if the identified policy context exists within the * provider and its state is "inService", false otherwise. * * @throws java.lang.SecurityException * when called by an AccessControlContext that has not been * granted the "setPolicy" SecurityPermission. * * @throws javax.security.jacc.PolicyContextException * if the implementation throws a checked exception that has not been * accounted for by the inService method signature. The exception thrown * by the implementation class will be encapsulated (during construction) * in the thrown PolicyContextException. */ public boolean inService(String contextID) throws PolicyContextException{ 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 PolicyConfigurationImpl(String contextId, PolicyConfigurationFactoryImpl fact){ CONTEXT_ID = contextId; this.fact = fact; repository = fact.getRepository(); // initialize(open,remove,!fromFile) // initializeRepository(); initialize(true,true,false); }
private String getContextDirectoryName() { if (repository == null) { throw new RuntimeException("JACC Policy provider: repository not initialized"); } return fact.getContextDirectoryName(CONTEXT_ID); }
private PolicyConfigurationImpl getPolicyConfigForContext(String contextId) { PolicyConfigurationImpl pci = null; PolicyConfigurationFactoryImpl pcf = getPolicyFactory(); if (contextId != null && pcf != null) { pci = pcf.getPolicyConfigurationImpl(contextId); } return pci; }
PolicyConfigurationFactoryImpl pcf = getPolicyFactory(); if (pcf != null) { pciArray = pcf.getPolicyConfigurationImpls();
throws PolicyContextException { checkSetPolicyPermission(); if(logger.isLoggable(Level.FINE)){ logger.fine("JACC Policy Provider: Getting PolicyConfiguration object with id = "+ contextId); PolicyConfigurationImpl pci = getPolicyConfigImpl(contextId); pci = getPolicyConfigurationImplFromDirectory(contextId,true,remove); if (pci == null) { pci = new PolicyConfigurationImpl(contextId, this); putPolicyConfigurationImpl(contextId,pci);
/** * This method determines if the identified policy context * exists with state "inService" in the Policy provider * associated with the factory. * <P> * @param contextID A string identifying a policy context * * @return true if the identified policy context exists within the * provider and its state is "inService", false otherwise. * * @throws java.lang.SecurityException * when called by an AccessControlContext that has not been * granted the "setPolicy" SecurityPermission. * * @throws javax.security.jacc.PolicyContextException * if the implementation throws a checked exception that has not been * accounted for by the inService method signature. The exception thrown * by the implementation class will be encapsulated (during construction) * in the thrown PolicyContextException. */ public boolean inService(String contextID) throws PolicyContextException{ 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 PolicyConfigurationImpl getPolicyConfigurationImpl(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; }
public PolicyConfigurationFactoryImpl(){ repository = initializeRepository(); setInstance(this); }
protected PolicyConfigurationImpl(String contextId, PolicyConfigurationFactoryImpl fact){ CONTEXT_ID = contextId; this.fact = fact; repository = fact.getRepository(); // initialize(open,remove,!fromFile) // initializeRepository(); initialize(true,true,false); }
private String getContextDirectoryName() { if (repository == null) { throw new RuntimeException("JACC Policy provider: repository not initialized"); } return fact.getContextDirectoryName(CONTEXT_ID); }
private PolicyConfigurationImpl getPolicyConfigForContext(String contextId) { PolicyConfigurationImpl pci = null; PolicyConfigurationFactoryImpl pcf = getPolicyFactory(); if (contextId != null && pcf != null) { pci = pcf.getPolicyConfigurationImpl(contextId); } return pci; }
PolicyConfigurationFactoryImpl pcf = getPolicyFactory(); if (pcf != null) { pciArray = pcf.getPolicyConfigurationImpls();
private PolicyConfigurationImpl getPolicyConfigurationImplFromDirectory(String contextId, boolean open, boolean remove) { PolicyConfigurationImpl pci = null; File f = new File(getContextDirectoryName(contextId)); if (f.exists()) { pci = new PolicyConfigurationImpl(f, open, remove, this); if (pci != null) { putPolicyConfigurationImpl(contextId, pci); } } return pci; }