use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class JcaSubsystemRootDefinition method registerTransformers.
static void registerTransformers(SubsystemRegistration subsystem) {
ResourceTransformationDescriptionBuilder builder12 = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
builder12.rejectChildResource(JcaDistributedWorkManagerDefinition.PATH_DISTRIBUTED_WORK_MANAGER);
builder12.discardChildResource(TracerDefinition.PATH_TRACER);
JcaWorkManagerDefinition.registerElytronTransformers(builder12);
TransformationDescription.Tools.register(builder12.build(), subsystem, ModelVersion.create(1, 2, 0));
ResourceTransformationDescriptionBuilder builder20 = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
builder20.discardChildResource(TracerDefinition.PATH_TRACER);
JcaDistributedWorkManagerDefinition.registerElytronTransformers(builder20);
JcaWorkManagerDefinition.registerElytronTransformers(builder20);
TransformationDescription.Tools.register(builder20.build(), subsystem, ModelVersion.create(2, 0, 0));
ResourceTransformationDescriptionBuilder builder30 = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
JcaDistributedWorkManagerDefinition.registerTransformers300(builder30);
JcaWorkManagerDefinition.registerElytronTransformers(builder30);
TransformationDescription.Tools.register(builder30.build(), subsystem, ModelVersion.create(3, 0, 0));
ResourceTransformationDescriptionBuilder builder40 = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
JcaDistributedWorkManagerDefinition.registerElytronTransformers(builder40);
JcaWorkManagerDefinition.registerElytronTransformers(builder40);
TransformationDescription.Tools.register(builder40.build(), subsystem, ModelVersion.create(4, 0, 0));
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class XaDataSourceDefinition method registerTransformers200.
static void registerTransformers200(ResourceTransformationDescriptionBuilder parentBuilder) {
ResourceTransformationDescriptionBuilder builder = parentBuilder.addChildResource(PATH_XA_DATASOURCE);
builder.getAttributeBuilder().setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(false)), CONNECTABLE).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, false, new ModelNode(true)), STATISTICS_ENABLED).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(true)), ENLISTMENT_TRACE).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(LEGACY_MCP)), MCP).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, true, new ModelNode(false)), Constants.ELYTRON_ENABLED, Constants.RECOVERY_ELYTRON_ENABLED).setDiscard(DiscardAttributeChecker.UNDEFINED, Constants.AUTHENTICATION_CONTEXT, RECOVERY_AUTHENTICATION_CONTEXT, CREDENTIAL_REFERENCE, RECOVERY_CREDENTIAL_REFERENCE).addRejectCheck(RejectAttributeChecker.DEFINED, ENLISTMENT_TRACE).addRejectCheck(RejectAttributeChecker.DEFINED, MCP).addRejectCheck(new RejectAttributeChecker.DefaultRejectAttributeChecker() {
@Override
public String getRejectionLogMessage(Map<String, ModelNode> attributes) {
return ConnectorLogger.ROOT_LOGGER.rejectAttributesMustBeTrue(attributes.keySet());
}
@Override
protected boolean rejectAttribute(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) {
//This will not get called if it was discarded, so reject if it is undefined (default==false) or if defined and != 'true'
return !attributeValue.isDefined() || !attributeValue.asString().equals("true");
}
}, STATISTICS_ENABLED).setDiscard(DiscardAttributeChecker.UNDEFINED, TRACKING).addRejectCheck(RejectAttributeChecker.DEFINED, TRACKING).addRejectCheck(RejectAttributeChecker.SIMPLE_EXPRESSIONS, ENABLED).addRejectCheck(RejectAttributeChecker.DEFINED, Constants.ELYTRON_ENABLED, Constants.RECOVERY_ELYTRON_ENABLED, AUTHENTICATION_CONTEXT, RECOVERY_AUTHENTICATION_CONTEXT, CREDENTIAL_REFERENCE, RECOVERY_CREDENTIAL_REFERENCE).end().addOperationTransformationOverride(DATASOURCE_ENABLE.getName()).end().addOperationTransformationOverride(DATASOURCE_DISABLE.getName()).end();
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class DataSourceDefinition method registerTransformers130.
static void registerTransformers130(ResourceTransformationDescriptionBuilder parentBuilder) {
ResourceTransformationDescriptionBuilder builder = parentBuilder.addChildResource(PATH_DATASOURCE);
builder.getAttributeBuilder().setDiscard(new DiscardAttributeChecker.DefaultDiscardAttributeChecker() {
@Override
protected boolean isValueDiscardable(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) {
return attributeValue.equals(new ModelNode(false));
}
}, TRACKING).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, true, new ModelNode(false)), ELYTRON_ENABLED, RECOVERY_ELYTRON_ENABLED).setDiscard(DiscardAttributeChecker.UNDEFINED, AUTHENTICATION_CONTEXT, RECOVERY_AUTHENTICATION_CONTEXT, CREDENTIAL_REFERENCE).addRejectCheck(RejectAttributeChecker.SIMPLE_EXPRESSIONS, ENABLED).addRejectCheck(RejectAttributeChecker.DEFINED, TRACKING).addRejectCheck(RejectAttributeChecker.DEFINED, ELYTRON_ENABLED, RECOVERY_ELYTRON_ENABLED, AUTHENTICATION_CONTEXT, RECOVERY_AUTHENTICATION_CONTEXT, CREDENTIAL_REFERENCE).addRejectCheck(createConnURLRejectChecker(), CONNECTION_URL).end();
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class DataSourceDefinition method registerTransformers200.
static void registerTransformers200(ResourceTransformationDescriptionBuilder parentBuilder) {
ResourceTransformationDescriptionBuilder builder = parentBuilder.addChildResource(PATH_DATASOURCE);
builder.getAttributeBuilder().setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(true)), org.jboss.as.connector.subsystems.common.pool.Constants.POOL_FAIR).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(false)), CONNECTABLE).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, false, new ModelNode(true)), STATISTICS_ENABLED).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(true)), ENLISTMENT_TRACE).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(LEGACY_MCP)), MCP).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, true, new ModelNode(false)), ELYTRON_ENABLED, RECOVERY_ELYTRON_ENABLED).setDiscard(DiscardAttributeChecker.UNDEFINED, AUTHENTICATION_CONTEXT, RECOVERY_AUTHENTICATION_CONTEXT, CREDENTIAL_REFERENCE).addRejectCheck(RejectAttributeChecker.DEFINED, org.jboss.as.connector.subsystems.common.pool.Constants.POOL_FAIR).addRejectCheck(RejectAttributeChecker.DEFINED, ENLISTMENT_TRACE).addRejectCheck(RejectAttributeChecker.DEFINED, MCP).addRejectCheck(new RejectAttributeChecker.DefaultRejectAttributeChecker() {
@Override
public String getRejectionLogMessage(Map<String, ModelNode> attributes) {
return ConnectorLogger.ROOT_LOGGER.rejectAttributesMustBeTrue(attributes.keySet());
}
@Override
protected boolean rejectAttribute(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) {
//This will not get called if it was discarded, so reject if it is undefined (default==false) or if defined and != 'true'
return !attributeValue.isDefined() || !attributeValue.asString().equals("true");
}
}, STATISTICS_ENABLED).setDiscard(new DiscardAttributeChecker.DefaultDiscardAttributeChecker() {
@Override
protected boolean isValueDiscardable(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) {
return attributeValue.equals(new ModelNode(false));
}
}, TRACKING).addRejectCheck(RejectAttributeChecker.DEFINED, TRACKING).addRejectCheck(RejectAttributeChecker.DEFINED, ELYTRON_ENABLED, RECOVERY_ELYTRON_ENABLED, AUTHENTICATION_CONTEXT, RECOVERY_AUTHENTICATION_CONTEXT, CREDENTIAL_REFERENCE).addRejectCheck(createConnURLRejectChecker(), CONNECTION_URL).addRejectCheck(RejectAttributeChecker.SIMPLE_EXPRESSIONS, ENABLED).end().addOperationTransformationOverride(DATASOURCE_ENABLE.getName()).end().addOperationTransformationOverride(DATASOURCE_DISABLE.getName()).end();
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class DataSourceDefinition method registerTransformers120.
static void registerTransformers120(ResourceTransformationDescriptionBuilder parentBuilder) {
ResourceTransformationDescriptionBuilder builder = parentBuilder.addChildResource(PATH_DATASOURCE);
builder.getAttributeBuilder().setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(true)), org.jboss.as.connector.subsystems.common.pool.Constants.POOL_FAIR).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(false)), CONNECTABLE).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, false, new ModelNode(true)), STATISTICS_ENABLED).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(true)), ENLISTMENT_TRACE).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(LEGACY_MCP)), MCP).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, true, new ModelNode(false)), ELYTRON_ENABLED, RECOVERY_ELYTRON_ENABLED).setDiscard(DiscardAttributeChecker.UNDEFINED, AUTHENTICATION_CONTEXT, RECOVERY_AUTHENTICATION_CONTEXT, CREDENTIAL_REFERENCE).addRejectCheck(RejectAttributeChecker.DEFINED, org.jboss.as.connector.subsystems.common.pool.Constants.POOL_FAIR).addRejectCheck(RejectAttributeChecker.DEFINED, ENLISTMENT_TRACE).addRejectCheck(RejectAttributeChecker.DEFINED, MCP).addRejectCheck(new RejectAttributeChecker.DefaultRejectAttributeChecker() {
@Override
public String getRejectionLogMessage(Map<String, ModelNode> attributes) {
return ConnectorLogger.ROOT_LOGGER.rejectAttributesMustBeTrue(attributes.keySet());
}
@Override
protected boolean rejectAttribute(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) {
//This will not get called if it was discarded, so reject if it is undefined (default==false) or if defined and != 'true'
return !attributeValue.isDefined() || !attributeValue.asString().equals("true");
}
}, STATISTICS_ENABLED).setDiscard(new DiscardAttributeChecker.DefaultDiscardAttributeChecker() {
@Override
protected boolean isValueDiscardable(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) {
return attributeValue.equals(new ModelNode(false));
}
}, TRACKING).addRejectCheck(RejectAttributeChecker.DEFINED, TRACKING).addRejectCheck(RejectAttributeChecker.DEFINED, ELYTRON_ENABLED, RECOVERY_ELYTRON_ENABLED, AUTHENTICATION_CONTEXT, RECOVERY_AUTHENTICATION_CONTEXT, CREDENTIAL_REFERENCE).addRejectCheck(createConnURLRejectChecker(), CONNECTION_URL).addRejectCheck(RejectAttributeChecker.SIMPLE_EXPRESSIONS, ENABLED).end().addOperationTransformationOverride(DATASOURCE_ENABLE.getName()).end().addOperationTransformationOverride(DATASOURCE_DISABLE.getName()).end();
}
Aggregations