private Hashtable<String, String> getObjectFactoryEnvironment(OperationContext context, ModelNode model) throws OperationFailedException { Hashtable<String, String> environment; Map<String, String> resolvedModelAttribute = NamingBindingResourceDefinition.ENVIRONMENT.unwrap(context, model); environment = new Hashtable<String, String>(resolvedModelAttribute); return environment; }
private Map<String, Object> extractOptions(OperationContext context, ModelNode module) throws OperationFailedException { return new LinkedHashMap<String, Object>(MappingModuleDefinition.MODULE_OPTIONS.unwrap(context, module)); }
@Override protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { Map<String, Object> vaultOptions = new HashMap<String, Object>(); ModelNode vaultClassNode = CODE.resolveModelAttribute(context, model); String vaultClass = vaultClassNode.getType() == ModelType.UNDEFINED ? null : vaultClassNode.asString(); if (operation.hasDefined(Constants.VAULT_OPTIONS)) { for (Map.Entry<String,String> vaultOption : OPTIONS.unwrap(context,model).entrySet()) { vaultOptions.put(vaultOption.getKey(), vaultOption.getValue()); } } // add security vault service if (vaultClass != null || !vaultOptions.isEmpty()) { final SecurityVaultService vaultService = new SecurityVaultService(vaultClass, vaultOptions); context.getServiceTarget() .addService(SecurityVaultService.SERVICE_NAME, vaultService) .setInitialMode(ServiceController.Mode.ACTIVE).install(); } } }
public static Extension extractExtension(final OperationContext operationContext, final ModelNode dataSourceNode, final SimpleAttributeDefinition className, final PropertiesAttributeDefinition propertyName) throws ValidateException, OperationFailedException { if (dataSourceNode.hasDefined(className.getName())) { String exceptionSorterClassName = getResolvedStringIfSetOrGetDefault(operationContext, dataSourceNode, className); Map<String, String> unwrapped = propertyName.unwrap(operationContext, dataSourceNode); Map<String, String> exceptionSorterProperty = unwrapped.size() > 0 ? unwrapped : null; return new Extension(exceptionSorterClassName, exceptionSorterProperty); } else { return null; } }
private static CustomServerConfig readCustomServerConfig(final String protocol, final OperationContext operationContext, final ModelNode model) throws OperationFailedException { final ModelNode socketModel = MailServerDefinition.OUTBOUND_SOCKET_BINDING_REF_OPTIONAL.resolveModelAttribute(operationContext, model); final String socket = socketModel.isDefined() ? socketModel.asString() : null; final Credentials credentials = readCredentials(operationContext, model); boolean ssl = MailServerDefinition.SSL.resolveModelAttribute(operationContext, model).asBoolean(); boolean tls = MailServerDefinition.TLS.resolveModelAttribute(operationContext, model).asBoolean(); Map<String, String> properties = MailServerDefinition.PROPERTIES.unwrap(operationContext, model); return new CustomServerConfig(protocol, socket, credentials, ssl, tls, properties); }
for (Map.Entry<String, String> entry : ((PropertiesAttributeDefinition) JcaDistributedWorkManagerDefinition.DWmParameters.POLICY_OPTIONS.getAttribute()).unwrap(context, model).entrySet()) { try { injector.inject(namedDistributedWorkManager.getPolicy(), entry.getKey(), entry.getValue()); for (Map.Entry<String, String> entry : ((PropertiesAttributeDefinition) JcaDistributedWorkManagerDefinition.DWmParameters.SELECTOR_OPTIONS.getAttribute()).unwrap(context, model).entrySet()) { try { injector.inject(namedDistributedWorkManager.getSelector(), entry.getKey(), entry.getValue());
properties.putAll(JSSEResourceDefinition.ADDITIONAL_PROPERTIES.unwrap(context, node)); jsseSecurityDomain.setAdditionalProperties(properties);
private Hashtable<String, String> getObjectFactoryEnvironment(OperationContext context, ModelNode model) throws OperationFailedException { Hashtable<String, String> environment; Map<String, String> resolvedModelAttribute = NamingBindingResourceDefinition.OBJECT_FACTORY_ENV.unwrap(context, model); environment = new Hashtable<String, String>(resolvedModelAttribute); return environment; }
private Hashtable<String, String> getObjectFactoryEnvironment(OperationContext context, ModelNode model) throws OperationFailedException { Hashtable<String, String> environment; Map<String, String> resolvedModelAttribute = NamingBindingResourceDefinition.ENVIRONMENT.unwrap(context, model); environment = new Hashtable<String, String>(resolvedModelAttribute); return environment; }
private Hashtable<String, String> getObjectFactoryEnvironment(OperationContext context, ModelNode model) throws OperationFailedException { Hashtable<String, String> environment; Map<String, String> resolvedModelAttribute = NamingBindingResourceDefinition.ENVIRONMENT.unwrap(context, model); environment = new Hashtable<String, String>(resolvedModelAttribute); return environment; }
private Map<String, Object> extractOptions(OperationContext context, ModelNode module) throws OperationFailedException { return new LinkedHashMap<String, Object>(MappingModuleDefinition.MODULE_OPTIONS.unwrap(context, module)); }
private Map<String, Object> extractOptions(OperationContext context, ModelNode module) throws OperationFailedException { return new LinkedHashMap<String, Object>(MappingModuleDefinition.MODULE_OPTIONS.unwrap(context, module)); }
@Override protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode resolvedValue, ModelNode currentValue, HandbackHolder handbackHolder) throws OperationFailedException { Map<String, String> newProps = securityProperties.unwrap(context, resolvedValue); Map<String, String> oldProps = securityProperties.unwrap(context, currentValue); setProperties(context, newProps, oldProps); return false; }
private Map<String, Object> extractOptions(OperationContext context, ModelNode module) throws OperationFailedException { return new LinkedHashMap<String, Object>(MappingModuleDefinition.MODULE_OPTIONS.unwrap(context, module)); }
@Override protected void revertUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode valueToRestore, ModelNode valueToRevert, Object handback) throws OperationFailedException { Map<String, String> newProps = securityProperties.unwrap(context, valueToRestore); Map<String, String> oldProps = securityProperties.unwrap(context, valueToRevert); setProperties(context, newProps, oldProps); }
public static Extension extractExtension(final OperationContext operationContext, final ModelNode dataSourceNode, final SimpleAttributeDefinition className, final PropertiesAttributeDefinition propertyName) throws ValidateException, OperationFailedException { if (dataSourceNode.hasDefined(className.getName())) { String exceptionSorterClassName = getResolvedStringIfSetOrGetDefault(operationContext, dataSourceNode, className); Map<String, String> unwrapped = propertyName.unwrap(operationContext, dataSourceNode); Map<String, String> exceptionSorterProperty = unwrapped.size() > 0 ? unwrapped : null; return new Extension(exceptionSorterClassName, exceptionSorterProperty); } else { return null; } }
static ConnectorServiceConfiguration createConnectorServiceConfiguration(final OperationContext context, final String name, final ModelNode model) throws OperationFailedException { final String factoryClass = CommonAttributes.FACTORY_CLASS.resolveModelAttribute(context, model).asString(); Map<String, String> unwrappedParameters = CommonAttributes.PARAMS.unwrap(context, model); Map<String, Object> parameters = new HashMap<String, Object>(unwrappedParameters); return new ConnectorServiceConfiguration() .setFactoryClassName(factoryClass) .setParams(parameters) .setName(name); }
static ConnectorServiceConfiguration createConnectorServiceConfiguration(final OperationContext context, final String name, final ModelNode model) throws OperationFailedException { final String factoryClass = CommonAttributes.FACTORY_CLASS.resolveModelAttribute(context, model).asString(); Map<String, String> unwrappedParameters = CommonAttributes.PARAMS.unwrap(context, model); Map<String, Object> parameters = new HashMap<String, Object>(unwrappedParameters); return new ConnectorServiceConfiguration() .setFactoryClassName(factoryClass) .setParams(parameters) .setName(name); }
public static Extension extractExtension(final OperationContext operationContext, final ModelNode dataSourceNode, final SimpleAttributeDefinition className, final PropertiesAttributeDefinition propertyName) throws ValidateException, OperationFailedException { if (dataSourceNode.hasDefined(className.getName())) { String exceptionSorterClassName = getResolvedStringIfSetOrGetDefault(operationContext, dataSourceNode, className); Map<String, String> unwrapped = propertyName.unwrap(operationContext, dataSourceNode); Map<String, String> exceptionSorterProperty = unwrapped.size() > 0 ? unwrapped : null; return new Extension(exceptionSorterClassName, exceptionSorterProperty); } else { return null; } } }
private static CustomServerConfig readCustomServerConfig(final String protocol, final OperationContext operationContext, final ModelNode model) throws OperationFailedException { final ModelNode socketModel = MailServerDefinition.OUTBOUND_SOCKET_BINDING_REF_OPTIONAL.resolveModelAttribute(operationContext, model); final String socket = socketModel.isDefined() ? socketModel.asString() : null; final Credentials credentials = readCredentials(operationContext, model); boolean ssl = MailServerDefinition.SSL.resolveModelAttribute(operationContext, model).asBoolean(); boolean tls = MailServerDefinition.TLS.resolveModelAttribute(operationContext, model).asBoolean(); Map<String, String> properties = MailServerDefinition.PROPERTIES.unwrap(operationContext, model); return new CustomServerConfig(protocol, socket, credentials, ssl, tls, properties); }