PakhomovAlexander commented on code in PR #1632:
URL: https://github.com/apache/ignite-3/pull/1632#discussion_r1098432047


##########
modules/network/src/main/java/org/apache/ignite/internal/network/configuration/KeyStoreType.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * 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.network.configuration;
+
+import java.util.Arrays;
+import org.jetbrains.annotations.Nullable;
+
+/** Supported key store types. */
+public enum KeyStoreType {
+    JKS, PKCS12;
+
+    /** Parses key store type from a provided string.

Review Comment:
   I think the java doc is formatted in the wrong way.



##########
modules/api/src/main/java/org/apache/ignite/network/NodeMetadata.java:
##########
@@ -28,35 +28,54 @@ public class NodeMetadata implements Serializable {
 
     private final String restHost;
 
-    private final int restPort;
+    private final int httpPort;
 
-    public NodeMetadata(String restHost, int restPort) {
+    private final int httpsPort;
+
+    /** Constructor. */
+    public NodeMetadata(String restHost, int httpPort, int httpsPort) {
         this.restHost = restHost;
-        this.restPort = restPort;
+        this.httpPort = httpPort;
+        this.httpsPort = httpsPort;
     }
 
     public String restHost() {
         return restHost;
     }
 
-    public int restPort() {
-        return restPort;
+    public int httpPort() {
+        return httpPort;
+    }
+
+    public int httpsPort() {
+        return httpsPort;
     }
 
     @Override
     public boolean equals(Object o) {
         if (this == o) {
             return true;
         }
-        if (!(o instanceof NodeMetadata)) {
+        if (o == null || getClass() != o.getClass()) {
             return false;
         }
+
         NodeMetadata that = (NodeMetadata) o;
-        return restPort == that.restPort && Objects.equals(restHost, 
that.restHost);
+
+        if (httpPort != that.httpPort) {
+            return false;
+        }
+        if (httpsPort != that.httpsPort) {
+            return false;
+        }
+        return restHost != null ? restHost.equals(that.restHost) : 
that.restHost == null;
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(restHost, restPort);
+        int result = restHost != null ? restHost.hashCode() : 0;
+        result = 31 * result + httpPort;
+        result = 31 * result + httpsPort;
+        return result;

Review Comment:
   Any reason to use such a hash code method?



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to