use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class DistributedCacheResourceDefinition method buildTransformation.
static void buildTransformation(ModelVersion version, ResourceTransformationDescriptionBuilder parent) {
ResourceTransformationDescriptionBuilder builder = parent.addChildResource(WILDCARD_PATH);
if (InfinispanModel.VERSION_4_2_0.requiresTransformation(version)) {
builder.getAttributeBuilder().setValueConverter(new AttributeConverter.DefaultValueAttributeConverter(Attribute.L1_LIFESPAN.getDefinition()), Attribute.L1_LIFESPAN.getDefinition()).end();
}
if (InfinispanModel.VERSION_4_1_0.requiresTransformation(version)) {
builder.getAttributeBuilder().setValueConverter(new AttributeConverter.DefaultValueAttributeConverter(Attribute.CONSISTENT_HASH_STRATEGY.getDefinition()), Attribute.CONSISTENT_HASH_STRATEGY.getDefinition()).setValueConverter(new AttributeConverter.DefaultValueAttributeConverter(Attribute.SEGMENTS.getDefinition()), Attribute.SEGMENTS.getDefinition()).end();
}
if (InfinispanModel.VERSION_3_0_0.requiresTransformation(version)) {
builder.getAttributeBuilder().setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(Attribute.CAPACITY_FACTOR.getDefinition().getDefaultValue()), Attribute.CAPACITY_FACTOR.getDefinition()).addRejectCheck(RejectAttributeChecker.DEFINED, Attribute.CAPACITY_FACTOR.getDefinition()).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(ConsistentHashStrategy.INTRA_CACHE.name())), Attribute.CONSISTENT_HASH_STRATEGY.getDefinition()).addRejectCheck(RejectAttributeChecker.DEFINED, Attribute.CONSISTENT_HASH_STRATEGY.getDefinition()).end();
}
SharedStateCacheResourceDefinition.buildTransformation(version, builder);
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class ModClusterConfigResourceDefinition method buildTransformation.
public static void buildTransformation(ModelVersion version, ResourceTransformationDescriptionBuilder parent) {
ResourceTransformationDescriptionBuilder builder = parent.addChildResource(PATH);
if (ModClusterModel.VERSION_4_1_0.requiresTransformation(version)) {
builder.getAttributeBuilder().setDiscard(DiscardAttributeChecker.UNDEFINED, SSL_CONTEXT).addRejectCheck(RejectAttributeChecker.DEFINED, SSL_CONTEXT).end();
}
if (ModClusterModel.VERSION_4_0_0.requiresTransformation(version)) {
builder.getAttributeBuilder().setValueConverter(new AttributeConverter.DefaultAttributeConverter() {
@Override
protected void convertAttribute(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) {
if (!attributeValue.isDefined()) {
// Workaround legacy slaves not accepting null/empty values
// JBAS014704: '' is an invalid value for parameter excluded-contexts. Values must have a minimum length of 1 characters
attributeValue.set(" ");
}
}
}, EXCLUDED_CONTEXTS).end();
}
if (ModClusterModel.VERSION_3_0_0.requiresTransformation(version)) {
builder.getAttributeBuilder().setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(STATUS_INTERVAL.getDefaultValue()), STATUS_INTERVAL).addRejectCheck(new RejectAttributeChecker.SimpleAcceptAttributeChecker(STATUS_INTERVAL.getDefaultValue()), STATUS_INTERVAL).setDiscard(DiscardAttributeChecker.UNDEFINED, PROXIES).addRejectCheck(RejectAttributeChecker.DEFINED, PROXIES).end();
}
if (ModClusterModel.VERSION_1_5_0.requiresTransformation(version)) {
builder.getAttributeBuilder().addRejectCheck(SessionDrainingStrategyChecker.INSTANCE, SESSION_DRAINING_STRATEGY).setDiscard(SessionDrainingStrategyChecker.INSTANCE, SESSION_DRAINING_STRATEGY).end();
}
DynamicLoadProviderDefinition.buildTransformation(version, builder);
ModClusterSSLResourceDefinition.buildTransformation(version, builder);
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class ModClusterSubsystemResourceDefinition method buildTransformation.
static TransformationDescription buildTransformation(ModelVersion version) {
ResourceTransformationDescriptionBuilder builder = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
ModClusterConfigResourceDefinition.buildTransformation(version, builder);
return builder.build();
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class MappingProviderModuleDefinition method registerTransformers_1_3_0.
static void registerTransformers_1_3_0(ResourceTransformationDescriptionBuilder parentBuilder) {
ResourceTransformationDescriptionBuilder builder = parentBuilder.addChildResource(PATH_PROVIDER_MODULE);
builder.getAttributeBuilder().setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, true, new ModelNode(ModuleName.PICKETBOX.getName())), MODULE).addRejectCheck(RejectAttributeChecker.DEFINED, MODULE).end();
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class WebExtension method registerTransformers_2_x_0.
//todo, could probably be removed as 2_x was never in EAP 6.x
private void registerTransformers_2_x_0(SubsystemRegistration registration, int minor) {
final ResourceTransformationDescriptionBuilder subsystemRoot = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
subsystemRoot.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, WebDefinition.DEFAULT_SESSION_TIMEOUT).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, true, new ModelNode(30)), WebDefinition.DEFAULT_SESSION_TIMEOUT).end();
final ResourceTransformationDescriptionBuilder hostBuilder = subsystemRoot.addChildResource(HOST_PATH);
final ResourceTransformationDescriptionBuilder ssoBuilder = hostBuilder.addChildResource(SSO_PATH);
ssoBuilder.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, WebSSODefinition.HTTP_ONLY).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, true, new ModelNode(true)), WebSSODefinition.HTTP_ONLY).end();
if (minor == 0) {
final ResourceTransformationDescriptionBuilder connectorBuilder = subsystemRoot.addChildResource(CONNECTOR_PATH);
connectorBuilder.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, WebConnectorDefinition.PROXY_BINDING, WebConnectorDefinition.REDIRECT_BINDING).setDiscard(DiscardAttributeChecker.UNDEFINED, WebSSLDefinition.SSL_PROTOCOL, WebConnectorDefinition.PROXY_BINDING, WebConnectorDefinition.REDIRECT_BINDING).end();
connectorBuilder.addChildResource(SSL_PATH).getAttributeBuilder().addRejectCheck(RejectAttributeChecker.UNDEFINED, WebSSLDefinition.CIPHER_SUITE).end();
}
TransformationDescription.Tools.register(subsystemRoot.build(), registration, ModelVersion.create(2, minor, 0));
}
Aggregations