This is an automated email from the ASF dual-hosted git repository.

mikexue pushed a commit to branch cloudevents
in repository https://gitbox.apache.org/repos/asf/incubator-eventmesh.git


The following commit(s) were added to refs/heads/cloudevents by this push:
     new 0268792  Java sdk update (#610)
0268792 is described below

commit 02687922eb3b62454b873bbc34fb83419dfbbdc3
Author: mike_xwm <[email protected]>
AuthorDate: Wed Nov 24 17:59:08 2021 +0800

    Java sdk update (#610)
    
    * update java sdk
    
    * fix compile error
    
    * fix sdk error
---
 .../eventmesh/common/protocol/tcp/UserAgent.java   | 68 ++++++++++++++++++++++
 eventmesh-examples/build.gradle                    |  4 ++
 2 files changed, 72 insertions(+)

diff --git 
a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/tcp/UserAgent.java
 
b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/tcp/UserAgent.java
index 701cd62..6ad7a32 100644
--- 
a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/tcp/UserAgent.java
+++ 
b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/tcp/UserAgent.java
@@ -20,6 +20,8 @@ package org.apache.eventmesh.common.protocol.tcp;
 import lombok.Builder;
 import lombok.Data;
 
+import java.util.Objects;
+
 @Data
 @Builder
 public class UserAgent {
@@ -40,4 +42,70 @@ public class UserAgent {
     @Builder.Default
     private int    unack = 0;
 
+    public UserAgent() {
+    }
+
+    public UserAgent(String env, String subsystem, String path, int pid, 
String host, int port, String version,
+                     String username, String password, String idc, String 
producerGroup, String consumerGroup,
+                     String purpose, int unack) {
+        this.env = env;
+        this.subsystem = subsystem;
+        this.path = path;
+        this.pid = pid;
+        this.host = host;
+        this.port = port;
+        this.version = version;
+        this.username = username;
+        this.password = password;
+        this.idc = idc;
+        this.producerGroup = producerGroup;
+        this.consumerGroup = consumerGroup;
+        this.purpose = purpose;
+        this.unack = unack;
+    }
+
+    @Override
+    public String toString() {
+        return String.format(
+            "UserAgent{env='%s'subsystem='%s', path='%s', pid=%d, host='%s', 
port=%d, version='%s', idc='%s', purpose='%s', unack='%d'}",
+            env, subsystem, path, pid, host, port, version, idc, purpose, 
unack);
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        UserAgent userAgent = (UserAgent) o;
+
+        if (pid != userAgent.pid) return false;
+        if (port != userAgent.port) return false;
+        if (unack != userAgent.unack) return false;
+        if (!Objects.equals(subsystem, userAgent.subsystem)) return false;
+        if (!Objects.equals(path, userAgent.path)) return false;
+        if (!Objects.equals(host, userAgent.host)) return false;
+        if (!Objects.equals(purpose, userAgent.purpose)) return false;
+        if (!Objects.equals(version, userAgent.version)) return false;
+        if (!Objects.equals(username, userAgent.username)) return false;
+        if (!Objects.equals(password, userAgent.password)) return false;
+        if (!Objects.equals(env, userAgent.env)) return false;
+        return Objects.equals(idc, userAgent.idc);
+    }
+
+    @Override
+    public int hashCode() {
+        int result = subsystem != null ? subsystem.hashCode() : 0;
+        result = 31 * result + (path != null ? path.hashCode() : 0);
+        result = 31 * result + pid;
+        result = 31 * result + (host != null ? host.hashCode() : 0);
+        result = 31 * result + (purpose != null ? purpose.hashCode() : 0);
+        result = 31 * result + port;
+        result = 31 * result + (version != null ? version.hashCode() : 0);
+        result = 31 * result + (username != null ? username.hashCode() : 0);
+        result = 31 * result + (password != null ? password.hashCode() : 0);
+        result = 31 * result + (idc != null ? idc.hashCode() : 0);
+        result = 31 * result + (env != null ? env.hashCode() : 0);
+        result = 31 * result + unack;
+        return result;
+    }
 }
diff --git a/eventmesh-examples/build.gradle b/eventmesh-examples/build.gradle
index b7b1f65..3cb42bc 100644
--- a/eventmesh-examples/build.gradle
+++ b/eventmesh-examples/build.gradle
@@ -15,6 +15,10 @@
  * limitations under the License.
  */
 
+configurations {
+    implementation.exclude group: 'org.springframework.boot', module: 
'spring-boot-starter-logging'
+}
+
 dependencies {
     implementation project(":eventmesh-sdk-java")
     implementation project(":eventmesh-common")

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to