diff --git a/messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/MessagingExtension.java b/messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/MessagingExtension.java index e2e7c54338d2..6c37df7eb789 100644 --- a/messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/MessagingExtension.java +++ b/messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/MessagingExtension.java @@ -149,12 +149,11 @@ public class MessagingExtension implements Extension { static final String RESOURCE_NAME = MessagingExtension.class.getPackage().getName() + ".LocalDescriptions"; - protected static final ModelVersion VERSION_3_1_0 = ModelVersion.create(3, 1, 0); protected static final ModelVersion VERSION_3_0_0 = ModelVersion.create(3, 0, 0); protected static final ModelVersion VERSION_2_0_0 = ModelVersion.create(2, 0, 0); protected static final ModelVersion VERSION_1_0_0 = ModelVersion.create(1, 0, 0); - private static final ModelVersion CURRENT_MODEL_VERSION = VERSION_3_1_0; - private static final MessagingSubsystemParser_3_1 CURRENT_PARSER = new MessagingSubsystemParser_3_1(); + private static final ModelVersion CURRENT_MODEL_VERSION = VERSION_3_0_0; + private static final MessagingSubsystemParser_3_0 CURRENT_PARSER = new MessagingSubsystemParser_3_0(); public static ResourceDescriptionResolver getResourceDescriptionResolver(final String... keyPrefix) { return getResourceDescriptionResolver(true, keyPrefix); @@ -212,7 +211,6 @@ public void initialize(ExtensionContext context) { public void initializeParsers(ExtensionParsingContext context) { context.setSubsystemXmlMapping(SUBSYSTEM_NAME, MessagingSubsystemParser_1_0.NAMESPACE, MessagingSubsystemParser_1_0::new); context.setSubsystemXmlMapping(SUBSYSTEM_NAME, MessagingSubsystemParser_2_0.NAMESPACE, MessagingSubsystemParser_2_0::new); - context.setSubsystemXmlMapping(SUBSYSTEM_NAME, MessagingSubsystemParser_3_0.NAMESPACE, MessagingSubsystemParser_3_0::new); - context.setSubsystemXmlMapping(SUBSYSTEM_NAME, MessagingSubsystemParser_3_1.NAMESPACE, CURRENT_PARSER); + context.setSubsystemXmlMapping(SUBSYSTEM_NAME, MessagingSubsystemParser_3_0.NAMESPACE, CURRENT_PARSER); } } diff --git a/messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/MessagingSubsystemParser_3_1.java b/messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/MessagingSubsystemParser_3_1.java deleted file mode 100644 index 622bf1a0e4cf..000000000000 --- a/messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/MessagingSubsystemParser_3_1.java +++ /dev/null @@ -1,619 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2015, Red Hat, Inc., and individual contributors - * as indicated by the @author tags. See the copyright.txt file in the - * distribution for a full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -package org.wildfly.extension.messaging.activemq; - -import static org.jboss.as.controller.PathElement.pathElement; -import static org.jboss.as.controller.PersistentResourceXMLDescription.builder; -import static org.wildfly.extension.messaging.activemq.CommonAttributes.ACCEPTOR; -import static org.wildfly.extension.messaging.activemq.CommonAttributes.CONNECTOR; -import static org.wildfly.extension.messaging.activemq.CommonAttributes.IN_VM_ACCEPTOR; -import static org.wildfly.extension.messaging.activemq.CommonAttributes.IN_VM_CONNECTOR; -import static org.wildfly.extension.messaging.activemq.CommonAttributes.REMOTE_ACCEPTOR; -import static org.wildfly.extension.messaging.activemq.CommonAttributes.REMOTE_CONNECTOR; - -import org.jboss.as.controller.PersistentResourceXMLDescription; -import org.jboss.as.controller.PersistentResourceXMLParser; -import org.wildfly.extension.messaging.activemq.ha.HAAttributes; -import org.wildfly.extension.messaging.activemq.ha.LiveOnlyDefinition; -import org.wildfly.extension.messaging.activemq.ha.ReplicationColocatedDefinition; -import org.wildfly.extension.messaging.activemq.ha.ReplicationMasterDefinition; -import org.wildfly.extension.messaging.activemq.ha.ReplicationSlaveDefinition; -import org.wildfly.extension.messaging.activemq.ha.ScaleDownAttributes; -import org.wildfly.extension.messaging.activemq.ha.SharedStoreColocatedDefinition; -import org.wildfly.extension.messaging.activemq.ha.SharedStoreMasterDefinition; -import org.wildfly.extension.messaging.activemq.ha.SharedStoreSlaveDefinition; -import org.wildfly.extension.messaging.activemq.jms.ConnectionFactoryAttributes; -import org.wildfly.extension.messaging.activemq.jms.PooledConnectionFactoryDefinition; -import org.wildfly.extension.messaging.activemq.jms.bridge.JMSBridgeDefinition; -import org.wildfly.extension.messaging.activemq.jms.legacy.LegacyConnectionFactoryDefinition; - -/** - * Parser and Marshaller for messaging-activemq's {@link #NAMESPACE}. - * - * All resources and attributes must be listed explicitly and not through any collections. - * This ensures that if the resource definitions change in later version (e.g. a new attribute is added), - * this will have no impact on parsing this specific version of the subsystem. - * - * @author Paul Ferraro - */ -public class MessagingSubsystemParser_3_1 extends PersistentResourceXMLParser { - - static final String NAMESPACE = "urn:jboss:domain:messaging-activemq:3.1"; - - @Override - public PersistentResourceXMLDescription getParserDescription(){ - return builder(MessagingExtension.SUBSYSTEM_PATH, NAMESPACE) - .addAttributes( - MessagingSubsystemRootResourceDefinition.GLOBAL_CLIENT_THREAD_POOL_MAX_SIZE, - MessagingSubsystemRootResourceDefinition.GLOBAL_CLIENT_SCHEDULED_THREAD_POOL_MAX_SIZE) - .addChild( - builder(MessagingExtension.SERVER_PATH) - .addAttributes( - // no attribute groups - ServerDefinition.PERSISTENCE_ENABLED, - ServerDefinition.PERSIST_ID_CACHE, - ServerDefinition.PERSIST_DELIVERY_COUNT_BEFORE_DELIVERY, - ServerDefinition.ID_CACHE_SIZE, - ServerDefinition.PAGE_MAX_CONCURRENT_IO, - ServerDefinition.SCHEDULED_THREAD_POOL_MAX_SIZE, - ServerDefinition.THREAD_POOL_MAX_SIZE, - ServerDefinition.WILD_CARD_ROUTING_ENABLED, - ServerDefinition.CONNECTION_TTL_OVERRIDE, - ServerDefinition.ASYNC_CONNECTION_EXECUTION_ENABLED, - // security - ServerDefinition.SECURITY_ENABLED, - ServerDefinition.SECURITY_DOMAIN, - ServerDefinition.ELYTRON_DOMAIN, - ServerDefinition.SECURITY_INVALIDATION_INTERVAL, - ServerDefinition.OVERRIDE_IN_VM_SECURITY, - // cluster - ServerDefinition.CLUSTER_USER, - ServerDefinition.CLUSTER_PASSWORD, - ServerDefinition.CREDENTIAL_REFERENCE, - // management - ServerDefinition.MANAGEMENT_ADDRESS, - ServerDefinition.MANAGEMENT_NOTIFICATION_ADDRESS, - ServerDefinition.JMX_MANAGEMENT_ENABLED, - ServerDefinition.JMX_DOMAIN, - // journal - ServerDefinition.JOURNAL_TYPE, - ServerDefinition.JOURNAL_BUFFER_TIMEOUT, - ServerDefinition.JOURNAL_BUFFER_SIZE, - ServerDefinition.JOURNAL_SYNC_TRANSACTIONAL, - ServerDefinition.JOURNAL_SYNC_NON_TRANSACTIONAL, - ServerDefinition.LOG_JOURNAL_WRITE_RATE, - ServerDefinition.JOURNAL_FILE_SIZE, - ServerDefinition.JOURNAL_MIN_FILES, - ServerDefinition.JOURNAL_POOL_FILES, - ServerDefinition.JOURNAL_COMPACT_PERCENTAGE, - ServerDefinition.JOURNAL_COMPACT_MIN_FILES, - ServerDefinition.JOURNAL_MAX_IO, - ServerDefinition.CREATE_BINDINGS_DIR, - ServerDefinition.CREATE_JOURNAL_DIR, - ServerDefinition.JOURNAL_DATASOURCE, - ServerDefinition.JOURNAL_MESSAGES_TABLE, - ServerDefinition.JOURNAL_BINDINGS_TABLE, - ServerDefinition.JOURNAL_JMS_BINDINGS_TABLE, - ServerDefinition.JOURNAL_LARGE_MESSAGES_TABLE, - ServerDefinition.JOURNAL_PAGE_STORE_TABLE, - ServerDefinition.JOURNAL_DATABASE, - ServerDefinition.JOURNAL_JDBC_NETWORK_TIMEOUT, - // statistics - ServerDefinition.STATISTICS_ENABLED, - ServerDefinition.MESSAGE_COUNTER_SAMPLE_PERIOD, - ServerDefinition.MESSAGE_COUNTER_MAX_DAY_HISTORY, - // transaction - ServerDefinition.TRANSACTION_TIMEOUT, - ServerDefinition.TRANSACTION_TIMEOUT_SCAN_PERIOD, - // message expiry - ServerDefinition.MESSAGE_EXPIRY_SCAN_PERIOD, - ServerDefinition.MESSAGE_EXPIRY_THREAD_PRIORITY, - // debug - ServerDefinition.PERF_BLAST_PAGES, - ServerDefinition.RUN_SYNC_SPEED_TEST, - ServerDefinition.SERVER_DUMP_INTERVAL, - ServerDefinition.MEMORY_MEASURE_INTERVAL, - ServerDefinition.MEMORY_WARNING_THRESHOLD, - CommonAttributes.INCOMING_INTERCEPTORS, - CommonAttributes.OUTGOING_INTERCEPTORS) - .addChild( - builder(LiveOnlyDefinition.INSTANCE.getPathElement()) - .addAttributes( - ScaleDownAttributes.SCALE_DOWN, - ScaleDownAttributes.SCALE_DOWN_CLUSTER_NAME, - ScaleDownAttributes.SCALE_DOWN_GROUP_NAME, - ScaleDownAttributes.SCALE_DOWN_DISCOVERY_GROUP, - ScaleDownAttributes.SCALE_DOWN_CONNECTORS)) - .addChild( - builder(ReplicationMasterDefinition.INSTANCE.getPathElement()) - .addAttributes( - HAAttributes.CLUSTER_NAME, - HAAttributes.GROUP_NAME, - HAAttributes.CHECK_FOR_LIVE_SERVER, - HAAttributes.INITIAL_REPLICATION_SYNC_TIMEOUT)) - .addChild( - builder(ReplicationSlaveDefinition.INSTANCE.getPathElement()) - .addAttributes( - HAAttributes.CLUSTER_NAME, - HAAttributes.GROUP_NAME, - HAAttributes.ALLOW_FAILBACK, - HAAttributes.INITIAL_REPLICATION_SYNC_TIMEOUT, - HAAttributes.MAX_SAVED_REPLICATED_JOURNAL_SIZE, - HAAttributes.RESTART_BACKUP, - ScaleDownAttributes.SCALE_DOWN, - ScaleDownAttributes.SCALE_DOWN_CLUSTER_NAME, - ScaleDownAttributes.SCALE_DOWN_GROUP_NAME, - ScaleDownAttributes.SCALE_DOWN_DISCOVERY_GROUP, - ScaleDownAttributes.SCALE_DOWN_CONNECTORS)) - .addChild( - builder(ReplicationColocatedDefinition.INSTANCE.getPathElement()) - .addAttributes( - HAAttributes.REQUEST_BACKUP, - HAAttributes.BACKUP_REQUEST_RETRIES, - HAAttributes.BACKUP_REQUEST_RETRY_INTERVAL, - HAAttributes.MAX_BACKUPS, - HAAttributes.BACKUP_PORT_OFFSET, - HAAttributes.EXCLUDED_CONNECTORS) - .addChild( - builder(ReplicationMasterDefinition.CONFIGURATION_INSTANCE.getPathElement()) - .addAttributes( - HAAttributes.CLUSTER_NAME, - HAAttributes.GROUP_NAME, - HAAttributes.CHECK_FOR_LIVE_SERVER, - HAAttributes.INITIAL_REPLICATION_SYNC_TIMEOUT)) - .addChild( - builder(ReplicationSlaveDefinition.CONFIGURATION_INSTANCE.getPathElement()) - .addAttributes( - HAAttributes.CLUSTER_NAME, - HAAttributes.GROUP_NAME, - HAAttributes.ALLOW_FAILBACK, - HAAttributes.INITIAL_REPLICATION_SYNC_TIMEOUT, - HAAttributes.MAX_SAVED_REPLICATED_JOURNAL_SIZE, - HAAttributes.RESTART_BACKUP, - ScaleDownAttributes.SCALE_DOWN, - ScaleDownAttributes.SCALE_DOWN_CLUSTER_NAME, - ScaleDownAttributes.SCALE_DOWN_GROUP_NAME, - ScaleDownAttributes.SCALE_DOWN_DISCOVERY_GROUP, - ScaleDownAttributes.SCALE_DOWN_CONNECTORS))) - .addChild( - builder(SharedStoreMasterDefinition.INSTANCE.getPathElement()) - .addAttributes( - HAAttributes.FAILOVER_ON_SERVER_SHUTDOWN)) - .addChild( - builder(SharedStoreSlaveDefinition.INSTANCE.getPathElement()) - .addAttributes( - HAAttributes.ALLOW_FAILBACK, - HAAttributes.FAILOVER_ON_SERVER_SHUTDOWN, - HAAttributes.RESTART_BACKUP, - ScaleDownAttributes.SCALE_DOWN, - ScaleDownAttributes.SCALE_DOWN_CLUSTER_NAME, - ScaleDownAttributes.SCALE_DOWN_GROUP_NAME, - ScaleDownAttributes.SCALE_DOWN_DISCOVERY_GROUP, - ScaleDownAttributes.SCALE_DOWN_CONNECTORS)) - .addChild( - builder(SharedStoreColocatedDefinition.INSTANCE.getPathElement()) - .addAttributes( - HAAttributes.REQUEST_BACKUP, - HAAttributes.BACKUP_REQUEST_RETRIES, - HAAttributes.BACKUP_REQUEST_RETRY_INTERVAL, - HAAttributes.MAX_BACKUPS, - HAAttributes.BACKUP_PORT_OFFSET) - .addChild( - builder(SharedStoreMasterDefinition.CONFIGURATION_INSTANCE.getPathElement()) - .addAttributes( - HAAttributes.FAILOVER_ON_SERVER_SHUTDOWN)) - .addChild( - builder(SharedStoreSlaveDefinition.CONFIGURATION_INSTANCE.getPathElement()) - .addAttributes( - HAAttributes.ALLOW_FAILBACK, - HAAttributes.FAILOVER_ON_SERVER_SHUTDOWN, - HAAttributes.RESTART_BACKUP, - ScaleDownAttributes.SCALE_DOWN, - ScaleDownAttributes.SCALE_DOWN_CLUSTER_NAME, - ScaleDownAttributes.SCALE_DOWN_GROUP_NAME, - ScaleDownAttributes.SCALE_DOWN_DISCOVERY_GROUP, - ScaleDownAttributes.SCALE_DOWN_CONNECTORS))) - .addChild( - builder(PathDefinition.BINDINGS_INSTANCE.getPathElement()) - .addAttributes( - PathDefinition.PATHS.get(CommonAttributes.BINDINGS_DIRECTORY), - PathDefinition.RELATIVE_TO)) - .addChild( - builder(PathDefinition.JOURNAL_INSTANCE.getPathElement()) - .addAttributes( - PathDefinition.PATHS.get(CommonAttributes.JOURNAL_DIRECTORY), - PathDefinition.RELATIVE_TO)) - .addChild( - builder(PathDefinition.LARGE_MESSAGES_INSTANCE.getPathElement()) - .addAttributes( - PathDefinition.PATHS.get(CommonAttributes.LARGE_MESSAGES_DIRECTORY), - PathDefinition.RELATIVE_TO)) - .addChild( - builder(PathDefinition.PAGING_INSTANCE.getPathElement()) - .addAttributes( - PathDefinition.PATHS.get(CommonAttributes.PAGING_DIRECTORY), - PathDefinition.RELATIVE_TO)) - .addChild( - builder(MessagingExtension.QUEUE_PATH) - .addAttributes( - QueueDefinition.ADDRESS, - CommonAttributes.DURABLE, - CommonAttributes.FILTER)) - .addChild( - builder(SecuritySettingDefinition.INSTANCE.getPathElement()) - .addChild( - builder(SecurityRoleDefinition.INSTANCE.getPathElement()) - .addAttributes( - SecurityRoleDefinition.SEND, - SecurityRoleDefinition.CONSUME, - SecurityRoleDefinition.CREATE_DURABLE_QUEUE, - SecurityRoleDefinition.DELETE_DURABLE_QUEUE, - SecurityRoleDefinition.CREATE_NON_DURABLE_QUEUE, - SecurityRoleDefinition.DELETE_NON_DURABLE_QUEUE, - SecurityRoleDefinition.MANAGE))) - .addChild( - builder(AddressSettingDefinition.INSTANCE.getPathElement()) - .addAttributes( - CommonAttributes.DEAD_LETTER_ADDRESS, - CommonAttributes.EXPIRY_ADDRESS, - AddressSettingDefinition.EXPIRY_DELAY, - AddressSettingDefinition.REDELIVERY_DELAY, - AddressSettingDefinition.REDELIVERY_MULTIPLIER, - AddressSettingDefinition.MAX_DELIVERY_ATTEMPTS, - AddressSettingDefinition.MAX_REDELIVERY_DELAY, - AddressSettingDefinition.MAX_SIZE_BYTES, - AddressSettingDefinition.PAGE_SIZE_BYTES, - AddressSettingDefinition.PAGE_MAX_CACHE_SIZE, - AddressSettingDefinition.ADDRESS_FULL_MESSAGE_POLICY, - AddressSettingDefinition.MESSAGE_COUNTER_HISTORY_DAY_LIMIT, - AddressSettingDefinition.LAST_VALUE_QUEUE, - AddressSettingDefinition.REDISTRIBUTION_DELAY, - AddressSettingDefinition.SEND_TO_DLA_ON_NO_ROUTE, - AddressSettingDefinition.SLOW_CONSUMER_CHECK_PERIOD, - AddressSettingDefinition.SLOW_CONSUMER_POLICY, - AddressSettingDefinition.SLOW_CONSUMER_THRESHOLD, - AddressSettingDefinition.AUTO_CREATE_JMS_QUEUES, - AddressSettingDefinition.AUTO_DELETE_JMS_QUEUES)) - .addChild( - builder(MessagingExtension.HTTP_CONNECTOR_PATH) - .addAttributes( - HTTPConnectorDefinition.SOCKET_BINDING, - HTTPConnectorDefinition.ENDPOINT, - HTTPConnectorDefinition.SERVER_NAME, - CommonAttributes.PARAMS)) - .addChild( - builder(pathElement(REMOTE_CONNECTOR)) - .addAttributes( - RemoteTransportDefinition.SOCKET_BINDING, - CommonAttributes.PARAMS)) - .addChild( - builder(pathElement(IN_VM_CONNECTOR)) - .addAttributes( - InVMTransportDefinition.SERVER_ID, - CommonAttributes.PARAMS)) - .addChild( - builder(pathElement(CONNECTOR)) - .addAttributes( - GenericTransportDefinition.SOCKET_BINDING, - CommonAttributes.FACTORY_CLASS, - CommonAttributes.PARAMS)) - .addChild( - builder(HTTPAcceptorDefinition.INSTANCE.getPathElement()) - .addAttributes( - HTTPAcceptorDefinition.HTTP_LISTENER, - HTTPAcceptorDefinition.UPGRADE_LEGACY, - CommonAttributes.PARAMS)) - .addChild( - builder(pathElement(REMOTE_ACCEPTOR)) - .addAttributes( - RemoteTransportDefinition.SOCKET_BINDING, - CommonAttributes.PARAMS)) - .addChild( - builder(pathElement(IN_VM_ACCEPTOR)) - .addAttributes( - InVMTransportDefinition.SERVER_ID, - CommonAttributes.PARAMS)) - .addChild( - builder(pathElement(ACCEPTOR)) - .addAttributes( - GenericTransportDefinition.SOCKET_BINDING, - CommonAttributes.FACTORY_CLASS, - CommonAttributes.PARAMS)) - .addChild( - builder(MessagingExtension.BROADCAST_GROUP_PATH) - .addAttributes( - CommonAttributes.SOCKET_BINDING, - BroadcastGroupDefinition.JGROUPS_CHANNEL_FACTORY, - BroadcastGroupDefinition.JGROUPS_CHANNEL, - CommonAttributes.JGROUPS_CLUSTER, - BroadcastGroupDefinition.BROADCAST_PERIOD, - BroadcastGroupDefinition.CONNECTOR_REFS)) - .addChild( - builder(DiscoveryGroupDefinition.PATH) - .addAttributes( - CommonAttributes.SOCKET_BINDING, - DiscoveryGroupDefinition.JGROUPS_CHANNEL_FACTORY, - DiscoveryGroupDefinition.JGROUPS_CHANNEL, - CommonAttributes.JGROUPS_CLUSTER, - DiscoveryGroupDefinition.REFRESH_TIMEOUT, - DiscoveryGroupDefinition.INITIAL_WAIT_TIMEOUT)) - .addChild( - builder(MessagingExtension.CLUSTER_CONNECTION_PATH) - .addAttributes( - ClusterConnectionDefinition.ADDRESS, - ClusterConnectionDefinition.CONNECTOR_NAME, - ClusterConnectionDefinition.CHECK_PERIOD, - ClusterConnectionDefinition.CONNECTION_TTL, - CommonAttributes.MIN_LARGE_MESSAGE_SIZE, - CommonAttributes.CALL_TIMEOUT, - ClusterConnectionDefinition.CALL_FAILOVER_TIMEOUT, - ClusterConnectionDefinition.RETRY_INTERVAL, - ClusterConnectionDefinition.RETRY_INTERVAL_MULTIPLIER, - ClusterConnectionDefinition.MAX_RETRY_INTERVAL, - ClusterConnectionDefinition.INITIAL_CONNECT_ATTEMPTS, - ClusterConnectionDefinition.RECONNECT_ATTEMPTS, - ClusterConnectionDefinition.USE_DUPLICATE_DETECTION, - ClusterConnectionDefinition.MESSAGE_LOAD_BALANCING_TYPE, - ClusterConnectionDefinition.MAX_HOPS, - CommonAttributes.BRIDGE_CONFIRMATION_WINDOW_SIZE, - ClusterConnectionDefinition.PRODUCER_WINDOW_SIZE, - ClusterConnectionDefinition.NOTIFICATION_ATTEMPTS, - ClusterConnectionDefinition.NOTIFICATION_INTERVAL, - ClusterConnectionDefinition.CONNECTOR_REFS, - ClusterConnectionDefinition.ALLOW_DIRECT_CONNECTIONS_ONLY, - ClusterConnectionDefinition.DISCOVERY_GROUP_NAME)) - .addChild( - builder(GroupingHandlerDefinition.INSTANCE.getPathElement()) - .addAttributes( - GroupingHandlerDefinition.TYPE, - GroupingHandlerDefinition.GROUPING_HANDLER_ADDRESS, - GroupingHandlerDefinition.TIMEOUT, - GroupingHandlerDefinition.GROUP_TIMEOUT, - GroupingHandlerDefinition.REAPER_PERIOD)) - .addChild( - builder(DivertDefinition.INSTANCE.getPathElement()) - .addAttributes( - DivertDefinition.ROUTING_NAME, - DivertDefinition.ADDRESS, - DivertDefinition.FORWARDING_ADDRESS, - CommonAttributes.FILTER, - CommonAttributes.TRANSFORMER_CLASS_NAME, - DivertDefinition.EXCLUSIVE)) - .addChild( - builder(MessagingExtension.BRIDGE_PATH) - .addAttributes( - BridgeDefinition.QUEUE_NAME, - BridgeDefinition.FORWARDING_ADDRESS, - CommonAttributes.HA, - CommonAttributes.FILTER, - CommonAttributes.TRANSFORMER_CLASS_NAME, - CommonAttributes.MIN_LARGE_MESSAGE_SIZE, - CommonAttributes.CHECK_PERIOD, - CommonAttributes.CONNECTION_TTL, - CommonAttributes.RETRY_INTERVAL, - CommonAttributes.RETRY_INTERVAL_MULTIPLIER, - CommonAttributes.MAX_RETRY_INTERVAL, - BridgeDefinition.INITIAL_CONNECT_ATTEMPTS, - BridgeDefinition.RECONNECT_ATTEMPTS, - BridgeDefinition.RECONNECT_ATTEMPTS_ON_SAME_NODE, - BridgeDefinition.USE_DUPLICATE_DETECTION, - CommonAttributes.BRIDGE_CONFIRMATION_WINDOW_SIZE, - BridgeDefinition.PRODUCER_WINDOW_SIZE, - BridgeDefinition.USER, - BridgeDefinition.PASSWORD, - BridgeDefinition.CREDENTIAL_REFERENCE, - BridgeDefinition.CONNECTOR_REFS, - BridgeDefinition.DISCOVERY_GROUP_NAME)) - .addChild( - builder(ConnectorServiceDefinition.INSTANCE.getPathElement()) - .addAttributes( - CommonAttributes.FACTORY_CLASS, - CommonAttributes.PARAMS)) - .addChild( - builder(MessagingExtension.JMS_QUEUE_PATH) - .addAttributes( - CommonAttributes.DESTINATION_ENTRIES, - CommonAttributes.SELECTOR, - CommonAttributes.DURABLE, - CommonAttributes.LEGACY_ENTRIES)) - .addChild( - builder(MessagingExtension.JMS_TOPIC_PATH) - .addAttributes( - CommonAttributes.DESTINATION_ENTRIES, - CommonAttributes.LEGACY_ENTRIES)) - .addChild( - builder(MessagingExtension.CONNECTION_FACTORY_PATH) - .addAttributes( - ConnectionFactoryAttributes.Common.ENTRIES, - // common - ConnectionFactoryAttributes.Common.DISCOVERY_GROUP, - ConnectionFactoryAttributes.Common.CONNECTORS, - CommonAttributes.HA, - ConnectionFactoryAttributes.Common.CLIENT_FAILURE_CHECK_PERIOD, - ConnectionFactoryAttributes.Common.CONNECTION_TTL, - CommonAttributes.CALL_TIMEOUT, - CommonAttributes.CALL_FAILOVER_TIMEOUT, - ConnectionFactoryAttributes.Common.CONSUMER_WINDOW_SIZE, - ConnectionFactoryAttributes.Common.CONSUMER_MAX_RATE, - ConnectionFactoryAttributes.Common.CONFIRMATION_WINDOW_SIZE, - ConnectionFactoryAttributes.Common.PRODUCER_WINDOW_SIZE, - ConnectionFactoryAttributes.Common.PRODUCER_MAX_RATE, - ConnectionFactoryAttributes.Common.PROTOCOL_MANAGER_FACTORY, - ConnectionFactoryAttributes.Common.COMPRESS_LARGE_MESSAGES, - ConnectionFactoryAttributes.Common.CACHE_LARGE_MESSAGE_CLIENT, - CommonAttributes.MIN_LARGE_MESSAGE_SIZE, - CommonAttributes.CLIENT_ID, - ConnectionFactoryAttributes.Common.DUPS_OK_BATCH_SIZE, - ConnectionFactoryAttributes.Common.TRANSACTION_BATCH_SIZE, - ConnectionFactoryAttributes.Common.BLOCK_ON_ACKNOWLEDGE, - ConnectionFactoryAttributes.Common.BLOCK_ON_NON_DURABLE_SEND, - ConnectionFactoryAttributes.Common.BLOCK_ON_DURABLE_SEND, - ConnectionFactoryAttributes.Common.AUTO_GROUP, - ConnectionFactoryAttributes.Common.PRE_ACKNOWLEDGE, - ConnectionFactoryAttributes.Common.RETRY_INTERVAL, - ConnectionFactoryAttributes.Common.RETRY_INTERVAL_MULTIPLIER, - CommonAttributes.MAX_RETRY_INTERVAL, - ConnectionFactoryAttributes.Common.RECONNECT_ATTEMPTS, - ConnectionFactoryAttributes.Common.FAILOVER_ON_INITIAL_CONNECTION, - ConnectionFactoryAttributes.Common.CONNECTION_LOAD_BALANCING_CLASS_NAME, - ConnectionFactoryAttributes.Common.USE_GLOBAL_POOLS, - ConnectionFactoryAttributes.Common.SCHEDULED_THREAD_POOL_MAX_SIZE, - ConnectionFactoryAttributes.Common.THREAD_POOL_MAX_SIZE, - ConnectionFactoryAttributes.Common.GROUP_ID, - ConnectionFactoryAttributes.Common.DESERIALIZATION_BLACKLIST, - ConnectionFactoryAttributes.Common.DESERIALIZATION_WHITELIST, - // regular - ConnectionFactoryAttributes.Regular.FACTORY_TYPE)) - .addChild( - builder(LegacyConnectionFactoryDefinition.INSTANCE.getPathElement()) - .addAttributes( - LegacyConnectionFactoryDefinition.ENTRIES, - LegacyConnectionFactoryDefinition.DISCOVERY_GROUP, - LegacyConnectionFactoryDefinition.CONNECTORS, - LegacyConnectionFactoryDefinition.AUTO_GROUP, - LegacyConnectionFactoryDefinition.BLOCK_ON_ACKNOWLEDGE, - LegacyConnectionFactoryDefinition.BLOCK_ON_DURABLE_SEND, - LegacyConnectionFactoryDefinition.BLOCK_ON_NON_DURABLE_SEND, - CommonAttributes.CALL_TIMEOUT, - CommonAttributes.CALL_FAILOVER_TIMEOUT, - LegacyConnectionFactoryDefinition.CACHE_LARGE_MESSAGE_CLIENT, - LegacyConnectionFactoryDefinition.CLIENT_FAILURE_CHECK_PERIOD, - CommonAttributes.CLIENT_ID, - LegacyConnectionFactoryDefinition.COMPRESS_LARGE_MESSAGES, - LegacyConnectionFactoryDefinition.CONFIRMATION_WINDOW_SIZE, - LegacyConnectionFactoryDefinition.CONNECTION_LOAD_BALANCING_CLASS_NAME, - LegacyConnectionFactoryDefinition.CONNECTION_TTL, - LegacyConnectionFactoryDefinition.CONSUMER_MAX_RATE, - LegacyConnectionFactoryDefinition.CONSUMER_WINDOW_SIZE, - LegacyConnectionFactoryDefinition.DUPS_OK_BATCH_SIZE, - LegacyConnectionFactoryDefinition.FACTORY_TYPE, - LegacyConnectionFactoryDefinition.FAILOVER_ON_INITIAL_CONNECTION, - LegacyConnectionFactoryDefinition.GROUP_ID, - LegacyConnectionFactoryDefinition.INITIAL_CONNECT_ATTEMPTS, - LegacyConnectionFactoryDefinition.INITIAL_MESSAGE_PACKET_SIZE, - LegacyConnectionFactoryDefinition.HA, - LegacyConnectionFactoryDefinition.MAX_RETRY_INTERVAL, - LegacyConnectionFactoryDefinition.MIN_LARGE_MESSAGE_SIZE, - LegacyConnectionFactoryDefinition.PRE_ACKNOWLEDGE, - LegacyConnectionFactoryDefinition.PRODUCER_MAX_RATE, - LegacyConnectionFactoryDefinition.PRODUCER_WINDOW_SIZE, - LegacyConnectionFactoryDefinition.RECONNECT_ATTEMPTS, - LegacyConnectionFactoryDefinition.RETRY_INTERVAL, - LegacyConnectionFactoryDefinition.RETRY_INTERVAL_MULTIPLIER, - LegacyConnectionFactoryDefinition.SCHEDULED_THREAD_POOL_MAX_SIZE, - LegacyConnectionFactoryDefinition.THREAD_POOL_MAX_SIZE, - LegacyConnectionFactoryDefinition.TRANSACTION_BATCH_SIZE, - LegacyConnectionFactoryDefinition.USE_GLOBAL_POOLS)) - .addChild( - builder(PooledConnectionFactoryDefinition.INSTANCE.getPathElement()) - .addAttributes( - ConnectionFactoryAttributes.Common.ENTRIES, - // common - ConnectionFactoryAttributes.Common.DISCOVERY_GROUP, - ConnectionFactoryAttributes.Common.CONNECTORS, - CommonAttributes.HA, - ConnectionFactoryAttributes.Common.CLIENT_FAILURE_CHECK_PERIOD, - ConnectionFactoryAttributes.Common.CONNECTION_TTL, - CommonAttributes.CALL_TIMEOUT, - CommonAttributes.CALL_FAILOVER_TIMEOUT, - ConnectionFactoryAttributes.Common.CONSUMER_WINDOW_SIZE, - ConnectionFactoryAttributes.Common.CONSUMER_MAX_RATE, - ConnectionFactoryAttributes.Common.CONFIRMATION_WINDOW_SIZE, - ConnectionFactoryAttributes.Common.PRODUCER_WINDOW_SIZE, - ConnectionFactoryAttributes.Common.PRODUCER_MAX_RATE, - ConnectionFactoryAttributes.Common.PROTOCOL_MANAGER_FACTORY, - ConnectionFactoryAttributes.Common.COMPRESS_LARGE_MESSAGES, - ConnectionFactoryAttributes.Common.CACHE_LARGE_MESSAGE_CLIENT, - CommonAttributes.MIN_LARGE_MESSAGE_SIZE, - CommonAttributes.CLIENT_ID, - ConnectionFactoryAttributes.Common.DUPS_OK_BATCH_SIZE, - ConnectionFactoryAttributes.Common.TRANSACTION_BATCH_SIZE, - ConnectionFactoryAttributes.Common.BLOCK_ON_ACKNOWLEDGE, - ConnectionFactoryAttributes.Common.BLOCK_ON_NON_DURABLE_SEND, - ConnectionFactoryAttributes.Common.BLOCK_ON_DURABLE_SEND, - ConnectionFactoryAttributes.Common.AUTO_GROUP, - ConnectionFactoryAttributes.Common.PRE_ACKNOWLEDGE, - ConnectionFactoryAttributes.Common.RETRY_INTERVAL, - ConnectionFactoryAttributes.Common.RETRY_INTERVAL_MULTIPLIER, - CommonAttributes.MAX_RETRY_INTERVAL, - ConnectionFactoryAttributes.Common.RECONNECT_ATTEMPTS, - ConnectionFactoryAttributes.Common.FAILOVER_ON_INITIAL_CONNECTION, - ConnectionFactoryAttributes.Common.CONNECTION_LOAD_BALANCING_CLASS_NAME, - ConnectionFactoryAttributes.Common.USE_GLOBAL_POOLS, - ConnectionFactoryAttributes.Common.SCHEDULED_THREAD_POOL_MAX_SIZE, - ConnectionFactoryAttributes.Common.THREAD_POOL_MAX_SIZE, - ConnectionFactoryAttributes.Common.GROUP_ID, - ConnectionFactoryAttributes.Common.DESERIALIZATION_BLACKLIST, - ConnectionFactoryAttributes.Common.DESERIALIZATION_WHITELIST, - // pooled - // inbound config - ConnectionFactoryAttributes.Pooled.USE_JNDI, - ConnectionFactoryAttributes.Pooled.JNDI_PARAMS, - ConnectionFactoryAttributes.Pooled.REBALANCE_CONNECTIONS, - ConnectionFactoryAttributes.Pooled.USE_LOCAL_TX, - ConnectionFactoryAttributes.Pooled.SETUP_ATTEMPTS, - ConnectionFactoryAttributes.Pooled.SETUP_INTERVAL, - // outbound config - ConnectionFactoryAttributes.Pooled.ALLOW_LOCAL_TRANSACTIONS, - - ConnectionFactoryAttributes.Pooled.TRANSACTION, - ConnectionFactoryAttributes.Pooled.USER, - ConnectionFactoryAttributes.Pooled.PASSWORD, - ConnectionFactoryAttributes.Pooled.CREDENTIAL_REFERENCE, - ConnectionFactoryAttributes.Pooled.MIN_POOL_SIZE, - ConnectionFactoryAttributes.Pooled.USE_AUTO_RECOVERY, - ConnectionFactoryAttributes.Pooled.MAX_POOL_SIZE, - ConnectionFactoryAttributes.Pooled.MANAGED_CONNECTION_POOL, - ConnectionFactoryAttributes.Pooled.ENLISTMENT_TRACE, - ConnectionFactoryAttributes.Pooled.INITIAL_MESSAGE_PACKET_SIZE, - ConnectionFactoryAttributes.Pooled.INITIAL_CONNECT_ATTEMPTS, - ConnectionFactoryAttributes.Pooled.STATISTICS_ENABLED))) - .addChild( - builder(JMSBridgeDefinition.INSTANCE.getPathElement()) - .addAttributes( - JMSBridgeDefinition.MODULE, - JMSBridgeDefinition.QUALITY_OF_SERVICE, - JMSBridgeDefinition.FAILURE_RETRY_INTERVAL, - JMSBridgeDefinition.MAX_RETRIES, - JMSBridgeDefinition.MAX_BATCH_SIZE, - JMSBridgeDefinition.MAX_BATCH_TIME, - CommonAttributes.SELECTOR, - JMSBridgeDefinition.SUBSCRIPTION_NAME, - CommonAttributes.CLIENT_ID, - JMSBridgeDefinition.ADD_MESSAGE_ID_IN_HEADER, - JMSBridgeDefinition.SOURCE_CONNECTION_FACTORY, - JMSBridgeDefinition.SOURCE_DESTINATION, - JMSBridgeDefinition.SOURCE_USER, - JMSBridgeDefinition.SOURCE_PASSWORD, - JMSBridgeDefinition.SOURCE_CREDENTIAL_REFERENCE, - JMSBridgeDefinition.TARGET_CONNECTION_FACTORY, - JMSBridgeDefinition.TARGET_DESTINATION, - JMSBridgeDefinition.TARGET_USER, - JMSBridgeDefinition.TARGET_PASSWORD, - JMSBridgeDefinition.TARGET_CREDENTIAL_REFERENCE, - JMSBridgeDefinition.SOURCE_CONTEXT, - JMSBridgeDefinition.TARGET_CONTEXT)) - .build(); - } - -} diff --git a/messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/MessagingTransformerRegistration.java b/messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/MessagingTransformerRegistration.java index 8da430ce0859..b3f3a0d0b0fe 100644 --- a/messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/MessagingTransformerRegistration.java +++ b/messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/MessagingTransformerRegistration.java @@ -63,7 +63,7 @@ public void registerTransformers(SubsystemTransformerRegistration registration) registerTransformers_EAP_7_1_0(builder.createBuilder(MessagingExtension.VERSION_3_0_0, MessagingExtension.VERSION_2_0_0)); registerTransformers_EAP_7_0_0(builder.createBuilder(MessagingExtension.VERSION_2_0_0, MessagingExtension.VERSION_1_0_0)); - builder.buildAndRegister(registration, new ModelVersion[] { MessagingExtension.VERSION_1_0_0, MessagingExtension.VERSION_2_0_0, MessagingExtension.VERSION_3_0_0 }); + builder.buildAndRegister(registration, new ModelVersion[] { MessagingExtension.VERSION_1_0_0, MessagingExtension.VERSION_2_0_0 }); } private static void registerTransformers_EAP_7_1_0(ResourceTransformationDescriptionBuilder subsystem) { diff --git a/messaging-activemq/src/main/resources/schema/wildfly-messaging-activemq_3_1.xsd b/messaging-activemq/src/main/resources/schema/wildfly-messaging-activemq_3_1.xsd deleted file mode 100644 index 76c4a2b67283..000000000000 --- a/messaging-activemq/src/main/resources/schema/wildfly-messaging-activemq_3_1.xsd +++ /dev/null @@ -1,912 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Credential to be used by the configuration. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Deprecated. Use jgroups-channel instead. - - - - - - - - - - - - - - - - - Deprecated. Use jgroups-channel instead. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Credential to be used by the configuration. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Credential to be used by the configuration. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Credential to be used by the configuration to connect to the source destination. - - - - - - - - - - - - - - - - - - Credential to be used by the configuration to connect to the target destination. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Group of attributes used when referencing credential through credential store. - - - - - - Credential store name used to fetch credential with given 'alias' from. - Credential store name has to be defined elsewhere. - - - - - - - Alias of credential in the credential store. - - - - - - - Type of credential to be fetched from credential store. - It is usually fully qualified class name. - - - - - - - - - - - Credential/password in clear text. Use just for testing purpose. - Otherwise use credential store to mask the actual credential from your configuration. - - - - - - diff --git a/messaging-activemq/src/main/resources/subsystem-templates/messaging-activemq-colocated.xml b/messaging-activemq/src/main/resources/subsystem-templates/messaging-activemq-colocated.xml index b0fae6bfd082..2fd3cea27faa 100644 --- a/messaging-activemq/src/main/resources/subsystem-templates/messaging-activemq-colocated.xml +++ b/messaging-activemq/src/main/resources/subsystem-templates/messaging-activemq-colocated.xml @@ -3,7 +3,7 @@ org.wildfly.extension.messaging-activemq - + diff --git a/messaging-activemq/src/main/resources/subsystem-templates/messaging-activemq.xml b/messaging-activemq/src/main/resources/subsystem-templates/messaging-activemq.xml index d4994b5f01a1..192d6eba7ac1 100644 --- a/messaging-activemq/src/main/resources/subsystem-templates/messaging-activemq.xml +++ b/messaging-activemq/src/main/resources/subsystem-templates/messaging-activemq.xml @@ -2,7 +2,7 @@ org.wildfly.extension.messaging-activemq - + diff --git a/messaging-activemq/src/test/java/org/wildfly/extension/messaging/activemq/MessagingActiveMQSubsystem_3_0_TestCase.java b/messaging-activemq/src/test/java/org/wildfly/extension/messaging/activemq/MessagingActiveMQSubsystem_3_0_TestCase.java index b13b5889135c..4548fdb75629 100644 --- a/messaging-activemq/src/test/java/org/wildfly/extension/messaging/activemq/MessagingActiveMQSubsystem_3_0_TestCase.java +++ b/messaging-activemq/src/test/java/org/wildfly/extension/messaging/activemq/MessagingActiveMQSubsystem_3_0_TestCase.java @@ -82,6 +82,14 @@ protected String getSubsystemXsdPath() throws IOException { return "schema/wildfly-messaging-activemq_3_0.xsd"; } + @Override + protected String[] getSubsystemTemplatePaths() throws IOException { + return new String[] { + "/subsystem-templates/messaging-activemq.xml", + "/subsystem-templates/messaging-activemq-colocated.xml", + }; + } + @Override protected Properties getResolvedProperties() { Properties properties = new Properties(); @@ -90,10 +98,12 @@ protected Properties getResolvedProperties() { return properties; } + @Test @Override - protected KernelServices standardSubsystemTest(String configId, boolean compareXml) throws Exception { - return super.standardSubsystemTest(configId, false); + public void testSchemaOfSubsystemTemplates() throws Exception { + super.testSchemaOfSubsystemTemplates(); } + ///////////////////////////////////////// // Tests for HA Policy Configuration // ///////////////////////////////////////// diff --git a/messaging-activemq/src/test/java/org/wildfly/extension/messaging/activemq/MessagingActiveMQSubsystem_3_1_TestCase.java b/messaging-activemq/src/test/java/org/wildfly/extension/messaging/activemq/MessagingActiveMQSubsystem_3_1_TestCase.java deleted file mode 100644 index e7ce2c441478..000000000000 --- a/messaging-activemq/src/test/java/org/wildfly/extension/messaging/activemq/MessagingActiveMQSubsystem_3_1_TestCase.java +++ /dev/null @@ -1,270 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2010, Red Hat, Inc., and individual contributors - * as indicated by the @author tags. See the copyright.txt file in the - * distribution for a full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -package org.wildfly.extension.messaging.activemq; - -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NAME; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.WRITE_ATTRIBUTE_OPERATION; -import static org.jboss.as.model.test.ModelTestControllerVersion.EAP_7_0_0; -import static org.jboss.as.model.test.ModelTestControllerVersion.EAP_7_1_0; -import static org.junit.Assert.assertTrue; -import static org.wildfly.extension.messaging.activemq.MessagingDependencies.getActiveMQDependencies; -import static org.wildfly.extension.messaging.activemq.MessagingDependencies.getJGroupsDependencies; -import static org.wildfly.extension.messaging.activemq.MessagingDependencies.getMessagingActiveMQGAV; -import static org.wildfly.extension.messaging.activemq.MessagingExtension.BRIDGE_PATH; -import static org.wildfly.extension.messaging.activemq.MessagingExtension.CLUSTER_CONNECTION_PATH; -import static org.wildfly.extension.messaging.activemq.MessagingExtension.CONNECTION_FACTORY_PATH; -import static org.wildfly.extension.messaging.activemq.MessagingExtension.POOLED_CONNECTION_FACTORY_PATH; -import static org.wildfly.extension.messaging.activemq.MessagingExtension.REPLICATION_COLOCATED_PATH; -import static org.wildfly.extension.messaging.activemq.MessagingExtension.REPLICATION_MASTER_PATH; -import static org.wildfly.extension.messaging.activemq.MessagingExtension.SERVER_PATH; -import static org.wildfly.extension.messaging.activemq.MessagingExtension.SUBSYSTEM_PATH; - -import java.io.IOException; -import java.util.List; -import java.util.Properties; - -import org.jboss.as.clustering.controller.Operations; -import org.jboss.as.controller.ModelVersion; -import org.jboss.as.controller.PathAddress; -import org.jboss.as.controller.PathElement; -import org.jboss.as.controller.security.CredentialReference; -import org.jboss.as.model.test.FailedOperationTransformationConfig; -import org.jboss.as.model.test.ModelTestControllerVersion; -import org.jboss.as.model.test.ModelTestUtils; -import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest; -import org.jboss.as.subsystem.test.AdditionalInitialization; -import org.jboss.as.subsystem.test.KernelServices; -import org.jboss.as.subsystem.test.KernelServicesBuilder; -import org.jboss.dmr.ModelNode; -import org.junit.Test; -import org.wildfly.clustering.jgroups.spi.JGroupsDefaultRequirement; -import org.wildfly.clustering.spi.ClusteringDefaultRequirement; -import org.wildfly.clustering.spi.ClusteringRequirement; -import org.wildfly.extension.messaging.activemq.ha.HAAttributes; -import org.wildfly.extension.messaging.activemq.jms.ConnectionFactoryAttributes; - -/** - * * @author Jeff Mesnil (c) 2012 Red Hat inc - */ -public class MessagingActiveMQSubsystem_3_1_TestCase extends AbstractSubsystemBaseTest { - - public MessagingActiveMQSubsystem_3_1_TestCase() { - super(MessagingExtension.SUBSYSTEM_NAME, new MessagingExtension()); - } - - @Override - protected String getSubsystemXml() throws IOException { - return readResource("subsystem_3_1.xml"); - } - - @Override - protected String getSubsystemXsdPath() throws IOException { - return "schema/wildfly-messaging-activemq_3_1.xsd"; - } - - @Override - protected String[] getSubsystemTemplatePaths() throws IOException { - return new String[] { - "/subsystem-templates/messaging-activemq.xml", - "/subsystem-templates/messaging-activemq-colocated.xml", - }; - } - - @Override - protected Properties getResolvedProperties() { - Properties properties = new Properties(); - properties.put("messaging.cluster.user.name", "myClusterUser"); - properties.put("messaging.cluster.user.password", "myClusterPassword"); - return properties; - } - - @Test - @Override - public void testSchemaOfSubsystemTemplates() throws Exception { - super.testSchemaOfSubsystemTemplates(); - } - - ///////////////////////////////////////// - // Tests for HA Policy Configuration // - ///////////////////////////////////////// - - @Test - public void testHAPolicyConfiguration() throws Exception { - standardSubsystemTest("subsystem_3_1_ha-policy.xml"); - } - - /////////////////////// - // Transformers test // - /////////////////////// - - @Test - public void testTransformersEAP_7_1_0() throws Exception { - testTransformers(EAP_7_1_0, MessagingExtension.VERSION_2_0_0); - } - - @Test - public void testTransformersEAP_7_0_0() throws Exception { - testTransformers(EAP_7_0_0, MessagingExtension.VERSION_1_0_0); - } - - @Test - public void testRejectingTransformersEAP_7_1_0() throws Exception { - testRejectingTransformers(EAP_7_1_0, MessagingExtension.VERSION_2_0_0); - } - - @Test - public void testRejectingTransformersEAP_7_0_0() throws Exception { - testRejectingTransformers(EAP_7_0_0, MessagingExtension.VERSION_1_0_0); - } - - private void testTransformers(ModelTestControllerVersion controllerVersion, ModelVersion messagingVersion) throws Exception { - //Boot up empty controllers with the resources needed for the ops coming from the xml to work - KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization()) - .setSubsystemXmlResource("subsystem_3_1_transform.xml"); - builder.createLegacyKernelServicesBuilder(createAdditionalInitialization(), controllerVersion, messagingVersion) - .addMavenResourceURL(getMessagingActiveMQGAV(controllerVersion)) - .addMavenResourceURL(getActiveMQDependencies(controllerVersion)) - .addMavenResourceURL(getJGroupsDependencies(controllerVersion)) - .skipReverseControllerCheck() - .dontPersistXml(); - - KernelServices mainServices = builder.build(); - assertTrue(mainServices.isSuccessfulBoot()); - assertTrue(mainServices.getLegacyServices(messagingVersion).isSuccessfulBoot()); - - checkSubsystemModelTransformation(mainServices, messagingVersion); - } - - private void testRejectingTransformers(ModelTestControllerVersion controllerVersion, ModelVersion messagingVersion) throws Exception { - //Boot up empty controllers with the resources needed for the ops coming from the xml to work - KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization()); - builder.createLegacyKernelServicesBuilder(createAdditionalInitialization(), controllerVersion, messagingVersion) - .addMavenResourceURL(getMessagingActiveMQGAV(controllerVersion)) - .addMavenResourceURL(getActiveMQDependencies(controllerVersion)) - .addMavenResourceURL(getJGroupsDependencies(controllerVersion)) - .skipReverseControllerCheck() - .dontPersistXml(); - - KernelServices mainServices = builder.build(); - assertTrue(mainServices.isSuccessfulBoot()); - assertTrue(mainServices.getLegacyServices(messagingVersion).isSuccessfulBoot()); - - List ops = builder.parseXmlResource("subsystem_3_1_reject_transform.xml"); - System.out.println("ops = " + ops); - PathAddress subsystemAddress = PathAddress.pathAddress(SUBSYSTEM_PATH); - - FailedOperationTransformationConfig config = new FailedOperationTransformationConfig(); - if (messagingVersion.equals(MessagingExtension.VERSION_1_0_0)) { - config.addFailedAttribute(subsystemAddress, - new FailedOperationTransformationConfig.NewAttributesConfig( - MessagingSubsystemRootResourceDefinition.GLOBAL_CLIENT_THREAD_POOL_MAX_SIZE, - MessagingSubsystemRootResourceDefinition.GLOBAL_CLIENT_SCHEDULED_THREAD_POOL_MAX_SIZE)) - .addFailedAttribute(subsystemAddress.append(SERVER_PATH), - new FailedOperationTransformationConfig.NewAttributesConfig( - ServerDefinition.ELYTRON_DOMAIN, - ServerDefinition.JOURNAL_DATASOURCE, - ServerDefinition.JOURNAL_MESSAGES_TABLE, - ServerDefinition.JOURNAL_BINDINGS_TABLE, - ServerDefinition.JOURNAL_JMS_BINDINGS_TABLE, - ServerDefinition.JOURNAL_LARGE_MESSAGES_TABLE, - ServerDefinition.JOURNAL_PAGE_STORE_TABLE, - ServerDefinition.JOURNAL_DATABASE, - ServerDefinition.JOURNAL_JDBC_NETWORK_TIMEOUT)) - .addFailedAttribute(subsystemAddress.append(SERVER_PATH, REPLICATION_MASTER_PATH), - new ChangeToTrueConfig(HAAttributes.CHECK_FOR_LIVE_SERVER.getName())) - .addFailedAttribute(subsystemAddress.append(SERVER_PATH, REPLICATION_COLOCATED_PATH, MessagingExtension.CONFIGURATION_MASTER_PATH), - new ChangeToTrueConfig(HAAttributes.CHECK_FOR_LIVE_SERVER.getName())) - .addFailedAttribute(subsystemAddress.append(SERVER_PATH, PathElement.pathElement(CommonAttributes.HTTP_CONNECTOR)), - new FailedOperationTransformationConfig.NewAttributesConfig( - HTTPConnectorDefinition.SERVER_NAME)) - .addFailedAttribute(subsystemAddress.append(SERVER_PATH, BRIDGE_PATH), - new FailedOperationTransformationConfig.NewAttributesConfig( - BridgeDefinition.PRODUCER_WINDOW_SIZE)) - .addFailedAttribute(subsystemAddress.append(SERVER_PATH, CLUSTER_CONNECTION_PATH), - new FailedOperationTransformationConfig.NewAttributesConfig( - ClusterConnectionDefinition.PRODUCER_WINDOW_SIZE)) - .addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), - new FailedOperationTransformationConfig.NewAttributesConfig( - ConnectionFactoryAttributes.Common.DESERIALIZATION_BLACKLIST, - ConnectionFactoryAttributes.Common.DESERIALIZATION_WHITELIST)) - .addFailedAttribute(subsystemAddress.append(SERVER_PATH, POOLED_CONNECTION_FACTORY_PATH), - new FailedOperationTransformationConfig.NewAttributesConfig( - ConnectionFactoryAttributes.Pooled.ALLOW_LOCAL_TRANSACTIONS, - ConnectionFactoryAttributes.Pooled.REBALANCE_CONNECTIONS, - ConnectionFactoryAttributes.Pooled.STATISTICS_ENABLED, - ConnectionFactoryAttributes.Pooled.CREDENTIAL_REFERENCE, - ConnectionFactoryAttributes.Common.DESERIALIZATION_BLACKLIST, - ConnectionFactoryAttributes.Common.DESERIALIZATION_WHITELIST)) - ; - } - - config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.BROADCAST_GROUP_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BroadcastGroupDefinition.JGROUPS_CHANNEL)); - config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, DiscoveryGroupDefinition.PATH), new FailedOperationTransformationConfig.NewAttributesConfig(DiscoveryGroupDefinition.JGROUPS_CHANNEL)); - - ModelTestUtils.checkFailedTransformedBootOperations(mainServices, messagingVersion, ops, config); - } - - @Override - protected AdditionalInitialization createAdditionalInitialization() { - return AdditionalInitialization.withCapabilities(ClusteringRequirement.COMMAND_DISPATCHER_FACTORY.resolve("ee"), - ClusteringDefaultRequirement.COMMAND_DISPATCHER_FACTORY.getName(), - JGroupsDefaultRequirement.CHANNEL_FACTORY.getName(), - Capabilities.ELYTRON_DOMAIN_CAPABILITY, - Capabilities.ELYTRON_DOMAIN_CAPABILITY + ".elytronDomain", - CredentialReference.CREDENTIAL_STORE_CAPABILITY + ".cs1"); - } - - private static class ChangeToTrueConfig extends FailedOperationTransformationConfig.AttributesPathAddressConfig { - - private final String attribute; - - ChangeToTrueConfig(String attribute) { - super(attribute); - this.attribute = attribute; - } - - @Override - protected boolean isAttributeWritable(String attributeName) { - return true; - } - - @Override - protected boolean checkValue(ModelNode operation, String attrName, ModelNode attribute, boolean isGeneratedWriteAttribute) { - if (!isGeneratedWriteAttribute && Operations.getName(operation).equals(WRITE_ATTRIBUTE_OPERATION) && operation.hasDefined(NAME) && operation.get(NAME).asString().equals(this.attribute)) { - // The attribute won't be defined in the :write-attribute(name=,.. boot operation so don't reject in that case - return false; - } - return !attribute.equals(new ModelNode(true)); - } - - @Override - protected boolean checkValue(String attrName, ModelNode attribute, boolean isWriteAttribute) { - throw new IllegalStateException(); - } - - @Override - protected ModelNode correctValue(ModelNode toResolve, boolean isWriteAttribute) { - return new ModelNode(true); - } - } -} diff --git a/messaging-activemq/src/test/resources/org/wildfly/extension/messaging/activemq/subsystem_3_1.xml b/messaging-activemq/src/test/resources/org/wildfly/extension/messaging/activemq/subsystem_3_1.xml deleted file mode 100644 index aa669066d477..000000000000 --- a/messaging-activemq/src/test/resources/org/wildfly/extension/messaging/activemq/subsystem_3_1.xml +++ /dev/null @@ -1,531 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/messaging-activemq/src/test/resources/org/wildfly/extension/messaging/activemq/subsystem_3_1_ha-policy.xml b/messaging-activemq/src/test/resources/org/wildfly/extension/messaging/activemq/subsystem_3_1_ha-policy.xml deleted file mode 100644 index 5741eb32e9c6..000000000000 --- a/messaging-activemq/src/test/resources/org/wildfly/extension/messaging/activemq/subsystem_3_1_ha-policy.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/messaging-activemq/src/test/resources/org/wildfly/extension/messaging/activemq/subsystem_3_1_reject_transform.xml b/messaging-activemq/src/test/resources/org/wildfly/extension/messaging/activemq/subsystem_3_1_reject_transform.xml deleted file mode 100644 index cce2c0e38cb5..000000000000 --- a/messaging-activemq/src/test/resources/org/wildfly/extension/messaging/activemq/subsystem_3_1_reject_transform.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/messaging-activemq/src/test/resources/org/wildfly/extension/messaging/activemq/subsystem_3_1_transform.xml b/messaging-activemq/src/test/resources/org/wildfly/extension/messaging/activemq/subsystem_3_1_transform.xml deleted file mode 100644 index d7d35b34bab9..000000000000 --- a/messaging-activemq/src/test/resources/org/wildfly/extension/messaging/activemq/subsystem_3_1_transform.xml +++ /dev/null @@ -1,404 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -