Skip to content

Commit e24a8ba

Browse files
authored
Merge pull request #72 from conductor-oss/sdk_consolidation
SDK Consolidation across Orkes and oss clients
2 parents edf3b33 + 676e245 commit e24a8ba

290 files changed

Lines changed: 6064 additions & 3936 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ build/
33
.DS_Store
44
.idea/
55
.vscode/
6-
**/out/
6+
**/out/
7+
bin/

conductor-client-spring/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ repositories {
1919

2020
dependencies {
2121
api project(":conductor-client")
22-
api project(":java-sdk")
23-
2422
implementation 'org.springframework.boot:spring-boot-starter:3.3.0'
2523
}
2624

orkes-spring/src/main/java/io/orkes/conductor/client/spring/OrkesClientProperties.java renamed to conductor-client-spring/src/main/java/io/orkes/conductor/client/spring/OrkesClientProperties.java

File renamed without changes.

orkes-spring/src/main/java/io/orkes/conductor/client/spring/OrkesConductorClientAutoConfiguration.java renamed to conductor-client-spring/src/main/java/io/orkes/conductor/client/spring/OrkesConductorClientAutoConfiguration.java

File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
com.netflix.conductor.client.spring.ConductorClientAutoConfiguration
22
com.netflix.conductor.client.spring.ConductorWorkerAutoConfiguration
3+
io.orkes.conductor.client.spring.OrkesConductorClientAutoConfiguration

conductor-client/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies {
2222
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${versions.junit}"
2323

2424
testImplementation 'org.mockito:mockito-inline:5.2.0'
25-
25+
testImplementation 'org.mockito:mockito-core:5.4.0'
2626
testImplementation 'org.spockframework:spock-core:2.3-groovy-3.0'
2727
testImplementation 'org.codehaus.groovy:groovy:3.0.25'
2828
testImplementation 'ch.qos.logback:logback-classic:1.5.6'
Lines changed: 13 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 Conductor Authors.
2+
* Copyright 2026 Conductor Authors.
33
* <p>
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -15,129 +15,35 @@
1515
import java.util.List;
1616
import java.util.Map;
1717

18-
import org.apache.commons.lang3.StringUtils;
18+
import io.orkes.conductor.client.http.ApiException;
1919

20-
import com.netflix.conductor.common.validation.ValidationError;
21-
22-
import lombok.Data;
23-
import lombok.Setter;
24-
25-
@Data
26-
public class ConductorClientException extends RuntimeException {
27-
static boolean initPreferErrOverResponse() {
28-
try {
29-
final String propName = "conductor.client.exception.preferErrOverResponse";
30-
return Boolean.getBoolean(propName);
31-
} catch (SecurityException e) {
32-
return false;
33-
}
34-
}
35-
36-
private final static boolean PREFER_ERR_OVER_RESPONSE = initPreferErrOverResponse();
37-
38-
private int status;
39-
private String instance;
40-
private String code;
41-
@Setter
42-
private boolean retryable;
43-
private List<ValidationError> validationErrors; //List of validation errors. Available when the status code is 400
44-
private Map<String, List<String>> responseHeaders;
45-
private String responseBody;
20+
public class ConductorClientException extends ApiException {
4621

4722
public ConductorClientException(String message) {
4823
super(message);
49-
this.responseBody = message;
5024
}
5125

52-
public ConductorClientException(int statusCode, String message) {
53-
super(message);
54-
this.status = statusCode;
55-
this.responseBody = message;
56-
}
57-
58-
public ConductorClientException(Throwable t) {
59-
super(t.getMessage(), t);
60-
this.responseBody = t.getMessage();
26+
public ConductorClientException(String message, int code, Map<String, List<String>> responseHeaders, String responseBody) {
27+
super(message, code, responseHeaders, responseBody);
6128
}
6229

6330
public ConductorClientException(String message, Throwable t) {
6431
super(message, t);
65-
this.responseBody = message;
66-
}
67-
68-
public ConductorClientException(String message,
69-
int code,
70-
Map<String, List<String>> responseHeaders,
71-
String responseBody) {
72-
this(message, null, code, responseHeaders, responseBody);
73-
}
74-
75-
public ConductorClientException(String message,
76-
Throwable t,
77-
int code,
78-
Map<String, List<String>> responseHeaders) {
79-
this(message, t, code, responseHeaders, message);
80-
}
81-
82-
public ConductorClientException(String message,
83-
Throwable t,
84-
int code,
85-
Map<String, List<String>> responseHeaders,
86-
String responseBody) {
87-
super(message, t);
88-
this.code = String.valueOf(code);
89-
this.status = code;
90-
this.responseHeaders = responseHeaders;
91-
this.responseBody = responseBody;
9232
}
9333

94-
public boolean isClientError() {
95-
return getStatus() > 399 && getStatus() < 499;
34+
public ConductorClientException(String message, Throwable t, int code, Map<String, List<String>> responseHeaders) {
35+
super(message, t, code, responseHeaders);
9636
}
9737

98-
/**
99-
* @return HTTP status code
100-
*/
101-
public int getStatusCode() {
102-
return getStatus();
38+
public ConductorClientException(String message, Throwable t, int code, Map<String, List<String>> responseHeaders, String responseBody) {
39+
super(message, t, code, responseHeaders, responseBody);
10340
}
10441

105-
@Override
106-
public String getMessage() {
107-
if (PREFER_ERR_OVER_RESPONSE) {
108-
return StringUtils.isNotBlank(super.getMessage()) ? super.getMessage() : responseBody;
109-
}
110-
return StringUtils.isNotBlank(responseBody) ? responseBody : super.getMessage();
42+
public ConductorClientException(int statusCode, String message) {
43+
super(statusCode, message);
11144
}
11245

113-
@Override
114-
public String toString() {
115-
StringBuilder builder = new StringBuilder();
116-
builder.append(getClass().getName()).append(": ");
117-
118-
if (getMessage() != null) {
119-
builder.append(getMessage());
120-
}
121-
122-
if (status > 0) {
123-
builder.append(" {status=").append(status);
124-
if (this.code != null) {
125-
builder.append(", code='").append(code).append("'");
126-
}
127-
128-
builder.append(", retryable: ").append(retryable);
129-
}
130-
131-
if (this.instance != null) {
132-
builder.append(", instance: ").append(instance);
133-
}
134-
135-
if (this.validationErrors != null) {
136-
builder.append(", validationErrors: ").append(validationErrors);
137-
}
138-
139-
builder.append("}");
140-
return builder.toString();
46+
public ConductorClientException(Throwable t) {
47+
super(t);
14148
}
142-
14349
}

0 commit comments

Comments
 (0)