use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class DatabaseDataStoreResourceDefinition method registerTransformers1_3_0.
static void registerTransformers1_3_0(ResourceTransformationDescriptionBuilder parent) {
ResourceTransformationDescriptionBuilder db = parent.addChildResource(EJB3SubsystemModel.DATABASE_DATA_STORE_PATH);
db.getAttributeBuilder().setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(-1)), REFRESH_INTERVAL).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(true)), ALLOW_EXECUTION).addRejectCheck(RejectAttributeChecker.DEFINED, REFRESH_INTERVAL, ALLOW_EXECUTION);
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class FileStoreResourceDefinition method buildTransformation.
static void buildTransformation(ModelVersion version, ResourceTransformationDescriptionBuilder parent) {
ResourceTransformationDescriptionBuilder builder = InfinispanModel.VERSION_4_0_0.requiresTransformation(version) ? parent.addChildRedirection(PATH, LEGACY_PATH) : parent.addChildResource(PATH);
if (InfinispanModel.VERSION_3_0_0.requiresTransformation(version)) {
builder.addOperationTransformationOverride(ModelDescriptionConstants.ADD).setCustomOperationTransformer(new SimpleOperationTransformer(new LegacyPropertyAddOperationTransformer())).inheritResourceAttributeDefinitions();
builder.setCustomResourceTransformer(new LegacyPropertyResourceTransformer());
}
StoreResourceDefinition.buildTransformation(version, builder);
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class BinaryTableResourceDefinition method buildTransformation.
@SuppressWarnings("deprecation")
static void buildTransformation(ModelVersion version, ResourceTransformationDescriptionBuilder parent) {
ResourceTransformationDescriptionBuilder builder = parent.addChildResource(PATH);
if (InfinispanModel.VERSION_4_0_0.requiresTransformation(version)) {
OperationTransformer addTransformer = new OperationTransformer() {
@Override
public ModelNode transformOperation(ModelNode operation) {
PathAddress storeAddress = Operations.getPathAddress(operation).getParent();
ModelNode value = new ModelNode();
for (Class<? extends org.jboss.as.clustering.controller.Attribute> attributeClass : Arrays.asList(Attribute.class, TableResourceDefinition.Attribute.class, TableResourceDefinition.ColumnAttribute.class)) {
for (org.jboss.as.clustering.controller.Attribute attribute : attributeClass.getEnumConstants()) {
String name = attribute.getName();
if (operation.hasDefined(name)) {
value.get(name).set(operation.get(name));
}
}
}
return value.isDefined() ? Operations.createWriteAttributeOperation(storeAddress, BinaryKeyedJDBCStoreResourceDefinition.DeprecatedAttribute.TABLE, value) : Operations.createUndefineAttributeOperation(storeAddress, BinaryKeyedJDBCStoreResourceDefinition.DeprecatedAttribute.TABLE);
}
};
builder.addRawOperationTransformationOverride(ModelDescriptionConstants.ADD, new SimpleOperationTransformer(addTransformer));
OperationTransformer removeTransformer = new OperationTransformer() {
@Override
public ModelNode transformOperation(ModelNode operation) {
PathAddress storeAddress = Operations.getPathAddress(operation).getParent();
return Operations.createUndefineAttributeOperation(storeAddress, BinaryKeyedJDBCStoreResourceDefinition.DeprecatedAttribute.TABLE);
}
};
builder.addRawOperationTransformationOverride(ModelDescriptionConstants.REMOVE, new SimpleOperationTransformer(removeTransformer));
}
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class InvalidationCacheResourceDefinition method buildTransformation.
static void buildTransformation(ModelVersion version, ResourceTransformationDescriptionBuilder parent) {
ResourceTransformationDescriptionBuilder builder = parent.addChildResource(WILDCARD_PATH);
ClusteredCacheResourceDefinition.buildTransformation(version, builder);
}
use of org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder in project wildfly by wildfly.
the class SharedStateCacheResourceDefinition method buildTransformation.
static void buildTransformation(ModelVersion version, ResourceTransformationDescriptionBuilder builder) {
StateTransferResourceDefinition.buildTransformation(version, builder);
if (InfinispanModel.VERSION_4_0_0.requiresTransformation(version)) {
builder.addChildResource(PartitionHandlingResourceDefinition.PATH, RequiredChildResourceDiscardPolicy.REJECT_AND_WARN);
} else {
PartitionHandlingResourceDefinition.buildTransformation(version, builder);
}
if (InfinispanModel.VERSION_2_0_0.requiresTransformation(version)) {
final ResourceTransformationDescriptionBuilder backupsBuilder = builder.addChildResource(BackupsResourceDefinition.PATH, RequiredChildResourceDiscardPolicy.REJECT_AND_WARN);
backupsBuilder.rejectChildResource(BackupResourceDefinition.WILDCARD_PATH);
builder.addChildResource(BackupForResourceDefinition.PATH, RequiredChildResourceDiscardPolicy.REJECT_AND_WARN);
} else {
BackupsResourceDefinition.buildTransformation(version, builder);
BackupForResourceDefinition.buildTransformation(version, builder);
}
ClusteredCacheResourceDefinition.buildTransformation(version, builder);
}
Aggregations