SecurityDomainResourceDefinition(boolean registerRuntimeOnly) { super(new Parameters(SecurityExtension.SECURITY_DOMAIN_PATH, SecurityExtension.getResourceDescriptionResolver(Constants.SECURITY_DOMAIN)) .setAddHandler(SecurityDomainAdd.INSTANCE) .setRemoveHandler(new ServiceRemoveStepHandler(SecurityDomainService.SERVICE_NAME, SecurityDomainAdd.INSTANCE) { @Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) { super.performRuntime(context, operation, model); if (context.isResourceServiceRestartAllowed()) { String cacheType = SecurityDomainAdd.getAuthenticationCacheType(model); String securityDomain = context.getCurrentAddressValue(); if (SecurityDomainResourceDefinition.INFINISPAN_CACHE_TYPE.equals(cacheType)) { for (org.wildfly.clustering.infinispan.spi.InfinispanCacheRequirement requirement : EnumSet.allOf(org.wildfly.clustering.infinispan.spi.InfinispanCacheRequirement.class)) { context.removeService(requirement.getServiceName(context, CACHE_CONTAINER_NAME, securityDomain)); } } } } }) .setCapabilities(LEGACY_SECURITY_DOMAIN)); this.registerRuntimeOnly = registerRuntimeOnly; ApplicationTypeConfig atc = new ApplicationTypeConfig(SecurityExtension.SUBSYSTEM_NAME, Constants.SECURITY_DOMAIN); AccessConstraintDefinition acd = new ApplicationTypeAccessConstraintDefinition(atc); this.accessConstraints = Arrays.asList(SensitiveTargetAccessConstraintDefinition.SECURITY_DOMAIN, acd); setDeprecated(SecurityExtension.DEPRECATED_SINCE); }
protected JvmResourceDefinition(boolean server) { super(new Parameters(PathElement.pathElement(ModelDescriptionConstants.JVM), new StandardResourceDescriptionResolver(ModelDescriptionConstants.JVM, HostEnvironmentResourceDefinition.class.getPackage().getName() + ".LocalDescriptions", HostEnvironmentResourceDefinition.class.getClassLoader(), true, false)) .setAddHandler(new JVMAddHandler(JvmAttributes.getAttributes(server))) .setRemoveHandler(JVMRemoveHandler.INSTANCE) .setMaxOccurs(server ? 1 : Integer.MAX_VALUE) .setMinOccurs(0)); this.server = server; }
protected JvmResourceDefinition(boolean server) { super(new Parameters(PathElement.pathElement(ModelDescriptionConstants.JVM), new StandardResourceDescriptionResolver(ModelDescriptionConstants.JVM, HostEnvironmentResourceDefinition.class.getPackage().getName() + ".LocalDescriptions", HostEnvironmentResourceDefinition.class.getClassLoader(), true, false)) .setAddHandler(new JVMAddHandler(JvmAttributes.getAttributes(server))) .setRemoveHandler(JVMRemoveHandler.INSTANCE) .setMaxOccurs(server ? 1 : Integer.MAX_VALUE) .setMinOccurs(0)); this.server = server; }
private static Parameters getParameters(boolean feature) { Parameters result = new Parameters(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, JPAExtension.SUBSYSTEM_NAME), JPAExtension.getResourceDescriptionResolver()) .setFeature(feature); if (feature) { result = result.setCapabilities(JPA_CAPABILITY); } // TODO WFLY-11173 add/remove handlers don't make sense on the deployment resource result = result.setAddHandler(JPASubSystemAdd.INSTANCE).setRemoveHandler(ReloadRequiredRemoveStepHandler.INSTANCE); return result; }
private AccessIdentityResourceDefinition(AbstractAddStepHandler add) { super(new Parameters(PATH_ELEMENT, DomainManagementResolver.getResolver("core.identity")) .setAddHandler(add) .setRemoveHandler(ReloadRequiredRemoveStepHandler.INSTANCE) .setAddRestartLevel(OperationEntry.Flag.RESTART_NONE) .setRemoveRestartLevel(OperationEntry.Flag.RESTART_RESOURCE_SERVICES) .setCapabilities(MANAGEMENT_IDENTITY_RUNTIME_CAPABILITY) .setAccessConstraints(SensitiveTargetAccessConstraintDefinition.ACCESS_CONTROL)); }
public TruststoreAuthenticationResourceDefinition() { super(new Parameters(PathElement.pathElement(ModelDescriptionConstants.AUTHENTICATION, ModelDescriptionConstants.TRUSTSTORE), ControllerResolver.getDeprecatedResolver(SecurityRealmResourceDefinition.DEPRECATED_PARENT_CATEGORY, "core.management.security-realm.authentication.truststore")) .setAddHandler(new SecurityRealmChildAddHandler(true, false, ATTRIBUTE_DEFINITIONS)) .setAddRestartLevel(OperationEntry.Flag.RESTART_ALL_SERVICES) .setRemoveHandler(new SecurityRealmChildRemoveHandler(true)) .setRemoveRestartLevel(OperationEntry.Flag.RESTART_ALL_SERVICES) .setDeprecatedSince(ModelVersion.create(1, 7))); }
KerberosServerIdentityResourceDefinition() { super(new Parameters(PathElement.pathElement(SERVER_IDENTITY, KERBEROS), ControllerResolver.getDeprecatedResolver(SecurityRealmResourceDefinition.DEPRECATED_PARENT_CATEGORY, "core.management.security-realm.server-identity.kerberos")) .setAddHandler(new SecurityRealmChildAddHandler(false, false)) .setRemoveHandler(new SecurityRealmChildRemoveHandler(true)) .setAddRestartLevel(OperationEntry.Flag.RESTART_ALL_SERVICES) .setRemoveRestartLevel(OperationEntry.Flag.RESTART_ALL_SERVICES) .setDeprecatedSince(ModelVersion.create(1, 7))); }
private SocketHandlerResourceDefinition() { super(new Parameters(PATH, LoggingExtension.getResourceDescriptionResolver(NAME)) .setAddHandler(ADD_HANDLER) .setRemoveHandler(REMOVE_HANDLER) .setCapabilities(Capabilities.HANDLER_CAPABILITY) ); }
private SyslogHandlerResourceDefinition() { super(new Parameters(SYSLOG_HANDLER_PATH, LoggingExtension.getResourceDescriptionResolver(NAME)) .setAddHandler(ADD_HANDLER) .setRemoveHandler(HandlerOperations.REMOVE_HANDLER) .setCapabilities(Capabilities.HANDLER_CAPABILITY)); }
StructuredFormatterResourceDefinition(final PathElement pathElement, final String descriptionPrefix, final Class<? extends StructuredFormatter> type, final AttributeDefinition... additionalAttributes) { super( new Parameters(pathElement, LoggingExtension.getResourceDescriptionResolver(descriptionPrefix)) .setAddHandler(new AddStructuredFormatterStepHandler(type, Logging.join(DEFAULT_ATTRIBUTES, additionalAttributes))) .setRemoveHandler(REMOVE) .setCapabilities(Capabilities.FORMATTER_CAPABILITY) ); attributes = Logging.join(DEFAULT_ATTRIBUTES, additionalAttributes); writeHandler = new WriteStructuredFormatterStepHandler(attributes); }
public static InfinispanSubsystemRootResource create(ResolvePathHandler resolvePathHandler, PathManager pathManager, boolean runtimeRegistration) { Parameters parameters = new Parameters(PathElement.pathElement(SUBSYSTEM, InfinispanExtension.SUBSYSTEM_NAME), new InfinispanResourceDescriptionResolver()); parameters.setAddHandler(new InfinispanSubsystemAdd()); parameters.setRemoveHandler(ReloadRequiredRemoveStepHandler.INSTANCE); parameters.setAddRestartLevel(OperationEntry.Flag.RESTART_ALL_SERVICES); return new InfinispanSubsystemRootResource(parameters, resolvePathHandler, pathManager, runtimeRegistration); }
public PatternFormatterResourceDefinition() { super(new Parameters(PATH, LoggingExtension.getResourceDescriptionResolver(NAME)) .setAddHandler(ADD) .setRemoveHandler(REMOVE) .setCapabilities(Capabilities.FORMATTER_CAPABILITY)); }
public LoggerResourceDefinition(final boolean includeLegacy) { super(new Parameters(LOGGER_PATH, LoggingExtension.getResourceDescriptionResolver(NAME)) .setAddHandler(includeLegacy ? new LoggerOperations.LoggerAddOperationStepHandler(join(WRITABLE_ATTRIBUTES, LEGACY_ATTRIBUTES)) : new LoggerOperations.LoggerAddOperationStepHandler(WRITABLE_ATTRIBUTES)) .setRemoveHandler(LoggerOperations.REMOVE_LOGGER) .setAccessConstraints(new ApplicationTypeAccessConstraintDefinition(new ApplicationTypeConfig(LoggingExtension.SUBSYSTEM_NAME, NAME))) .setCapabilities(Capabilities.LOGGER_CAPABILITY)); writableAttributes = (includeLegacy ? join(WRITABLE_ATTRIBUTES, LEGACY_ATTRIBUTES) : WRITABLE_ATTRIBUTES); this.writeHandler = new LoggerOperations.LoggerWriteAttributeHandler(writableAttributes); }
public NativeManagementResourceDefinition(final LocalHostControllerInfoImpl hostControllerInfo) { super(new Parameters(RESOURCE_PATH, HostModelUtil.getResourceDescriptionResolver("core","management","native-interface")) .setAddHandler(new NativeManagementAddHandler(hostControllerInfo)) .setRemoveHandler(NativeManagementRemoveHandler.INSTANCE)); }
public LocalAuthenticationResourceDefinition() { super(new Parameters(PathElement.pathElement(ModelDescriptionConstants.AUTHENTICATION, ModelDescriptionConstants.LOCAL), ControllerResolver.getDeprecatedResolver(SecurityRealmResourceDefinition.DEPRECATED_PARENT_CATEGORY, "core.management.security-realm.authentication.local")) .setAddHandler(new SecurityRealmChildAddHandler(true, false, ATTRIBUTE_DEFINITIONS)) .setRemoveHandler(new SecurityRealmChildRemoveHandler(true)) .setAddRestartLevel(OperationEntry.Flag.RESTART_ALL_SERVICES) .setRemoveRestartLevel(OperationEntry.Flag.RESTART_ALL_SERVICES) .setDeprecatedSince(ModelVersion.create(1, 7))); }
private SecurityRealmResourceDefinition() { super(new Parameters(PathElement.pathElement(SECURITY_REALM), ControllerResolver.getResolver(DEPRECATED_PARENT_CATEGORY)) .setAddHandler(SecurityRealmAddHandler.INSTANCE) .setRemoveHandler(SecurityRealmRemoveHandler.INSTANCE) .setAddRestartLevel(OperationEntry.Flag.RESTART_NONE) .setRemoveRestartLevel(OperationEntry.Flag.RESTART_RESOURCE_SERVICES) .setAccessConstraints(SensitiveTargetAccessConstraintDefinition.SECURITY_REALM) .addCapabilities(MANAGEMENT_SECURITY_REALM_CAPABILITY) .setDeprecatedSince(ModelVersion.create(1, 7))); }
public PropertiesFileResourceDefinition(final PathElement pathElement, final ResourceDescriptionResolver descriptionResolver, final OperationStepHandler addHandler, final OperationStepHandler removeHandler, final OperationEntry.Flag addRestartLevel, final OperationEntry.Flag removeRestartLevel) { this(new Parameters(pathElement, descriptionResolver) .setAddHandler(addHandler) .setAddRestartLevel(addRestartLevel) .setRemoveHandler(removeHandler) .setRemoveRestartLevel(removeRestartLevel)); }
public LdapAuthenticationResourceDefinition() { super(new Parameters(PathElement.pathElement(ModelDescriptionConstants.AUTHENTICATION, ModelDescriptionConstants.LDAP), ControllerResolver.getDeprecatedResolver(SecurityRealmResourceDefinition.DEPRECATED_PARENT_CATEGORY, "core.management.security-realm.authentication.ldap")) .setAddHandler(new LdapAuthenticationAddHandler()) .setRemoveHandler(new SecurityRealmChildRemoveHandler(true)) .setAddRestartLevel(OperationEntry.Flag.RESTART_ALL_SERVICES) .setRemoveRestartLevel(OperationEntry.Flag.RESTART_ALL_SERVICES) .setDeprecatedSince(ModelVersion.create(1, 7))); }
public PropertiesAuthorizationResourceDefinition() { super(new Parameters(PathElement.pathElement(ModelDescriptionConstants.AUTHORIZATION, ModelDescriptionConstants.PROPERTIES), ControllerResolver.getDeprecatedResolver(SecurityRealmResourceDefinition.DEPRECATED_PARENT_CATEGORY, "core.management.security-realm.authorization.properties")) .setAddHandler(new SecurityRealmChildAddHandler(false, true, ATTRIBUTE_DEFINITIONS)) .setAddRestartLevel(OperationEntry.Flag.RESTART_ALL_SERVICES) .setRemoveHandler(new SecurityRealmChildRemoveHandler(false)) .setRemoveRestartLevel(OperationEntry.Flag.RESTART_ALL_SERVICES) .setDeprecatedSince(ModelVersion.create(1, 7))); }
DeploymentScannerDefinition(final PathManager pathManager) { super(new Parameters(DeploymentScannerExtension.SCANNERS_PATH, DeploymentScannerExtension.getResourceDescriptionResolver("deployment.scanner")) .setAddHandler(new DeploymentScannerAdd(pathManager)) .setRemoveHandler(DeploymentScannerRemove.INSTANCE) .setCapabilities(SCANNER_CAPABILITY) ); this.pathManager = pathManager; }