use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class MessagingSubsystemRootResourceDefinition method registerTransformers_EAP_7_0_0.
private static void registerTransformers_EAP_7_0_0(SubsystemRegistration subsystemRegistration) {
final ResourceTransformationDescriptionBuilder subsystem = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
rejectDefinedAttributeWithDefaultValue(subsystem, MessagingSubsystemRootResourceDefinition.GLOBAL_CLIENT_THREAD_POOL_MAX_SIZE, MessagingSubsystemRootResourceDefinition.GLOBAL_CLIENT_SCHEDULED_THREAD_POOL_MAX_SIZE);
ResourceTransformationDescriptionBuilder server = subsystem.addChildResource(MessagingExtension.SERVER_PATH);
// reject journal-datasource, journal-bindings-table introduced in management version 2.0.0 if it is defined and different from the default value.
rejectDefinedAttributeWithDefaultValue(server, ServerDefinition.ELYTRON_DOMAIN, ServerDefinition.JOURNAL_DATASOURCE, ServerDefinition.JOURNAL_MESSAGES_TABLE, ServerDefinition.JOURNAL_BINDINGS_TABLE, ServerDefinition.JOURNAL_LARGE_MESSAGES_TABLE, ServerDefinition.JOURNAL_PAGE_STORE_TABLE, ServerDefinition.JOURNAL_DATABASE);
server.getAttributeBuilder().setDiscard(DiscardAttributeChecker.ALWAYS, ServerDefinition.CREDENTIAL_REFERENCE).addRejectCheck(DEFINED, ServerDefinition.CREDENTIAL_REFERENCE);
ResourceTransformationDescriptionBuilder replicationMaster = server.addChildResource(MessagingExtension.REPLICATION_MASTER_PATH);
replicationMaster.getAttributeBuilder().addRejectCheck(UNDEFINED, HAAttributes.CHECK_FOR_LIVE_SERVER);
ResourceTransformationDescriptionBuilder replicationColocated = server.addChildResource(MessagingExtension.REPLICATION_COLOCATED_PATH);
ResourceTransformationDescriptionBuilder masterForReplicationColocated = replicationColocated.addChildResource(MessagingExtension.CONFIGURATION_MASTER_PATH);
masterForReplicationColocated.getAttributeBuilder().addRejectCheck(UNDEFINED, HAAttributes.CHECK_FOR_LIVE_SERVER);
ResourceTransformationDescriptionBuilder bridge = server.addChildResource(MessagingExtension.BRIDGE_PATH);
bridge.getAttributeBuilder().setDiscard(DiscardAttributeChecker.ALWAYS, BridgeDefinition.CREDENTIAL_REFERENCE).addRejectCheck(DEFINED, BridgeDefinition.CREDENTIAL_REFERENCE);
ResourceTransformationDescriptionBuilder httpConnector = server.addChildResource(HTTPConnectorDefinition.INSTANCE);
// reject server-name introduced in management version 2.0.0 if it is defined
rejectDefinedAttributeWithDefaultValue(httpConnector, HTTPConnectorDefinition.SERVER_NAME);
// reject producer-window-size introduced in management version 2.0.0 if it is defined and different from the default value.
rejectDefinedAttributeWithDefaultValue(bridge, BridgeDefinition.PRODUCER_WINDOW_SIZE);
ResourceTransformationDescriptionBuilder jmsBridge = server.addChildResource(MessagingExtension.JMS_BRIDGE_PATH);
rejectDefinedAttributeWithDefaultValue(jmsBridge, JMSBridgeDefinition.SOURCE_CREDENTIAL_REFERENCE);
rejectDefinedAttributeWithDefaultValue(jmsBridge, JMSBridgeDefinition.TARGET_CREDENTIAL_REFERENCE);
ResourceTransformationDescriptionBuilder clusterConnection = server.addChildResource(MessagingExtension.CLUSTER_CONNECTION_PATH);
// reject producer-window-size introduced in management version 2.0.0 if it is defined and different from the default value.
rejectDefinedAttributeWithDefaultValue(clusterConnection, ClusterConnectionDefinition.PRODUCER_WINDOW_SIZE);
ResourceTransformationDescriptionBuilder pooledConnectionFactory = server.addChildResource(MessagingExtension.POOLED_CONNECTION_FACTORY_PATH);
// reject rebalance-connections introduced in management version 2.0.0 if it is defined and different from the default value.
rejectDefinedAttributeWithDefaultValue(pooledConnectionFactory, ConnectionFactoryAttributes.Pooled.REBALANCE_CONNECTIONS);
// reject statistics-enabled introduced in management version 2.0.0 if it is defined and different from the default value.
rejectDefinedAttributeWithDefaultValue(pooledConnectionFactory, ConnectionFactoryAttributes.Pooled.STATISTICS_ENABLED);
// reject max-pool-size whose default value has been changed in management version 2.0.0
defaultValueAttributeConverter(pooledConnectionFactory, ConnectionFactoryAttributes.Pooled.MAX_POOL_SIZE);
// reject min-pool-size whose default value has been changed in management version 2.0.0
defaultValueAttributeConverter(pooledConnectionFactory, ConnectionFactoryAttributes.Pooled.MIN_POOL_SIZE);
TransformationDescription.Tools.register(subsystem.build(), subsystemRegistration, MessagingExtension.VERSION_1_0_0);
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class FederationExtension method registerTransformers_1_0.
private void registerTransformers_1_0(ExtensionContext context, SubsystemRegistration subsystemRegistration) {
ResourceTransformationDescriptionBuilder builder = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
ResourceTransformationDescriptionBuilder federationTransfDescBuilder = builder.addChildResource(new FederationResourceDefinition(context));
ResourceTransformationDescriptionBuilder keyStoreTransfDescBuilder = federationTransfDescBuilder.addChildResource(KeyStoreProviderResourceDefinition.INSTANCE);
keyStoreTransfDescBuilder.rejectChildResource(KeyResourceDefinition.INSTANCE.getPathElement());
TransformationDescription.Tools.register(builder.build(), subsystemRegistration, ModelVersion.create(1, 0));
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class EJB3SubsystemRootResourceDefinition method registerTransformers1_2_1_and_1_3_0.
private static void registerTransformers1_2_1_and_1_3_0(SubsystemRegistration subsystemRegistration, ModelVersion version) {
final ResourceTransformationDescriptionBuilder builder = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
builder.getAttributeBuilder().addRename(DEFAULT_SFSB_CACHE, EJB3SubsystemModel.DEFAULT_CLUSTERED_SFSB_CACHE);
builder.getAttributeBuilder().addRename(DEFAULT_SFSB_PASSIVATION_DISABLED_CACHE, EJB3SubsystemModel.DEFAULT_SFSB_CACHE);
//This used to behave as 'true' and it is now defaulting as 'true'
builder.getAttributeBuilder().setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(true)), EJB3SubsystemRootResourceDefinition.LOG_EJB_EXCEPTIONS);
builder.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, EJB3SubsystemRootResourceDefinition.LOG_EJB_EXCEPTIONS);
builder.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, EJB3SubsystemRootResourceDefinition.DISABLE_DEFAULT_EJB_PERMISSIONS);
// We can always discard this attribute, because it's meaningless without the security-manager subsystem, and
// a legacy slave can't have that subsystem in its profile.
builder.getAttributeBuilder().setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(false)), EJB3SubsystemRootResourceDefinition.DISABLE_DEFAULT_EJB_PERMISSIONS);
//builder.getAttributeBuilder().setValueConverter(AttributeConverter.Factory.createHardCoded(new ModelNode("hornetq-ra"), true), EJB3SubsystemRootResourceDefinition.DEFAULT_RESOURCE_ADAPTER_NAME);
builder.getAttributeBuilder().setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(false)), EJB3SubsystemRootResourceDefinition.ALLOW_EJB_NAME_REGEX);
builder.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, EJB3SubsystemRootResourceDefinition.ALLOW_EJB_NAME_REGEX);
builder.getAttributeBuilder().setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(false)), EJB3SubsystemRootResourceDefinition.ENABLE_GRACEFUL_TXN_SHUTDOWN).addRejectCheck(RejectAttributeChecker.DEFINED, EJB3SubsystemRootResourceDefinition.ENABLE_GRACEFUL_TXN_SHUTDOWN);
PassivationStoreResourceDefinition.registerTransformers_1_2_1_and_1_3_0(builder);
EJB3RemoteResourceDefinition.registerTransformers_1_2_0_and_1_3_0(builder);
MdbDeliveryGroupResourceDefinition.registerTransformers_1_2_0_and_1_3_0(builder);
StrictMaxPoolResourceDefinition.registerTransformers_1_2_0_and_1_3_0(builder);
ApplicationSecurityDomainDefinition.registerTransformers_1_2_0_and_1_3_0(builder);
IdentityResourceDefinition.registerTransformers_1_2_0_and_1_3_0(builder);
builder.rejectChildResource(PathElement.pathElement(EJB3SubsystemModel.REMOTING_PROFILE));
if (version.equals(VERSION_1_2_1)) {
TimerServiceResourceDefinition.registerTransformers_1_2_0(builder);
} else if (version.equals(VERSION_1_3_0)) {
TimerServiceResourceDefinition.registerTransformers_1_3_0(builder);
}
TransformationDescription.Tools.register(builder.build(), subsystemRegistration, version);
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class EJB3SubsystemRootResourceDefinition method registerTransformers_3_0_0.
private static void registerTransformers_3_0_0(SubsystemRegistration subsystemRegistration) {
final ResourceTransformationDescriptionBuilder builder = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
builder.getAttributeBuilder().setValueConverter(AttributeConverter.Factory.createHardCoded(new ModelNode("hornetq-ra"), true), EJB3SubsystemRootResourceDefinition.DEFAULT_RESOURCE_ADAPTER_NAME).end();
builder.getAttributeBuilder().setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(false)), EJB3SubsystemRootResourceDefinition.ALLOW_EJB_NAME_REGEX);
builder.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, EJB3SubsystemRootResourceDefinition.ALLOW_EJB_NAME_REGEX);
builder.getAttributeBuilder().setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(false)), EJB3SubsystemRootResourceDefinition.ENABLE_GRACEFUL_TXN_SHUTDOWN);
builder.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, EJB3SubsystemRootResourceDefinition.ENABLE_GRACEFUL_TXN_SHUTDOWN);
MdbDeliveryGroupResourceDefinition.registerTransformers_3_0(builder);
EJB3RemoteResourceDefinition.registerTransformers_3_0(builder);
StrictMaxPoolResourceDefinition.registerTransformers_3_0_0(builder);
ApplicationSecurityDomainDefinition.registerTransformers_3_0_0(builder);
IdentityResourceDefinition.registerTransformers_3_0_0(builder);
TransformationDescription.Tools.register(builder.build(), subsystemRegistration, VERSION_3_0_0);
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class AuditResourceDefinition method registerTransformers_1_3_0.
static void registerTransformers_1_3_0(ResourceTransformationDescriptionBuilder parentBuilder) {
ResourceTransformationDescriptionBuilder builder = parentBuilder.addChildResource(SecurityExtension.PATH_AUDIT_CLASSIC);
MappingProviderModuleDefinition.registerTransformers_1_3_0(builder);
}
Aggregations