/** Constraints that name method omissions are dealt with differently. * We create an entry in the mappings with key "<method>.omission". This entry * is only ever combined with other omissions for the same method to produce a * consolidated RoleInfo. Then, when we wish to find the relevant constraints for * a given Request (in prepareConstraintInfo()), we consult 3 types of entries in * the mappings: an entry that names the method of the Request specifically, an * entry that names constraints that apply to all methods, entries of the form * <method>.omission, where the method of the Request is not named in the omission. * @param mapping the constraint mapping * @param mappings the mappings of roles */ protected void processConstraintMappingWithMethodOmissions (ConstraintMapping mapping, Map<String, RoleInfo> mappings) { String[] omissions = mapping.getMethodOmissions(); StringBuilder sb = new StringBuilder(); for (int i=0; i<omissions.length; i++) { if (i > 0) sb.append("."); sb.append(omissions[i]); } sb.append(OMISSION_SUFFIX); RoleInfo ri = new RoleInfo(); mappings.put(sb.toString(), ri); configureRoleInfo(ri, mapping); }
if (roleInfo == null) roleInfo = new RoleInfo(); mappings.put(httpMethod,roleInfo); if (allMethodsRoleInfo != null)
/** Constraints that name method omissions are dealt with differently. * We create an entry in the mappings with key "<method>.omission". This entry * is only ever combined with other omissions for the same method to produce a * consolidated RoleInfo. Then, when we wish to find the relevant constraints for * a given Request (in prepareConstraintInfo()), we consult 3 types of entries in * the mappings: an entry that names the method of the Request specifically, an * entry that names constraints that apply to all methods, entries of the form * <method>.omission, where the method of the Request is not named in the omission. * @param mapping * @param mappings */ protected void processConstraintMappingWithMethodOmissions (ConstraintMapping mapping, Map<String, RoleInfo> mappings) { String[] omissions = mapping.getMethodOmissions(); StringBuilder sb = new StringBuilder(); for (int i=0; i<omissions.length; i++) { if (i > 0) sb.append("."); sb.append(omissions[i]); } sb.append(OMISSION_SUFFIX); RoleInfo ri = new RoleInfo(); mappings.put(sb.toString(), ri); configureRoleInfo(ri, mapping); }
/** Constraints that name method omissions are dealt with differently. * We create an entry in the mappings with key "<method>.omission". This entry * is only ever combined with other omissions for the same method to produce a * consolidated RoleInfo. Then, when we wish to find the relevant constraints for * a given Request (in prepareConstraintInfo()), we consult 3 types of entries in * the mappings: an entry that names the method of the Request specifically, an * entry that names constraints that apply to all methods, entries of the form * <method>.omission, where the method of the Request is not named in the omission. * @param mapping the constraint mapping * @param mappings the mappings of roles */ protected void processConstraintMappingWithMethodOmissions (ConstraintMapping mapping, Map<String, RoleInfo> mappings) { String[] omissions = mapping.getMethodOmissions(); StringBuilder sb = new StringBuilder(); for (int i=0; i<omissions.length; i++) { if (i > 0) sb.append("."); sb.append(omissions[i]); } sb.append(OMISSION_SUFFIX); RoleInfo ri = new RoleInfo(); mappings.put(sb.toString(), ri); configureRoleInfo(ri, mapping); }
/** Constraints that name method omissions are dealt with differently. * We create an entry in the mappings with key "<method>.omission". This entry * is only ever combined with other omissions for the same method to produce a * consolidated RoleInfo. Then, when we wish to find the relevant constraints for * a given Request (in prepareConstraintInfo()), we consult 3 types of entries in * the mappings: an entry that names the method of the Request specifically, an * entry that names constraints that apply to all methods, entries of the form * <method>.omission, where the method of the Request is not named in the omission. * @param mapping the constraint mapping * @param mappings the mappings of roles */ protected void processConstraintMappingWithMethodOmissions (ConstraintMapping mapping, Map<String, RoleInfo> mappings) { String[] omissions = mapping.getMethodOmissions(); StringBuilder sb = new StringBuilder(); for (int i=0; i<omissions.length; i++) { if (i > 0) sb.append("."); sb.append(omissions[i]); } sb.append(OMISSION_SUFFIX); RoleInfo ri = new RoleInfo(); mappings.put(sb.toString(), ri); configureRoleInfo(ri, mapping); }
/** Constraints that name method omissions are dealt with differently. * We create an entry in the mappings with key "method.omission". This entry * is only ever combined with other omissions for the same method to produce a * consolidated RoleInfo. Then, when we wish to find the relevant constraints for * a given Request (in prepareConstraintInfo()), we consult 3 types of entries in * the mappings: an entry that names the method of the Request specifically, an * entry that names constraints that apply to all methods, entries of the form * method.omission, where the method of the Request is not named in the omission. * @param mapping * @param mappings */ protected void processConstraintMappingWithMethodOmissions (ConstraintMapping mapping, Map<String, RoleInfo> mappings) { String[] omissions = mapping.getMethodOmissions(); for (String omission:omissions) { //for each method omission, see if there is already a RoleInfo for it in mappings RoleInfo ri = mappings.get(omission+OMISSION_SUFFIX); if (ri == null) { //if not, make one ri = new RoleInfo(); mappings.put(omission+OMISSION_SUFFIX, ri); } //initialize RoleInfo or combine from ConstraintMapping configureRoleInfo(ri, mapping); } }
/** Constraints that name method omissions are dealt with differently. * We create an entry in the mappings with key "method.omission". This entry * is only ever combined with other omissions for the same method to produce a * consolidated RoleInfo. Then, when we wish to find the relevant constraints for * a given Request (in prepareConstraintInfo()), we consult 3 types of entries in * the mappings: an entry that names the method of the Request specifically, an * entry that names constraints that apply to all methods, entries of the form * method.omission, where the method of the Request is not named in the omission. * @param mapping * @param mappings */ protected void processConstraintMappingWithMethodOmissions (ConstraintMapping mapping, Map<String, RoleInfo> mappings) { String[] omissions = mapping.getMethodOmissions(); for (String omission:omissions) { //for each method omission, see if there is already a RoleInfo for it in mappings RoleInfo ri = mappings.get(omission+OMISSION_SUFFIX); if (ri == null) { //if not, make one ri = new RoleInfo(); mappings.put(omission+OMISSION_SUFFIX, ri); } //initialize RoleInfo or combine from ConstraintMapping configureRoleInfo(ri, mapping); } }
/** Constraints that name method omissions are dealt with differently. * We create an entry in the mappings with key "method.omission". This entry * is only ever combined with other omissions for the same method to produce a * consolidated RoleInfo. Then, when we wish to find the relevant constraints for * a given Request (in prepareConstraintInfo()), we consult 3 types of entries in * the mappings: an entry that names the method of the Request specifically, an * entry that names constraints that apply to all methods, entries of the form * method.omission, where the method of the Request is not named in the omission. * @param mapping * @param mappings */ protected void processConstraintMappingWithMethodOmissions (ConstraintMapping mapping, Map<String, RoleInfo> mappings) { String[] omissions = mapping.getMethodOmissions(); for (String omission:omissions) { //for each method omission, see if there is already a RoleInfo for it in mappings RoleInfo ri = mappings.get(omission+OMISSION_SUFFIX); if (ri == null) { //if not, make one ri = new RoleInfo(); mappings.put(omission+OMISSION_SUFFIX, ri); } //initialize RoleInfo or combine from ConstraintMapping configureRoleInfo(ri, mapping); } }
/** Constraints that name method omissions are dealt with differently. * We create an entry in the mappings with key "method.omission". This entry * is only ever combined with other omissions for the same method to produce a * consolidated RoleInfo. Then, when we wish to find the relevant constraints for * a given Request (in prepareConstraintInfo()), we consult 3 types of entries in * the mappings: an entry that names the method of the Request specifically, an * entry that names constraints that apply to all methods, entries of the form * method.omission, where the method of the Request is not named in the omission. * @param mapping * @param mappings */ protected void processConstraintMappingWithMethodOmissions (ConstraintMapping mapping, Map<String, RoleInfo> mappings) { String[] omissions = mapping.getMethodOmissions(); for (String omission:omissions) { //for each method omission, see if there is already a RoleInfo for it in mappings RoleInfo ri = mappings.get(omission+OMISSION_SUFFIX); if (ri == null) { //if not, make one ri = new RoleInfo(); mappings.put(omission+OMISSION_SUFFIX, ri); } //initialize RoleInfo or combine from ConstraintMapping configureRoleInfo(ri, mapping); } }
/** Constraints that name method omissions are dealt with differently. * We create an entry in the mappings with key "method.omission". This entry * is only ever combined with other omissions for the same method to produce a * consolidated RoleInfo. Then, when we wish to find the relevant constraints for * a given Request (in prepareConstraintInfo()), we consult 3 types of entries in * the mappings: an entry that names the method of the Request specifically, an * entry that names constraints that apply to all methods, entries of the form * method.omission, where the method of the Request is not named in the omission. * @param mapping * @param mappings */ protected void processConstraintMappingWithMethodOmissions (ConstraintMapping mapping, Map<String, RoleInfo> mappings) { String[] omissions = mapping.getMethodOmissions(); for (String omission:omissions) { //for each method omission, see if there is already a RoleInfo for it in mappings RoleInfo ri = mappings.get(omission+OMISSION_SUFFIX); if (ri == null) { //if not, make one ri = new RoleInfo(); mappings.put(omission+OMISSION_SUFFIX, ri); } //initialize RoleInfo or combine from ConstraintMapping configureRoleInfo(ri, mapping); } }
/** Constraints that name method omissions are dealt with differently. * We create an entry in the mappings with key "method.omission". This entry * is only ever combined with other omissions for the same method to produce a * consolidated RoleInfo. Then, when we wish to find the relevant constraints for * a given Request (in prepareConstraintInfo()), we consult 3 types of entries in * the mappings: an entry that names the method of the Request specifically, an * entry that names constraints that apply to all methods, entries of the form * method.omission, where the method of the Request is not named in the omission. * @param mapping * @param mappings */ protected void processConstraintMappingWithMethodOmissions (ConstraintMapping mapping, Map<String, RoleInfo> mappings) { String[] omissions = mapping.getMethodOmissions(); for (String omission:omissions) { //for each method omission, see if there is already a RoleInfo for it in mappings RoleInfo ri = mappings.get(omission+OMISSION_SUFFIX); if (ri == null) { //if not, make one ri = new RoleInfo(); mappings.put(omission+OMISSION_SUFFIX, ri); } //initialize RoleInfo or combine from ConstraintMapping configureRoleInfo(ri, mapping); } }
else roleInfo = new RoleInfo(); roleInfo.setUserDataConstraint(UserDataConstraint.None);
else roleInfo = new RoleInfo(); roleInfo.setUserDataConstraint(UserDataConstraint.None);
else roleInfo = new RoleInfo(); roleInfo.setUserDataConstraint(UserDataConstraint.None);
protected void processConstraintMapping(ConstraintMapping mapping) { String pathSpec = mapping.getPathSpec(); StringTokenizer tok = new StringTokenizer(pathSpec, PATH_SPEC_SEPARATORS); String httpMethod = mapping.getMethod(); while (tok.hasMoreTokens()) { String spec = tok.nextToken().trim(); if (httpMethod == null) { if ("*".equals(spec)) { if (defaultRoleInfo == null) { defaultRoleInfo = new RoleInfo(); } addConstraint(defaultRoleInfo, mapping.getConstraint()); } else { throw new IllegalArgumentException("No method specified for PathSpec " + pathSpec + "."); } } RestPathMap<RoleInfo> mappings = constraintMap.get(httpMethod); if (mappings == null) { mappings = new RestPathMap<RoleInfo>(); constraintMap.put(httpMethod, mappings); } RoleInfo roleInfo = mappings.get(spec); if (roleInfo == null) { roleInfo = new RoleInfo(); mappings.put(spec, roleInfo); } addConstraint(roleInfo, mapping.getConstraint()); } }
if (roleInfo == null) roleInfo = new RoleInfo(); mappings.put(httpMethod,roleInfo); if (allMethodsRoleInfo != null)
if (roleInfo == null) roleInfo = new RoleInfo(); mappings.put(httpMethod,roleInfo); if (allMethodsRoleInfo != null)