private boolean processMapping(OperationContext context, String securityDomain, ModelNode node, ApplicationPolicy applicationPolicy) throws OperationFailedException { node = peek(node, MAPPING, CLASSIC, MAPPING_MODULE); if (node == null) { return false; } for (Property moduleProperty : node.asPropertyList()) { ModelNode module = moduleProperty.getValue(); MappingInfo mappingInfo = new MappingInfo(securityDomain); String codeName = extractCode(context, module, ModulesMap.MAPPING_MAP); String mappingType; if (module.hasDefined(TYPE)) { mappingType = MappingModuleDefinition.TYPE.resolveModelAttribute(context, module).asString(); } else { mappingType = MappingType.ROLE.toString(); } Map<String, Object> options = extractOptions(context, module); MappingModuleEntry entry = new MappingModuleEntry(codeName, options, mappingType); mappingInfo.add(entry); applicationPolicy.setMappingInfo(mappingType, mappingInfo); ModelNode moduleName = LoginModuleResourceDefinition.MODULE.resolveModelAttribute(context, module); if (moduleName.isDefined() && !moduleName.asString().isEmpty()) { mappingInfo.addJBossModuleName(moduleName.asString()); } else { mappingInfo.addJBossModuleName(DEFAULT_MODULE); } } return true; }
public void addChild(MappingInfo authInfo, MappingModuleEntry entry, UnmarshallingContext navigator, String namespaceURI, String localName) { authInfo.add(entry); }
public Object instantiate() { Map<String, MappingInfo> infos = new HashMap<String, MappingInfo>(); // create a MappingInfo instance of each group of mapping modules. for (String type : this.moduleEntries.keySet()) { // application policy name will be reset in ApplicationPolicyContainer. MappingInfo mapping = new MappingInfo("dummy"); mapping.add(this.moduleEntries.get(type)); infos.put(type, mapping); } return infos; }
private boolean processMapping(OperationContext context, String securityDomain, ModelNode node, ApplicationPolicy applicationPolicy) throws OperationFailedException { node = peek(node, MAPPING, CLASSIC, MAPPING_MODULE); if (node == null) { return false; } for (Property moduleProperty : node.asPropertyList()) { ModelNode module = moduleProperty.getValue(); MappingInfo mappingInfo = new MappingInfo(securityDomain); String codeName = extractCode(context, module, ModulesMap.MAPPING_MAP); String mappingType; if (module.hasDefined(TYPE)) { mappingType = MappingModuleDefinition.TYPE.resolveModelAttribute(context, module).asString(); } else { mappingType = MappingType.ROLE.toString(); } Map<String, Object> options = extractOptions(context, module); MappingModuleEntry entry = new MappingModuleEntry(codeName, options, mappingType); mappingInfo.add(entry); applicationPolicy.setMappingInfo(mappingType, mappingInfo); ModelNode moduleName = LoginModuleResourceDefinition.MODULE.resolveModelAttribute(context, module); if (moduleName.isDefined() && !moduleName.asString().isEmpty()) { mappingInfo.addJBossModuleName(moduleName.asString()); } else { mappingInfo.addJBossModuleName(DEFAULT_MODULE); } } return true; }
/** * <p> * Sets the {@code MappingInfo} that must be used to perform the mappings of the specified type. * </p> * * @param mappingType the type of mappings that can be performed by the {@code MappingInfo}. * @param info a reference to the {@code MappingInfo} instance to be set. */ public void setMappingInfo(String mappingType, MappingInfo info) { // if there is a registered info for the specified type, merge the modules. if(this.mappingInfos.containsKey(mappingType)) this.mappingInfos.get(mappingType).add(info.getModuleEntries()); else this.mappingInfos.put(mappingType, info); }
/** * <p> * Sets the {@code MappingInfo} that must be used to perform the mappings of the specified type. * </p> * * @param mappingType the type of mappings that can be performed by the {@code MappingInfo}. * @param info a reference to the {@code MappingInfo} instance to be set. */ public void setMappingInfo(String mappingType, MappingInfo info) { mappingType = mappingType.toLowerCase(Locale.ENGLISH); // if there is a registered info for the specified type, merge the modules. if(this.mappingInfos.containsKey(mappingType)) this.mappingInfos.get(mappingType).add(info.getModuleEntries()); else this.mappingInfos.put(mappingType, info); }
public void addChild(ApplicationPolicy aPolicy, MappingInfo authInfo, UnmarshallingContext navigator, String namespaceURI, String localName) { // first organize the mapping modules by type. Map<String,List<MappingModuleEntry>> mappings = new HashMap<String,List<MappingModuleEntry>>(); for(MappingModuleEntry entry : authInfo.getModuleEntries()) { String type = entry.getMappingModuleType(); if(mappings.containsKey(type)) mappings.get(type).add(entry); else { List<MappingModuleEntry> entries = new ArrayList<MappingModuleEntry>(); entries.add(entry); mappings.put(type, entries); } } // now set all mapping infos by type. for(Map.Entry<String,List<MappingModuleEntry>> entry : mappings.entrySet()) { MappingInfo info = new MappingInfo(authInfo.getName()); info.add(entry.getValue()); aPolicy.setMappingInfo(entry.getKey(), info); } if (trace) log.trace("addChild.ApplicationPolicy, name: " + aPolicy.getName()); }
mappingInfo.add(entry);
mappingInfo.add(entry);
private boolean processMapping(OperationContext context, String securityDomain, ModelNode node, ApplicationPolicy applicationPolicy) throws OperationFailedException { node = peek(node, MAPPING, CLASSIC, MAPPING_MODULE); if (node == null) { return false; } for (Property moduleProperty : node.asPropertyList()) { ModelNode module = moduleProperty.getValue(); MappingInfo mappingInfo = new MappingInfo(securityDomain); String codeName = extractCode(context, module, ModulesMap.MAPPING_MAP); String mappingType; if (module.hasDefined(TYPE)) { mappingType = MappingModuleDefinition.TYPE.resolveModelAttribute(context, module).asString(); } else { mappingType = MappingType.ROLE.toString(); } Map<String, Object> options = extractOptions(context, module); MappingModuleEntry entry = new MappingModuleEntry(codeName, options, mappingType); mappingInfo.add(entry); applicationPolicy.setMappingInfo(mappingType, mappingInfo); ModelNode moduleName = LoginModuleResourceDefinition.MODULE.resolveModelAttribute(context, module); if (moduleName.isDefined() && moduleName.asString().length() > 0) { mappingInfo.setJBossModuleName(moduleName.asString()); } } return true; }
private boolean processMapping(OperationContext context, String securityDomain, ModelNode node, ApplicationPolicy applicationPolicy) throws OperationFailedException { node = peek(node, MAPPING, CLASSIC, MAPPING_MODULE); if (node == null) { return false; } for (Property moduleProperty : node.asPropertyList()) { ModelNode module = moduleProperty.getValue(); MappingInfo mappingInfo = new MappingInfo(securityDomain); String codeName = extractCode(context, module, ModulesMap.MAPPING_MAP); String mappingType; if (module.hasDefined(TYPE)) { mappingType = MappingModuleDefinition.TYPE.resolveModelAttribute(context, module).asString(); } else { mappingType = MappingType.ROLE.toString(); } Map<String, Object> options = extractOptions(context, module); MappingModuleEntry entry = new MappingModuleEntry(codeName, options, mappingType); mappingInfo.add(entry); applicationPolicy.setMappingInfo(mappingType, mappingInfo); ModelNode moduleName = LoginModuleResourceDefinition.MODULE.resolveModelAttribute(context, module); if (moduleName.isDefined() && moduleName.asString().length() > 0) { mappingInfo.setJBossModuleName(moduleName.asString()); } } return true; }
List<MappingModuleEntry> entries = parser.parse(xmlEventReader); MappingInfo mappingInfo = new MappingInfo(appPolicy.getName()); mappingInfo.add(entries); appPolicy.setMappingInfo(MappingType.ROLE.toString(), mappingInfo); mappingInfo.add(entry); String moduleType = entry.getMappingModuleType(); appPolicy.setMappingInfo(moduleType, mappingInfo);
mappingInfo.add(entry); String moduleType = entry.getMappingModuleType(); appPolicy.setMappingInfo(moduleType, mappingInfo); List<MappingModuleEntry> entries = parser.parse(reader); MappingInfo mappingInfo = new MappingInfo(appPolicy.getName()); mappingInfo.add(entries); appPolicy.setMappingInfo(MappingType.ROLE.toString(), mappingInfo); break;