[ 
https://issues.apache.org/jira/browse/GEODE-3781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16273561#comment-16273561
 ] 

ASF GitHub Bot commented on GEODE-3781:
---------------------------------------

nreich commented on a change in pull request #1071: GEODE-3781: add 
geode-connectors module
URL: https://github.com/apache/geode/pull/1071#discussion_r154216357
 
 

 ##########
 File path: 
geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/DestroyConnectionCommand.java
 ##########
 @@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.connectors.jdbc.internal.cli;
+
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.springframework.shell.core.annotation.CliCommand;
+import org.springframework.shell.core.annotation.CliOption;
+
+import org.apache.geode.cache.execute.ResultCollector;
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.management.cli.CliMetaData;
+import org.apache.geode.management.cli.Result;
+import org.apache.geode.management.internal.cli.commands.GfshCommand;
+import org.apache.geode.management.internal.cli.functions.CliFunctionResult;
+import org.apache.geode.management.internal.cli.i18n.CliStrings;
+import org.apache.geode.management.internal.cli.result.ResultBuilder;
+import org.apache.geode.management.internal.cli.result.TabularResultData;
+import org.apache.geode.management.internal.configuration.domain.XmlEntity;
+import org.apache.geode.management.internal.security.ResourceOperation;
+import org.apache.geode.security.ResourcePermission;
+
+public class DestroyConnectionCommand implements GfshCommand {
+
+  static final String DESTROY_CONNECTION = "destroy jdbc-connection";
+  static final String DESTROY_CONNECTION__HELP = "Destroy/Remove the specified 
jdbc connection.";
+  static final String DESTROY_CONNECTION__NAME = "name";
+  static final String DESTROY_CONNECTION__NAME__HELP =
+      "Name of the jdbc connection to be destroyed.";
+
+  private static final String ERROR_PREFIX = "ERROR: ";
+
+  @CliCommand(value = DESTROY_CONNECTION, help = DESTROY_CONNECTION__HELP)
+  @CliMetaData(relatedTopic = CliStrings.TOPIC_GEODE_REGION)
+  @ResourceOperation(resource = ResourcePermission.Resource.CLUSTER,
+      operation = ResourcePermission.Operation.MANAGE)
+  public Result destroyConnection(@CliOption(key = DESTROY_CONNECTION__NAME, 
mandatory = true,
+      help = DESTROY_CONNECTION__NAME__HELP) String name) {
+
+    Set<DistributedMember> membersToDestroyConnectionOn = getMembers(null, 
null);
+
+    ResultCollector<?, ?> resultCollector =
+        executeFunction(new DestroyConnectionFunction(), name, 
membersToDestroyConnectionOn);
+
+    Object resultCollectorResult = resultCollector.getResult();
+
+    List<CliFunctionResult> connectionDestroyResults =
+        (List<CliFunctionResult>) resultCollectorResult;
+
+    AtomicReference<XmlEntity> xmlEntity = new AtomicReference<>();
 
 Review comment:
   A lot of this code is very similar with the create command: as we create 
more commands, we should see if it makes sense to DRY up this logic.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Users would like PDX to JDBC connector
> --------------------------------------
>
>                 Key: GEODE-3781
>                 URL: https://issues.apache.org/jira/browse/GEODE-3781
>             Project: Geode
>          Issue Type: Wish
>          Components: docs, regions
>            Reporter: Fred Krone
>            Assignee: Kirk Lund
>
> Users would like easy inline caching
> This is the epic for the inline caching improvements -- write behind, write 
> through, read through.
> The goal is here to allow users easy mapping of region to table.  Either the 
> user can provide a simple field to column config file and it is injected at 
> runtime (more flexible) or we use a simple name to name mapping with no 
> configuration needed.  
> Feedback 1: "people don't like the idea of every team writing the same kind 
> of write behind logic again and again"
> Feedback 2: "I write a lot of boiler plate code over and over again for this 
> very thing"



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to