jbertram commented on a change in pull request #3412:
URL: https://github.com/apache/activemq-artemis/pull/3412#discussion_r562318157



##########
File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/config/BridgeConfiguration.java
##########
@@ -360,6 +498,98 @@ public BridgeConfiguration setCallTimeout(long 
callTimeout) {
       return this;
    }
 
+   /**
+    * This method returns a JSON-formatted {@code String} representation of 
this {@code QueueConfiguration}. It is a
+    * simple collection of key/value pairs. The keys used are referenced in 
{@link #set(String, String)}.
+    *
+    * @return a JSON-formatted {@code String} representation of this {@code 
QueueConfiguration}

Review comment:
       The JavaDoc references `QueueConfiguration`.

##########
File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/config/BridgeConfiguration.java
##########
@@ -360,6 +498,98 @@ public BridgeConfiguration setCallTimeout(long 
callTimeout) {
       return this;
    }
 
+   /**
+    * This method returns a JSON-formatted {@code String} representation of 
this {@code QueueConfiguration}. It is a
+    * simple collection of key/value pairs. The keys used are referenced in 
{@link #set(String, String)}.
+    *
+    * @return a JSON-formatted {@code String} representation of this {@code 
QueueConfiguration}
+    */
+   public String toJSON() {
+      JsonObjectBuilder builder = JsonLoader.createObjectBuilder();
+
+      if (getName() != null) {
+         builder.add(NAME, getName());
+      }
+      if (getQueueName() != null) {
+         builder.add(QUEUE_NAME, getQueueName());
+      }
+      if (getForwardingAddress() != null) {
+         builder.add(FORWARDING_ADDRESS, getForwardingAddress());
+      }
+      if (getFilterString() != null) {
+         builder.add(FILTER_STRING, getFilterString());
+      }
+      if (getStaticConnectors() != null) {
+         JsonArrayBuilder arrayBuilder = JsonLoader.createArrayBuilder();
+         getStaticConnectors().forEach(arrayBuilder::add);
+         builder.add(STATIC_CONNECTORS, arrayBuilder);
+      }
+      if (getDiscoveryGroupName() != null) {
+         builder.add(DISCOVERY_GROUP_NAME, getDiscoveryGroupName());
+      }
+      builder.add(HA, isHA());
+      if (getTransformerConfiguration() != null) {
+         TransformerConfiguration tc = getTransformerConfiguration();
+         JsonObjectBuilder tcBuilder = JsonLoader.createObjectBuilder()
+               .add(TransformerConfiguration.CLASS_NAME, tc.getClassName());
+         if (tc.getProperties() != null && tc.getProperties().size() > 0) {
+            JsonObjectBuilder propBuilder = JsonLoader.createObjectBuilder();
+            tc.getProperties().forEach(propBuilder::add);
+            tcBuilder.add(TransformerConfiguration.PROPERTIES, propBuilder);
+         }
+         builder.add(TRANSFORMER_CONFIGURATION, tcBuilder);
+      }
+      builder.add(RETRY_INTERVAL, getRetryInterval());
+      builder.add(RETRY_INTERVAL_MULTIPLIER, getRetryIntervalMultiplier());
+      builder.add(INITIAL_CONNECT_ATTEMPTS, getInitialConnectAttempts());
+      builder.add(RECONNECT_ATTEMPTS, getReconnectAttempts());
+      builder.add(RECONNECT_ATTEMPTS_ON_SAME_NODE, 
getReconnectAttemptsOnSameNode());
+      builder.add(USE_DUPLICATE_DETECTION, isUseDuplicateDetection());
+      builder.add(CONFIRMATION_WINDOW_SIZE, getConfirmationWindowSize());
+      builder.add(PRODUCER_WINDOW_SIZE, getProducerWindowSize());
+      builder.add(CLIENT_FAILURE_CHECK_PERIOD, getClientFailureCheckPeriod());
+      if (getUser() != null) {
+         builder.add(USER, getUser());
+      }
+      if (getPassword() != null) {
+         builder.add(PASSWORD, getPassword());
+      }
+      builder.add(CONNECTION_TTL, getConnectionTTL());
+      builder.add(MAX_RETRY_INTERVAL, getMaxRetryInterval());
+      builder.add(MIN_LARGE_MESSAGE_SIZE, getMinLargeMessageSize());
+      builder.add(CALL_TIMEOUT, getCallTimeout());
+      builder.add(ROUTING_TYPE, getRoutingType().name());
+
+      return builder.build().toString();
+   }
+
+   /**
+    * This method returns a {@code QueueConfiguration} created from the 
JSON-formatted input {@code String}. The input

Review comment:
       The JavaDoc references `QueueConfiguration`.

##########
File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
##########
@@ -3822,6 +3822,30 @@ public void createBridge(final String name,
       }
    }
 
+   @Override
+   public String createBridge(String bridgeConfigurationAsJson) throws 
Exception {
+      if (AuditLogger.isEnabled()) {
+         AuditLogger.createBridge(this.server, bridgeConfigurationAsJson);
+      }
+      checkStarted();
+
+      clearIO();
+
+      try {
+         // when the QueueConfiguration is passed through createQueue all of 
its defaults get set which we return to the caller

Review comment:
       The comment references `QueueConfiguration`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to