From 70600328a922a93f492f55e1c690d5e057b067a2 Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Wed, 7 Sep 2022 23:08:27 -0500 Subject: [PATCH 1/3] add parent constructors --- .../client/http/OrkesTaskClient.java | 23 +++++++++++++++++++ .../client/http/OrkesWorkflowClient.java | 23 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/src/main/java/io/orkes/conductor/client/http/OrkesTaskClient.java b/src/main/java/io/orkes/conductor/client/http/OrkesTaskClient.java index dcd05eb1..b0b6db3f 100644 --- a/src/main/java/io/orkes/conductor/client/http/OrkesTaskClient.java +++ b/src/main/java/io/orkes/conductor/client/http/OrkesTaskClient.java @@ -1,9 +1,32 @@ package io.orkes.conductor.client.http; +import com.netflix.conductor.client.config.ConductorClientConfiguration; import com.netflix.conductor.client.http.TaskClient; +import com.sun.jersey.api.client.ClientHandler; +import com.sun.jersey.api.client.config.ClientConfig; +import com.sun.jersey.api.client.filter.ClientFilter; import io.orkes.conductor.client.http.auth.AuthorizationClientFilter; public class OrkesTaskClient extends TaskClient implements OrkesClient { + public OrkesTaskClient() { + } + + public OrkesTaskClient(ClientConfig config) { + super(config); + } + + public OrkesTaskClient(ClientConfig config, ClientHandler handler) { + super(config, handler); + } + + public OrkesTaskClient(ClientConfig config, ClientHandler handler, ClientFilter... filters) { + super(config, handler, filters); + } + + public OrkesTaskClient(ClientConfig config, ConductorClientConfiguration clientConfiguration, ClientHandler handler, ClientFilter... filters) { + super(config, clientConfiguration, handler, filters); + } + @Override public void withCredentials(String keyId, String secret) { this.client.addFilter(new AuthorizationClientFilter(root, keyId, secret)); diff --git a/src/main/java/io/orkes/conductor/client/http/OrkesWorkflowClient.java b/src/main/java/io/orkes/conductor/client/http/OrkesWorkflowClient.java index 2a0a5c75..f6bd3ba1 100644 --- a/src/main/java/io/orkes/conductor/client/http/OrkesWorkflowClient.java +++ b/src/main/java/io/orkes/conductor/client/http/OrkesWorkflowClient.java @@ -1,9 +1,32 @@ package io.orkes.conductor.client.http; +import com.netflix.conductor.client.config.ConductorClientConfiguration; import com.netflix.conductor.client.http.WorkflowClient; +import com.sun.jersey.api.client.ClientHandler; +import com.sun.jersey.api.client.config.ClientConfig; +import com.sun.jersey.api.client.filter.ClientFilter; import io.orkes.conductor.client.http.auth.AuthorizationClientFilter; public class OrkesWorkflowClient extends WorkflowClient implements OrkesClient { + public OrkesWorkflowClient() { + } + + public OrkesWorkflowClient(ClientConfig config) { + super(config); + } + + public OrkesWorkflowClient(ClientConfig config, ClientHandler handler) { + super(config, handler); + } + + public OrkesWorkflowClient(ClientConfig config, ClientHandler handler, ClientFilter... filters) { + super(config, handler, filters); + } + + public OrkesWorkflowClient(ClientConfig config, ConductorClientConfiguration clientConfiguration, ClientHandler handler, ClientFilter... filters) { + super(config, clientConfiguration, handler, filters); + } + @Override public void withCredentials(String keyId, String secret) { this.client.addFilter(new AuthorizationClientFilter(root, keyId, secret)); From ced770f9eddcc2a4c6d7a634eea45dd52eb52d9a Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Wed, 7 Sep 2022 23:16:01 -0500 Subject: [PATCH 2/3] Create OrkesTaskClientTest.java --- .../client/http/OrkesTaskClientTest.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/test/java/io/orkes/conductor/client/http/OrkesTaskClientTest.java diff --git a/src/test/java/io/orkes/conductor/client/http/OrkesTaskClientTest.java b/src/test/java/io/orkes/conductor/client/http/OrkesTaskClientTest.java new file mode 100644 index 00000000..b532b4f8 --- /dev/null +++ b/src/test/java/io/orkes/conductor/client/http/OrkesTaskClientTest.java @@ -0,0 +1,22 @@ +package io.orkes.conductor.client.http; + +import com.netflix.conductor.client.config.DefaultConductorClientConfiguration; +import com.sun.jersey.api.client.ClientHandlerException; +import com.sun.jersey.api.client.ClientRequest; +import com.sun.jersey.api.client.ClientResponse; +import com.sun.jersey.api.client.config.DefaultClientConfig; +import io.orkes.conductor.client.http.auth.AuthorizationClientFilter; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +class OrkesTaskClientTest { + + @Test + void testConstructor() { + OrkesTaskClient taskClient = new OrkesTaskClient(new DefaultClientConfig(), new DefaultConductorClientConfiguration(), null); + + taskClient.setRootURI("/"); + taskClient.withCredentials("key", "secret"); + } +} \ No newline at end of file From 1962426e6a8ec466ea1640de216c2d1a254fa084 Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Wed, 7 Sep 2022 23:21:18 -0500 Subject: [PATCH 3/3] more clients --- .../client/http/OrkesEventClient.java | 23 +++++++++++++++++++ .../client/http/OrkesMetadataClient.java | 23 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/src/main/java/io/orkes/conductor/client/http/OrkesEventClient.java b/src/main/java/io/orkes/conductor/client/http/OrkesEventClient.java index a1ef8391..e81d9d31 100644 --- a/src/main/java/io/orkes/conductor/client/http/OrkesEventClient.java +++ b/src/main/java/io/orkes/conductor/client/http/OrkesEventClient.java @@ -1,9 +1,32 @@ package io.orkes.conductor.client.http; +import com.netflix.conductor.client.config.ConductorClientConfiguration; import com.netflix.conductor.client.http.EventClient; +import com.sun.jersey.api.client.ClientHandler; +import com.sun.jersey.api.client.config.ClientConfig; +import com.sun.jersey.api.client.filter.ClientFilter; import io.orkes.conductor.client.http.auth.AuthorizationClientFilter; public class OrkesEventClient extends EventClient implements OrkesClient { + public OrkesEventClient() { + } + + public OrkesEventClient(ClientConfig clientConfig) { + super(clientConfig); + } + + public OrkesEventClient(ClientConfig clientConfig, ClientHandler clientHandler) { + super(clientConfig, clientHandler); + } + + public OrkesEventClient(ClientConfig config, ClientHandler handler, ClientFilter... filters) { + super(config, handler, filters); + } + + public OrkesEventClient(ClientConfig config, ConductorClientConfiguration clientConfiguration, ClientHandler handler, ClientFilter... filters) { + super(config, clientConfiguration, handler, filters); + } + @Override public void withCredentials(String keyId, String secret) { this.client.addFilter(new AuthorizationClientFilter(root, keyId, secret)); diff --git a/src/main/java/io/orkes/conductor/client/http/OrkesMetadataClient.java b/src/main/java/io/orkes/conductor/client/http/OrkesMetadataClient.java index 6a386630..7df86d3c 100644 --- a/src/main/java/io/orkes/conductor/client/http/OrkesMetadataClient.java +++ b/src/main/java/io/orkes/conductor/client/http/OrkesMetadataClient.java @@ -1,9 +1,32 @@ package io.orkes.conductor.client.http; +import com.netflix.conductor.client.config.ConductorClientConfiguration; import com.netflix.conductor.client.http.MetadataClient; +import com.sun.jersey.api.client.ClientHandler; +import com.sun.jersey.api.client.config.ClientConfig; +import com.sun.jersey.api.client.filter.ClientFilter; import io.orkes.conductor.client.http.auth.AuthorizationClientFilter; public class OrkesMetadataClient extends MetadataClient implements OrkesClient { + public OrkesMetadataClient() { + } + + public OrkesMetadataClient(ClientConfig clientConfig) { + super(clientConfig); + } + + public OrkesMetadataClient(ClientConfig clientConfig, ClientHandler clientHandler) { + super(clientConfig, clientHandler); + } + + public OrkesMetadataClient(ClientConfig config, ClientHandler handler, ClientFilter... filters) { + super(config, handler, filters); + } + + public OrkesMetadataClient(ClientConfig config, ConductorClientConfiguration clientConfiguration, ClientHandler handler, ClientFilter... filters) { + super(config, clientConfiguration, handler, filters); + } + @Override public void withCredentials(String keyId, String secret) { this.client.addFilter(new AuthorizationClientFilter(root, keyId, secret));