use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class IIOPExtension method registerTransformers.
protected static void registerTransformers(final SubsystemRegistration subsystem) {
ChainedTransformationDescriptionBuilder chained = ResourceTransformationDescriptionBuilder.Factory.createChainedSubystemInstance(CURRENT_MODEL_VERSION);
ResourceTransformationDescriptionBuilder builder = chained.createBuilder(CURRENT_MODEL_VERSION, VERSION_1);
builder.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, IIOPRootDefinition.SERVER_SSL_CONTEXT).addRejectCheck(RejectAttributeChecker.DEFINED, IIOPRootDefinition.CLIENT_SSL_CONTEXT).addRejectCheck(RejectAttributeChecker.DEFINED, IIOPRootDefinition.AUTHENTICATION_CONTEXT).addRejectCheck(new RejectAttributeChecker.DefaultRejectAttributeChecker() {
@Override
protected boolean rejectAttribute(PathAddress pathAddress, String s, ModelNode attributeValue, TransformationContext transformationContext) {
return attributeValue.asString().equals("true");
}
@Override
public String getRejectionLogMessage(Map<String, ModelNode> map) {
return IIOPLogger.ROOT_LOGGER.serverRequiresSslNotSupportedInPreviousVersions();
}
}, IIOPRootDefinition.SERVER_REQUIRES_SSL).addRejectCheck(new RejectAttributeChecker.DefaultRejectAttributeChecker() {
@Override
protected boolean rejectAttribute(PathAddress pathAddress, String s, ModelNode attributeValue, TransformationContext transformationContext) {
return attributeValue.asString().equalsIgnoreCase(Constants.ELYTRON);
}
@Override
public String getRejectionLogMessage(Map<String, ModelNode> map) {
return IIOPLogger.ROOT_LOGGER.elytronInitializerNotSupportedInPreviousVersions();
}
}, IIOPRootDefinition.SECURITY).setValueConverter(new AttributeConverter() {
@Override
public void convertOperationParameter(PathAddress pathAddress, String s, ModelNode attributeValue, ModelNode operation, TransformationContext transformationContext) {
convert(attributeValue);
}
@Override
public void convertResourceAttribute(PathAddress pathAddress, String s, ModelNode attributeValue, TransformationContext transformationContext) {
convert(attributeValue);
}
private void convert(ModelNode attributeValue) {
final boolean clientRequiresSsl = attributeValue.asBoolean();
if (clientRequiresSsl) {
attributeValue.set(SSLConfigValue.MUTUALAUTH.toString());
} else {
attributeValue.set(SSLConfigValue.NONE.toString());
}
}
}, IIOPRootDefinition.CLIENT_REQUIRES_SSL);
chained.buildAndRegister(subsystem, new ModelVersion[] { VERSION_1 });
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class ResourceAdapterResourceDefinition method registerTransformers300.
static void registerTransformers300(ResourceTransformationDescriptionBuilder parentBuilder) {
ResourceTransformationDescriptionBuilder builder = parentBuilder.addChildResource(PathElement.pathElement(RESOURCEADAPTER_NAME)).getAttributeBuilder().setDiscard(DiscardAttributeChecker.UNDEFINED, WM_ELYTRON_SECURITY_DOMAIN).addRejectCheck(RejectAttributeChecker.DEFINED, WM_ELYTRON_SECURITY_DOMAIN).end();
ConnectionDefinitionResourceDefinition.registerTransformer300(builder);
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class ResourceAdapterResourceDefinition method registerTransformers130.
static void registerTransformers130(ResourceTransformationDescriptionBuilder parentBuilder) {
ResourceTransformationDescriptionBuilder builder = parentBuilder.addChildResource(PathElement.pathElement(RESOURCEADAPTER_NAME)).getAttributeBuilder().setDiscard(DiscardAttributeChecker.UNDEFINED, WM_SECURITY_MAPPING_USER, WM_SECURITY_MAPPING_GROUP, WM_SECURITY_MAPPING_GROUPS, WM_SECURITY_MAPPING_USERS, WM_SECURITY_DEFAULT_GROUP, WM_SECURITY_DEFAULT_GROUPS, WM_SECURITY_DEFAULT_PRINCIPAL).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, true, new ModelNode(false)), WM_SECURITY, WM_SECURITY_MAPPING_REQUIRED, STATISTICS_ENABLED).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, true, new ModelNode("other")), WM_SECURITY_DOMAIN).setDiscard(DiscardAttributeChecker.UNDEFINED, WM_ELYTRON_SECURITY_DOMAIN).addRejectCheck(RejectAttributeChecker.DEFINED, Constants.MODULE, WM_SECURITY, WM_SECURITY_MAPPING_USER, WM_SECURITY_MAPPING_GROUP, WM_SECURITY_MAPPING_GROUPS, WM_SECURITY_MAPPING_USERS, WM_SECURITY_DEFAULT_GROUP, WM_SECURITY_DEFAULT_GROUPS, WM_SECURITY_DEFAULT_PRINCIPAL, WM_SECURITY_MAPPING_REQUIRED, WM_SECURITY_DOMAIN, WM_ELYTRON_SECURITY_DOMAIN, STATISTICS_ENABLED).end();
ConnectionDefinitionResourceDefinition.registerTransformer130(builder);
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class ResourceAdaptersRootResourceDefinition method registerTransformers.
static void registerTransformers(SubsystemRegistration subsystem) {
ResourceTransformationDescriptionBuilder builder130 = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
ResourceAdapterResourceDefinition.registerTransformers130(builder130);
TransformationDescription.Tools.register(builder130.build(), subsystem, ModelVersion.create(1, 3, 0));
ResourceTransformationDescriptionBuilder builder200 = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
ResourceAdapterResourceDefinition.registerTransformers200(builder200);
TransformationDescription.Tools.register(builder200.build(), subsystem, ModelVersion.create(2, 0, 0));
ResourceTransformationDescriptionBuilder builder300 = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
ResourceAdapterResourceDefinition.registerTransformers300(builder300);
TransformationDescription.Tools.register(builder300.build(), subsystem, ModelVersion.create(3, 0, 0));
ResourceTransformationDescriptionBuilder builder400 = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
ResourceAdapterResourceDefinition.registerTransformers400(builder400);
TransformationDescription.Tools.register(builder400.build(), subsystem, ModelVersion.create(4, 0, 0));
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class PassivationStoreResourceDefinition method registerTransformers_1_2_1_and_1_3_0.
/*
* This transformer does the following:
* - maps <passivation-store/> to <cluster-passivation-store/>
* - sets appropriate defaults for IDLE_TIMEOUT, IDLE_TIMEOUT_UNIT, PASSIVATE_EVENTS_ON_REPLICATE, and CLIENT_MAPPINGS_CACHE
*/
@SuppressWarnings("deprecation")
static void registerTransformers_1_2_1_and_1_3_0(ResourceTransformationDescriptionBuilder parent) {
ResourceTransformationDescriptionBuilder child = parent.addChildRedirection(INSTANCE.getPathElement(), PathElement.pathElement(EJB3SubsystemModel.CLUSTER_PASSIVATION_STORE));
child.getAttributeBuilder().setValueConverter(AttributeConverter.Factory.createHardCoded(new ModelNode(true), true), EJB3SubsystemModel.PASSIVATE_EVENTS_ON_REPLICATE).setValueConverter(AttributeConverter.Factory.createHardCoded(new ModelNode("default"), true), EJB3SubsystemModel.CLIENT_MAPPINGS_CACHE).setValueConverter(AttributeConverter.Factory.createHardCoded(new ModelNode().set(Long.valueOf(Integer.MAX_VALUE)), true), EJB3SubsystemModel.IDLE_TIMEOUT).setValueConverter(AttributeConverter.Factory.createHardCoded(new ModelNode().set(TimeUnit.SECONDS.name()), true), EJB3SubsystemModel.IDLE_TIMEOUT_UNIT);
}
Aggregations