model.get(Constants.ARCHIVE.getName()).set(name);
setAttribute(model, Constants.BOOTSTRAP_CONTEXT, ironJacamarMetadata.getBootstrapContext());
if (ironJacamarMetadata.getTransactionSupport() != null)
model.get(Constants.TRANSACTION_SUPPORT.getName()).set(ironJacamarMetadata.getTransactionSupport().name());
if (ironJacamarMetadata.getWorkManager() != null && ironJacamarMetadata.getWorkManager().getSecurity() != null) {
WorkManagerSecurity security = ironJacamarMetadata.getWorkManager().getSecurity();
model.get(Constants.WM_SECURITY.getName()).set(true);
if (security.getDefaultGroups() != null) {
for (String group : security.getDefaultGroups()) {
model.get(Constants.WM_SECURITY_DEFAULT_GROUPS.getName()).add(group);
}
}
if (security.getDefaultPrincipal() != null)
model.get(Constants.WM_SECURITY_DEFAULT_PRINCIPAL.getName()).set(security.getDefaultPrincipal());
model.get(Constants.WM_SECURITY_MAPPING_REQUIRED.getName()).set(security.isMappingRequired());
model.get(Constants.WM_SECURITY_DOMAIN.getName()).set(security.getDomain());
if (security.getGroupMappings() != null) {
for (Map.Entry<String, String> entry : security.getGroupMappings().entrySet()) {
final Resource mapping = new IronJacamarResource.IronJacamarRuntimeResource();
final ModelNode subModel = mapping.getModel();
subModel.get(Constants.WM_SECURITY_MAPPING_FROM.getName()).set(entry.getKey());
subModel.get(Constants.WM_SECURITY_MAPPING_TO.getName()).set(entry.getKey());
final PathElement element = PathElement.pathElement(Constants.WM_SECURITY_MAPPING_GROUPS.getName(), WM_SECURITY_MAPPING_GROUP.getName());
ijResourceAdapter.registerChild(element, mapping);
}
}
if (security.getUserMappings() != null) {
for (Map.Entry<String, String> entry : security.getUserMappings().entrySet()) {
final Resource mapping = new IronJacamarResource.IronJacamarRuntimeResource();
final ModelNode subModel = mapping.getModel();
subModel.get(Constants.WM_SECURITY_MAPPING_FROM.getName()).set(entry.getKey());
subModel.get(Constants.WM_SECURITY_MAPPING_TO.getName()).set(entry.getKey());
final PathElement element = PathElement.pathElement(Constants.WM_SECURITY_MAPPING_USERS.getName(), WM_SECURITY_MAPPING_USER.getName());