Search in sources :

Example 46 with ResourceTransformationDescriptionBuilder

use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.

the class IDMExtension method registerTransformers_1_0.

private void registerTransformers_1_0(ExtensionContext context, SubsystemRegistration subsystemRegistration) {
    ResourceTransformationDescriptionBuilder builder = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
    ResourceTransformationDescriptionBuilder partitionManagerResourceBuilder = builder.addChildResource(PartitionManagerResourceDefinition.INSTANCE);
    ResourceTransformationDescriptionBuilder identityConfigResourceBuilder = partitionManagerResourceBuilder.addChildResource(IdentityConfigurationResourceDefinition.INSTANCE);
    ResourceTransformationDescriptionBuilder ldapTransfDescBuilder = identityConfigResourceBuilder.addChildResource(LDAPStoreResourceDefinition.INSTANCE);
    ldapTransfDescBuilder.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, LDAPStoreResourceDefinition.ACTIVE_DIRECTORY).setDiscard(new DiscardAttributeValueChecker(new ModelNode(false)), LDAPStoreResourceDefinition.ACTIVE_DIRECTORY);
    ldapTransfDescBuilder.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, LDAPStoreResourceDefinition.UNIQUE_ID_ATTRIBUTE_NAME).setDiscard(DiscardAttributeChecker.UNDEFINED, LDAPStoreResourceDefinition.UNIQUE_ID_ATTRIBUTE_NAME);
    Tools.register(builder.build(), subsystemRegistration, ModelVersion.create(1, 0));
}
Also used : DiscardAttributeValueChecker(org.jboss.as.controller.transform.description.DiscardAttributeChecker.DiscardAttributeValueChecker) ResourceTransformationDescriptionBuilder(org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder) ModelNode(org.jboss.dmr.ModelNode)

Example 47 with ResourceTransformationDescriptionBuilder

use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.

the class MailExtension method registerTransformers.

private void registerTransformers(SubsystemRegistration subsystem) {
    ChainedTransformationDescriptionBuilder chained = ResourceTransformationDescriptionBuilder.Factory.createChainedSubystemInstance(CURRENT_MODEL_VERSION);
    ModelVersion MODEL_VERSION_EAP64 = ModelVersion.create(1, 4, 0);
    ModelVersion MODEL_VERSION_EAP70 = ModelVersion.create(2, 0, 0);
    ResourceTransformationDescriptionBuilder builder70 = chained.createBuilder(CURRENT_MODEL_VERSION, MODEL_VERSION_EAP70);
    builder70.addChildResource(MAIL_SESSION_PATH).addChildResource(PathElement.pathElement(SERVER_TYPE)).getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, MailServerDefinition.CREDENTIAL_REFERENCE.getName()).setDiscard(DiscardAttributeChecker.UNDEFINED, MailServerDefinition.CREDENTIAL_REFERENCE.getName()).end().addChildResource(CUSTOM_SERVER_PATH).getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, MailServerDefinition.CREDENTIAL_REFERENCE.getName()).setDiscard(DiscardAttributeChecker.UNDEFINED, MailServerDefinition.CREDENTIAL_REFERENCE.getName());
    ResourceTransformationDescriptionBuilder builder64 = chained.createBuilder(MODEL_VERSION_EAP70, MODEL_VERSION_EAP64);
    ResourceTransformationDescriptionBuilder sessionBuilder = builder64.addChildResource(MAIL_SESSION_PATH).addChildResource(PathElement.pathElement(SERVER_TYPE)).getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, TLS).setDiscard(DiscardAttributeChecker.UNDEFINED, TLS).end();
    sessionBuilder.discardChildResource(CUSTOM_SERVER_PATH);
    chained.buildAndRegister(subsystem, new ModelVersion[] { MODEL_VERSION_EAP70, MODEL_VERSION_EAP64 });
}
Also used : ChainedTransformationDescriptionBuilder(org.jboss.as.controller.transform.description.ChainedTransformationDescriptionBuilder) ResourceTransformationDescriptionBuilder(org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder) ModelVersion(org.jboss.as.controller.ModelVersion)

Example 48 with ResourceTransformationDescriptionBuilder

use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.

the class WSExtension method registerTransformers2_0_0.

private void registerTransformers2_0_0(SubsystemRegistration registration) {
    ModelVersion version = ModelVersion.create(2, 0, 0);
    ResourceTransformationDescriptionBuilder builder = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
    builder.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.SIMPLE_EXPRESSIONS, Attributes.STATISTICS_ENABLED);
    TransformationDescription.Tools.register(builder.build(), registration, version);
}
Also used : ResourceTransformationDescriptionBuilder(org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder) ModelVersion(org.jboss.as.controller.ModelVersion)

Example 49 with ResourceTransformationDescriptionBuilder

use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.

the class SingletonResourceDefinition method buildTransformers.

static TransformationDescription buildTransformers(ModelVersion version) {
    ResourceTransformationDescriptionBuilder builder = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
    SingletonPolicyResourceDefinition.buildTransformation(version, builder);
    return builder.build();
}
Also used : ResourceTransformationDescriptionBuilder(org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder)

Example 50 with ResourceTransformationDescriptionBuilder

use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.

the class TimerServiceResourceDefinition method registerTransformers_1_2_0.

static void registerTransformers_1_2_0(ResourceTransformationDescriptionBuilder parent) {
    ResourceTransformationDescriptionBuilder timerService = parent.addChildResource(EJB3SubsystemModel.TIMER_SERVICE_PATH);
    registerDataStoreTransformers(timerService);
}
Also used : ResourceTransformationDescriptionBuilder(org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder)

Aggregations

ResourceTransformationDescriptionBuilder (org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder)93 ModelNode (org.jboss.dmr.ModelNode)46 PathAddress (org.jboss.as.controller.PathAddress)25 DiscardAttributeChecker (org.jboss.as.controller.transform.description.DiscardAttributeChecker)24 TransformationContext (org.jboss.as.controller.transform.TransformationContext)15 SimpleOperationTransformer (org.jboss.as.clustering.controller.transform.SimpleOperationTransformer)9 LegacyPropertyResourceTransformer (org.jboss.as.clustering.controller.transform.LegacyPropertyResourceTransformer)7 ModelVersion (org.jboss.as.controller.ModelVersion)7 Resource (org.jboss.as.controller.registry.Resource)7 ChainedTransformationDescriptionBuilder (org.jboss.as.controller.transform.description.ChainedTransformationDescriptionBuilder)7 ResourceTransformationContext (org.jboss.as.controller.transform.ResourceTransformationContext)6 ResourceTransformer (org.jboss.as.controller.transform.ResourceTransformer)6 AttributeConverter (org.jboss.as.controller.transform.description.AttributeConverter)6 Map (java.util.Map)4 LegacyPropertyAddOperationTransformer (org.jboss.as.clustering.controller.transform.LegacyPropertyAddOperationTransformer)4 OperationTransformer (org.jboss.as.clustering.controller.transform.OperationTransformer)4 OperationFailedException (org.jboss.as.controller.OperationFailedException)4 PathElement (org.jboss.as.controller.PathElement)4 RejectAttributeChecker (org.jboss.as.controller.transform.description.RejectAttributeChecker)4 LinkedList (java.util.LinkedList)2