.setDiscard(UNDEFINED, HornetQServerResourceDefinition.ATTRIBUTES_ADDED_IN_1_2_0)
.end()
.addOperationTransformationOverride(ADD)
.inheritResourceAttributeDefinitions()
// add default value for id-cache-size & clustered
.setCustomOperationTransformer(new OperationTransformer() {
@Override
public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) throws OperationFailedException {
operation.get(ID_CACHE_SIZE.getName()).set(ID_CACHE_SIZE.getDefaultValue());
operation.get(CLUSTERED.getName()).set(CLUSTERED.getDefaultValue());
return new TransformedOperation(operation, ORIGINAL_RESULT);
}
})
.end();
for (String path : MessagingPathHandlers.PATHS.keySet()) {
hornetqServer.addChildResource(PathElement.pathElement(PATH, path))
.getAttributeBuilder()
.addRejectCheck(SIMPLE_EXPRESSIONS, PATH)
.end();
}
for (String path : new String[]{CommonAttributes.IN_VM_ACCEPTOR, CommonAttributes.IN_VM_CONNECTOR}) {
final ResourceTransformationDescriptionBuilder transport = hornetqServer.addChildResource(PathElement.pathElement(path))
.getAttributeBuilder()
.addRejectCheck(SIMPLE_EXPRESSIONS, InVMTransportDefinition.ATTRIBUTES_WITH_EXPRESSION_ALLOWED_IN_1_2_0)
.end()
.addOperationTransformationOverride(ADD)
.inheritResourceAttributeDefinitions()
.addRejectCheck(SIMPLE_EXPRESSIONS, CommonAttributes.PARAM) // additional attribute to the ADD operation
.end();
transport.addChildResource(TransportParamDefinition.PATH)
.getAttributeBuilder()
.addRejectCheck(SIMPLE_EXPRESSIONS, TransportParamDefinition.ATTRIBUTES_WITH_EXPRESSION_ALLOWED_IN_1_2_0)
.end();
}
for (String path : new String[]{CommonAttributes.REMOTE_ACCEPTOR, CommonAttributes.REMOTE_CONNECTOR, CommonAttributes.ACCEPTOR, CommonAttributes.CONNECTOR}) {
final ResourceTransformationDescriptionBuilder transport = hornetqServer.addChildResource(PathElement.pathElement(path))
.addOperationTransformationOverride(ADD)
.inheritResourceAttributeDefinitions()
.addRejectCheck(SIMPLE_EXPRESSIONS, CommonAttributes.PARAM) // additional attribute to the ADD operation
.end();
transport.addChildResource(TransportParamDefinition.PATH)
.getAttributeBuilder()
.addRejectCheck(SIMPLE_EXPRESSIONS, TransportParamDefinition.ATTRIBUTES_WITH_EXPRESSION_ALLOWED_IN_1_2_0)
.end();
}
hornetqServer.addChildResource(BroadcastGroupDefinition.PATH)
.getAttributeBuilder()
.setDiscard(UNDEFINED, BroadcastGroupDefinition.ATTRIBUTES_ADDED_IN_1_2_0)
.addRejectCheck(DEFINED, BroadcastGroupDefinition.ATTRIBUTES_ADDED_IN_1_2_0)
.addRejectCheck(SIMPLE_EXPRESSIONS, BroadcastGroupDefinition.ATTRIBUTES_WITH_EXPRESSION_ALLOWED_IN_1_2_0)
.end();
hornetqServer.addChildResource(DiscoveryGroupDefinition.PATH)
.getAttributeBuilder()
.setDiscard(UNDEFINED, DiscoveryGroupDefinition.ATTRIBUTES_ADDED_IN_1_2_0)
.addRejectCheck(DEFINED, DiscoveryGroupDefinition.ATTRIBUTES_ADDED_IN_1_2_0)
.addRejectCheck(SIMPLE_EXPRESSIONS, DiscoveryGroupDefinition.ATTRIBUTES_WITH_EXPRESSION_ALLOWED_IN_1_2_0)
.end();
hornetqServer.addChildResource(DivertDefinition.PATH)
.getAttributeBuilder()
.addRejectCheck(SIMPLE_EXPRESSIONS, DivertDefinition.ATTRIBUTES_WITH_EXPRESSION_ALLOWED_IN_1_2_0)
.end();
hornetqServer.addChildResource(QueueDefinition.PATH)
.getAttributeBuilder()
.addRejectCheck(SIMPLE_EXPRESSIONS, QueueDefinition.ATTRIBUTES_WITH_EXPRESSION_ALLOWED_IN_1_2_0)
.end();
hornetqServer.addChildResource(BridgeDefinition.PATH)
.getAttributeBuilder()
.addRejectCheck(SIMPLE_EXPRESSIONS, BridgeDefinition.ATTRIBUTES_WITH_EXPRESSION_ALLOWED_IN_1_2_0)
.end();
hornetqServer.addChildResource(ClusterConnectionDefinition.PATH)
.getAttributeBuilder()
.setDiscard(UNDEFINED, ClusterConnectionDefinition.ATTRIBUTES_ADDED_IN_1_2_0)
.addRejectCheck(DEFINED, ClusterConnectionDefinition.ATTRIBUTES_ADDED_IN_1_2_0)
.addRejectCheck(SIMPLE_EXPRESSIONS, ClusterConnectionDefinition.ATTRIBUTES_WITH_EXPRESSION_ALLOWED_IN_1_2_0)
.end();
hornetqServer.addChildResource(GroupingHandlerDefinition.PATH)
.getAttributeBuilder()
.addRejectCheck(SIMPLE_EXPRESSIONS, GroupingHandlerDefinition.ATTRIBUTES_WITH_EXPRESSION_ALLOWED_IN_1_2_0)
.end();
hornetqServer.addChildResource(AddressSettingDefinition.PATH)
.getAttributeBuilder()
.addRejectCheck(SIMPLE_EXPRESSIONS, AddressSettingDefinition.ATTRIBUTES_WITH_EXPRESSION_ALLOWED_IN_1_2_0)
.end();
ResourceTransformationDescriptionBuilder connectorService = hornetqServer.addChildResource(ConnectorServiceDefinition.PATH);
connectorService.addChildResource(ConnectorServiceParamDefinition.PATH)
.getAttributeBuilder()
.addRejectCheck(SIMPLE_EXPRESSIONS, ConnectorServiceParamDefinition.ATTRIBUTES_WITH_EXPRESSION_ALLOWED_IN_1_2_0)
.end();
hornetqServer.addChildResource(ConnectionFactoryDefinition.PATH)
.getAttributeBuilder()
.setDiscard(UNDEFINED, ConnectionFactoryDefinition.ATTRIBUTES_ADDED_IN_1_2_0)
.addRejectCheck(DEFINED, ConnectionFactoryDefinition.ATTRIBUTES_ADDED_IN_1_2_0)
.addRejectCheck(SIMPLE_EXPRESSIONS, ConnectionFactoryDefinition.ATTRIBUTES_WITH_EXPRESSION_ALLOWED_IN_1_2_0)
.end();
hornetqServer.addChildResource(PooledConnectionFactoryDefinition.PATH)
.getAttributeBuilder()
.setDiscard(UNDEFINED, PooledConnectionFactoryDefinition.ATTRIBUTES_ADDED_IN_1_2_0)
.addRejectCheck(DEFINED, PooledConnectionFactoryDefinition.ATTRIBUTES_ADDED_IN_1_2_0)
.addRejectCheck(SIMPLE_EXPRESSIONS, PooledConnectionFactoryDefinition.ATTRIBUTES_WITH_EXPRESSION_ALLOWED_IN_1_2_0)
.end()
.addOperationTransformationOverride(ADD)
.inheritResourceAttributeDefinitions()
// add default value for reconnect-attempts
.setCustomOperationTransformer(new OperationTransformer() {
@Override
public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) throws OperationFailedException {
operation.get(Pooled.RECONNECT_ATTEMPTS.getName()).set(Pooled.RECONNECT_ATTEMPTS.getDefaultValue());
return new TransformedOperation(operation, ORIGINAL_RESULT);
}