private Decision executePDP(boolean logobligation, String format) { // Setup PDP - reuse PDPOnePolicyDataStore.properties PolicyDecisionPoint pdp = null; try { Properties props = new Properties(); URL url = ClassLoader.getSystemResource("PDPOnePolicyDataStore.properties"); props.load(url.openStream()); // Just to ensure cache is reloaded props.setProperty( "PDP_ETAG", logobligation ? "10101" + format.hashCode() : "10102" + format.hashCode()); if (logobligation) props.setProperty("PDP_LOG_OBLIGATION", "true"); else props.setProperty("PDP_LOG_OBLIGATION", "false"); props.setProperty("PDP_LOG_OBLIGATION_FORMAT", format); pdp = PolicyEnforcementPoint.getPDP(props); } catch (Exception ex) { System.out.println("Properties File not found:" + ex); ex.printStackTrace(); return null; } // Get Decision Target resource = new Target("web", "http://www.ebay.com/xxx"); List<Environment> env = new ArrayList<Environment>(); Environment env1 = new Environment("session", "env1"); env1.setAttribute("authn.level", new Integer(0)); env1.setAttribute("role", "manager"); env.add(env1); Decision decision = pdp.getPolicyDecision(resource, env); return decision; }