Skip to content

Commit

Permalink
Merge pull request #11 from orkes-io/call_super
Browse files Browse the repository at this point in the history
Call super
  • Loading branch information
v1r3n authored Sep 8, 2022
2 parents 8ea8c37 + 1962426 commit 60990c2
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/main/java/io/orkes/conductor/client/http/OrkesEventClient.java
Original file line number Diff line number Diff line change
@@ -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));
Expand Down
Original file line number Diff line number Diff line change
@@ -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));
Expand Down
23 changes: 23 additions & 0 deletions src/main/java/io/orkes/conductor/client/http/OrkesTaskClient.java
Original file line number Diff line number Diff line change
@@ -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));
Expand Down
Original file line number Diff line number Diff line change
@@ -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));
Expand Down
Original file line number Diff line number Diff line change
@@ -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");
}
}

0 comments on commit 60990c2

Please sign in to comment.