desruisseaux commented on code in PR #40:
URL: https://github.com/apache/sis/pull/40#discussion_r2792542032


##########
endorsed/src/org.apache.sis.cloud.aws/main/org/apache/sis/cloud/aws/s3/ClientFileSystemKey.java:
##########
@@ -0,0 +1,111 @@
+package org.apache.sis.cloud.aws.s3;
+
+import java.util.Objects;
+
+/**
+ * File System Key stored in {@link FileService#fileSystems},
+ *
+ * @author  Quentin Bialota (Geomatys)
+ */
+public class ClientFileSystemKey {
+
+    /**
+     * The S3 access key
+     */
+    private final String accessKey;
+
+    /**
+     * The S3 host (if not stored on Amazon AWS Infrastructure)
+     */
+    private final String host;
+
+    /**
+     * The S3 port (if not stored on Amazon AWS Infrastructure)
+     */
+    private final Integer port;
+
+    /**
+     * Is the S3 HTTP Protocol secure (if not stored on Amazon AWS 
Infrastructure)
+     */
+    private final boolean isHttps;
+
+    /**
+     * Creates a new file system key for the {@link FileService} with access 
key, host, port and protocol (secure or not secure)
+     *
+     * @param accessKey   the S3 access key for this file system.
+     * @param host        the host or {@code null} for aws request
+     * @param port        the port or {@code -1} for aws request
+     * @param isHttps     the protocol is secure or not
+     */
+    public ClientFileSystemKey(String accessKey, String host, Integer port, 
boolean isHttps) {
+        this.accessKey = accessKey;
+        this.host = host;
+        this.port = port;
+        this.isHttps = isHttps;
+    }
+
+    /**
+     * Creates a new file system key for the {@link FileService} with access 
key, host and port
+     * (protocol used defined as secure (HTTPS))
+     *
+     * @param accessKey   the S3 access key for this file system.
+     * @param host        the host or {@code null} for aws request
+     * @param port        the port or {@code -1} for aws request
+     */
+    public ClientFileSystemKey(String accessKey, String host, Integer port) {
+        this.accessKey = accessKey;
+        this.host = host;
+        this.port = port;
+        this.isHttps = true;
+    }
+
+    /**
+     * Returns the access key as a string
+     */
+    public String getAccessKey() {

Review Comment:
   Accessor are good practices for public API, but not really needed for 
internal API, especially when the fields are final anyway. We could omit those 
accessors, make the fields package-private and access the mdirectly.



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