You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2017/05/04 09:58:06 UTC

ignite git commit: Moved JDBC driver property info to top-level.

Repository: ignite
Updated Branches:
  refs/heads/master 7d0cc2c4d -> d70ebff6c


Moved JDBC driver property info to top-level.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d70ebff6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d70ebff6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d70ebff6

Branch: refs/heads/master
Commit: d70ebff6c8d3f6626ca928ab5b89f2f34eba7584
Parents: 7d0cc2c
Author: devozerov <vo...@gridgain.com>
Authored: Thu May 4 12:57:58 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu May 4 12:57:58 2017 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/IgniteJdbcDriver.java     | 69 ++++++++------------
 .../internal/jdbc/JdbcDriverPropertyInfo.java   | 37 +++++++++++
 2 files changed, 63 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d70ebff6/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java b/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java
index 0ee41c0..df4929c 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java
@@ -29,6 +29,7 @@ import java.util.Properties;
 import java.util.logging.Logger;
 import org.apache.ignite.cache.affinity.AffinityKey;
 import org.apache.ignite.internal.jdbc.JdbcConnection;
+import org.apache.ignite.internal.jdbc.JdbcDriverPropertyInfo;
 import org.apache.ignite.logger.java.JavaLogger;
 
 /**
@@ -408,67 +409,67 @@ public class IgniteJdbcDriver implements Driver {
             throw new SQLException("URL is invalid: " + url);
 
         List<DriverPropertyInfo> props = Arrays.<DriverPropertyInfo>asList(
-            new PropertyInfo("Hostname", info.getProperty(PROP_HOST), ""),
-            new PropertyInfo("Port number", info.getProperty(PROP_PORT), ""),
-            new PropertyInfo("Cache name", info.getProperty(PROP_CACHE), ""),
-            new PropertyInfo("Node ID", info.getProperty(PROP_NODE_ID), ""),
-            new PropertyInfo("Local", info.getProperty(PROP_LOCAL), ""),
-            new PropertyInfo("Collocated", info.getProperty(PROP_COLLOCATED), ""),
-            new PropertyInfo("Distributed Joins", info.getProperty(PROP_DISTRIBUTED_JOINS), ""),
-            new PropertyInfo("Transactions Allowed", info.getProperty(PROP_TX_ALLOWED), "")
+            new JdbcDriverPropertyInfo("Hostname", info.getProperty(PROP_HOST), ""),
+            new JdbcDriverPropertyInfo("Port number", info.getProperty(PROP_PORT), ""),
+            new JdbcDriverPropertyInfo("Cache name", info.getProperty(PROP_CACHE), ""),
+            new JdbcDriverPropertyInfo("Node ID", info.getProperty(PROP_NODE_ID), ""),
+            new JdbcDriverPropertyInfo("Local", info.getProperty(PROP_LOCAL), ""),
+            new JdbcDriverPropertyInfo("Collocated", info.getProperty(PROP_COLLOCATED), ""),
+            new JdbcDriverPropertyInfo("Distributed Joins", info.getProperty(PROP_DISTRIBUTED_JOINS), ""),
+            new JdbcDriverPropertyInfo("Transactions Allowed", info.getProperty(PROP_TX_ALLOWED), "")
         );
 
         if (info.getProperty(PROP_CFG) != null)
-            props.add(new PropertyInfo("Configuration path", info.getProperty(PROP_CFG), ""));
+            props.add(new JdbcDriverPropertyInfo("Configuration path", info.getProperty(PROP_CFG), ""));
         else
             props.addAll(Arrays.<DriverPropertyInfo>asList(
-                new PropertyInfo("ignite.client.protocol",
+                new JdbcDriverPropertyInfo("ignite.client.protocol",
                     info.getProperty("ignite.client.protocol", "TCP"),
                     "Communication protocol (TCP or HTTP)."),
-                new PropertyInfo("ignite.client.connectTimeout",
+                new JdbcDriverPropertyInfo("ignite.client.connectTimeout",
                     info.getProperty("ignite.client.connectTimeout", "0"),
                     "Socket connection timeout."),
-                new PropertyInfo("ignite.client.tcp.noDelay",
+                new JdbcDriverPropertyInfo("ignite.client.tcp.noDelay",
                     info.getProperty("ignite.client.tcp.noDelay", "true"),
                     "Flag indicating whether TCP_NODELAY flag should be enabled for outgoing connections."),
-                new PropertyInfo("ignite.client.ssl.enabled",
+                new JdbcDriverPropertyInfo("ignite.client.ssl.enabled",
                     info.getProperty("ignite.client.ssl.enabled", "false"),
                     "Flag indicating that SSL is needed for connection."),
-                new PropertyInfo("ignite.client.ssl.protocol",
+                new JdbcDriverPropertyInfo("ignite.client.ssl.protocol",
                     info.getProperty("ignite.client.ssl.protocol", "TLS"),
                     "SSL protocol."),
-                new PropertyInfo("ignite.client.ssl.key.algorithm",
+                new JdbcDriverPropertyInfo("ignite.client.ssl.key.algorithm",
                     info.getProperty("ignite.client.ssl.key.algorithm", "SunX509"),
                     "Key manager algorithm."),
-                new PropertyInfo("ignite.client.ssl.keystore.location",
+                new JdbcDriverPropertyInfo("ignite.client.ssl.keystore.location",
                     info.getProperty("ignite.client.ssl.keystore.location", ""),
                     "Key store to be used by client to connect with Ignite topology."),
-                new PropertyInfo("ignite.client.ssl.keystore.password",
+                new JdbcDriverPropertyInfo("ignite.client.ssl.keystore.password",
                     info.getProperty("ignite.client.ssl.keystore.password", ""),
                     "Key store password."),
-                new PropertyInfo("ignite.client.ssl.keystore.type",
+                new JdbcDriverPropertyInfo("ignite.client.ssl.keystore.type",
                     info.getProperty("ignite.client.ssl.keystore.type", "jks"),
                     "Key store type."),
-                new PropertyInfo("ignite.client.ssl.truststore.location",
+                new JdbcDriverPropertyInfo("ignite.client.ssl.truststore.location",
                     info.getProperty("ignite.client.ssl.truststore.location", ""),
                     "Trust store to be used by client to connect with Ignite topology."),
-                new PropertyInfo("ignite.client.ssl.keystore.password",
+                new JdbcDriverPropertyInfo("ignite.client.ssl.keystore.password",
                     info.getProperty("ignite.client.ssl.truststore.password", ""),
                     "Trust store password."),
-                new PropertyInfo("ignite.client.ssl.truststore.type",
+                new JdbcDriverPropertyInfo("ignite.client.ssl.truststore.type",
                     info.getProperty("ignite.client.ssl.truststore.type", "jks"),
                     "Trust store type."),
-                new PropertyInfo("ignite.client.credentials",
+                new JdbcDriverPropertyInfo("ignite.client.credentials",
                     info.getProperty("ignite.client.credentials", ""),
                     "Client credentials used in authentication process."),
-                new PropertyInfo("ignite.client.cache.top",
+                new JdbcDriverPropertyInfo("ignite.client.cache.top",
                     info.getProperty("ignite.client.cache.top", "false"),
                     "Flag indicating that topology is cached internally. Cache will be refreshed in the " +
                         "background with interval defined by topologyRefreshFrequency property (see below)."),
-                new PropertyInfo("ignite.client.topology.refresh",
+                new JdbcDriverPropertyInfo("ignite.client.topology.refresh",
                     info.getProperty("ignite.client.topology.refresh", "2000"),
                     "Topology cache refresh frequency (ms)."),
-                new PropertyInfo("ignite.client.idleTimeout",
+                new JdbcDriverPropertyInfo("ignite.client.idleTimeout",
                     info.getProperty("ignite.client.idleTimeout", "30000"),
                     "Maximum amount of time that connection can be idle before it is closed (ms).")
                 )
@@ -607,22 +608,4 @@ public class IgniteJdbcDriver implements Driver {
 
         return true;
     }
-
-    /**
-     * Extension of {@link DriverPropertyInfo} that adds
-     * convenient constructors.
-     */
-    private static class PropertyInfo extends DriverPropertyInfo {
-
-        /**
-         * @param name Name.
-         * @param val Value.
-         * @param desc Description.
-         */
-        private PropertyInfo(String name, String val, String desc) {
-            super(name, val);
-
-            description = desc;
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/d70ebff6/modules/core/src/main/java/org/apache/ignite/internal/jdbc/JdbcDriverPropertyInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/JdbcDriverPropertyInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/JdbcDriverPropertyInfo.java
new file mode 100644
index 0000000..3b58736
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/JdbcDriverPropertyInfo.java
@@ -0,0 +1,37 @@
+/*
+ * 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.ignite.internal.jdbc;
+
+import java.sql.DriverPropertyInfo;
+
+/**
+ * Extension of {@link DriverPropertyInfo} that adds
+ * convenient constructors.
+ */
+public class JdbcDriverPropertyInfo extends DriverPropertyInfo {
+    /**
+     * @param name Name.
+     * @param val Value.
+     * @param desc Description.
+     */
+    public JdbcDriverPropertyInfo(String name, String val, String desc) {
+        super(name, val);
+
+        description = desc;
+    }
+}