// The template final URITemplate tmpl = new URITemplate("http://my.site/foo{?params*}"); // The query parameters // Uses Maps from Guava since the lib depends on it final Map<String, String> params = Maps.newHashMap(); params.put("site", "http://www.foo.bar/foo/bar"); // The template data expansion final Map<String, VariableValue> data = Maps.newHashMap(); data.put("params", new MapValue(params)); // Expand, build the URL // The expansion takes care of all the encoding for you final URL url = new URL(template.expand(data));
BitSet methodsInMap = getMethodSet(); getMethodValue(i); setMethodOutcomes(roleSet,ac,udc,methodsInMap,null); getMethodValue(i).setOutcome(roleSet,ac,udc);
static void handleNoAuth(Permissions collection, MapValue m, String name) { String actions = null; BitSet noAuthMethods = m.getNoAuthMethods(); if (!m.otherConstraint.isAuthConstrained()) { BitSet methods = m.getMethodSet(); methods.andNot(noAuthMethods); if (!methods.isEmpty()) { actions = "!" + MethodValue.getActions(methods); } } else if (!noAuthMethods.isEmpty()) { actions = MethodValue.getActions(noAuthMethods); } else { return; } collection.add(new WebResourcePermission(name,actions)); if (logger.isLoggable(Level.FINE)){ logger.log(Level.FINE,"JACC: constraint capture: adding unchecked (for authorization) methods: "+ actions); } }
qpMap.put("/", new MapValue("/")); mValue = new MapValue(url); otherUrlType == PT_EXACT) && implies(url,otherUrl)) mValue.addQualifier(otherUrl); qpVal.getValue().addQualifier(url); qpVal.getValue().addQualifier(url); break; (otherUrlType == PT_EXACT && implies(url,otherUrl))) mValue.addQualifier(otherUrl); qpVal.getValue().addQualifier(url); break; mValue.addQualifier(otherUrl); break; otherUrlType == PT_EXTENSION) && implies(otherUrl,url)) qpVal.getValue().addQualifier(url); else if (otherUrlType == PT_DEFAULT) qpVal.getValue().addQualifier(url); break;
static void handleExcluded(Permissions collection, MapValue m, String name) { String actions = null; BitSet excludedMethods = m.getExcludedMethods(); if (m.otherConstraint.isExcluded()) { BitSet methods = m.getMethodSet(); methods.andNot(excludedMethods); if (!methods.isEmpty()) { actions = "!" + MethodValue.getActions(methods); } } else if (!excludedMethods.isEmpty()) { actions = MethodValue.getActions(excludedMethods); } else { return; } collection.add(new WebResourcePermission(name,actions)); collection.add(new WebUserDataPermission(name,actions)); if (logger.isLoggable(Level.FINE)){ logger.log(Level.FINE,"JACC: constraint capture: adding excluded methods: "+ actions); } }
static void handleRoles(HashMap<String,Permissions> map, MapValue m, String name) { HashMap<String,BitSet> rMap = m.getRoleMap(); List<String> roleList = null; roleList = m.otherConstraint.roleList; for (String roleName : roleList) { BitSet methods = m.getMethodSet(); BitSet methods = m.getMethodSet(); if (!methods.isEmpty()) { for (Map.Entry<String,BitSet> rval:rMap.entrySet()) {
String transport = ConstraintValue.connectKeys[i]; BitSet connectMethods = m.getConnectMap(1<<i); if (i == 0) { allConnectMethods = connectMethods; BitSet methods = m.getMethodSet(); methods.andNot(connectMethods); if (!methods.isEmpty()) {
BitSet otherMethodSet = getMethodSet(); if (!uncoveredMethodSet.isEmpty()) {
qpMap.put("/", new MapValue("/")); mValue = new MapValue(url); otherUrlType == PT_EXACT) && implies(url,otherUrl)) mValue.addQualifier(otherUrl); qpVal.getValue().addQualifier(url); qpVal.getValue().addQualifier(url); break; (otherUrlType == PT_EXACT && implies(url,otherUrl))) mValue.addQualifier(otherUrl); qpVal.getValue().addQualifier(url); break; mValue.addQualifier(otherUrl); break; otherUrlType == PT_EXTENSION) && implies(otherUrl,url)) qpVal.getValue().addQualifier(url); else if (otherUrlType == PT_DEFAULT) qpVal.getValue().addQualifier(url); break;
static void handleExcluded(Permissions collection, MapValue m, String name) { String actions = null; BitSet excludedMethods = m.getExcludedMethods(); if (m.otherConstraint.isExcluded()) { BitSet methods = m.getMethodSet(); methods.andNot(excludedMethods); if (!methods.isEmpty()) { actions = "!" + MethodValue.getActions(methods); } } else if (!excludedMethods.isEmpty()) { actions = MethodValue.getActions(excludedMethods); } else { return; } collection.add(new WebResourcePermission(name,actions)); collection.add(new WebUserDataPermission(name,actions)); if (logger.isLoggable(Level.FINE)){ logger.log(Level.FINE,"JACC: constraint capture: adding excluded methods: "+ actions); } }
static void handleRoles(HashMap<String,Permissions> map, MapValue m, String name) { HashMap<String,BitSet> rMap = m.getRoleMap(); List<String> roleList = null; roleList = m.otherConstraint.roleList; for (String roleName : roleList) { BitSet methods = m.getMethodSet(); BitSet methods = m.getMethodSet(); if (!methods.isEmpty()) { for (Map.Entry<String,BitSet> rval:rMap.entrySet()) {
String transport = ConstraintValue.connectKeys[i]; BitSet connectMethods = m.getConnectMap(1<<i); if (i == 0) { allConnectMethods = connectMethods; BitSet methods = m.getMethodSet(); methods.andNot(connectMethods); if (!methods.isEmpty()) {
BitSet methodsInMap = getMethodSet(); getMethodValue(i); setMethodOutcomes(roleSet,ac,udc,methodsInMap,null); getMethodValue(i).setOutcome(roleSet,ac,udc);
static void handleNoAuth(Permissions collection, MapValue m, String name) { String actions = null; BitSet noAuthMethods = m.getNoAuthMethods(); if (!m.otherConstraint.isAuthConstrained()) { BitSet methods = m.getMethodSet(); methods.andNot(noAuthMethods); if (!methods.isEmpty()) { actions = "!" + MethodValue.getActions(methods); } } else if (!noAuthMethods.isEmpty()) { actions = MethodValue.getActions(noAuthMethods); } else { return; } collection.add(new WebResourcePermission(name,actions)); if (logger.isLoggable(Level.FINE)){ logger.log(Level.FINE,"JACC: constraint capture: adding unchecked (for authorization) methods: "+ actions); } }