Skip to content

Commit ca6c050

Browse files
chore: remove legacy multi-endpoint helper methods (#71)
1 parent 94caa67 commit ca6c050

3 files changed

Lines changed: 26 additions & 35 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to the AxonFlow Java SDK will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.1.0] - 2026-02-04
9+
10+
### Changed
11+
12+
- Removed legacy internal endpoint helper methods `getOrchestratorUrl()` and `getPortalUrl()` from `AxonFlow`
13+
- Portal and orchestrator request builders now directly use `config.getEndpoint()`, matching ADR-026 Single Entry Point architecture
14+
815
## [3.0.0] - 2026-02-03
916

1017
### Breaking Changes

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.getaxonflow</groupId>
88
<artifactId>axonflow-sdk</artifactId>
9-
<version>3.0.0</version>
9+
<version>3.1.0</version>
1010
<packaging>jar</packaging>
1111

1212
<name>AxonFlow Java SDK</name>

src/main/java/com/getaxonflow/sdk/AxonFlow.java

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,7 +2111,7 @@ public PortalLoginResponse loginToPortal(String orgId, String password) throws I
21112111
RequestBody body = RequestBody.create(json, JSON);
21122112

21132113
Request request = new Request.Builder()
2114-
.url(getPortalUrl() + "/api/v1/auth/login")
2114+
.url(config.getEndpoint() + "/api/v1/auth/login")
21152115
.post(body)
21162116
.header("Content-Type", "application/json")
21172117
.build();
@@ -2153,7 +2153,7 @@ public void logoutFromPortal() {
21532153

21542154
try {
21552155
Request request = new Request.Builder()
2156-
.url(getPortalUrl() + "/api/v1/auth/logout")
2156+
.url(config.getEndpoint() + "/api/v1/auth/logout")
21572157
.post(RequestBody.create("", JSON))
21582158
.header("Cookie", "axonflow_session=" + sessionCookie)
21592159
.build();
@@ -2196,7 +2196,7 @@ public ValidateGitProviderResponse validateGitProvider(ValidateGitProviderReques
21962196
RequestBody body = RequestBody.create(json, JSON);
21972197

21982198
Request.Builder builder = new Request.Builder()
2199-
.url(getPortalUrl() + "/api/v1/code-governance/git-providers/validate")
2199+
.url(config.getEndpoint() + "/api/v1/code-governance/git-providers/validate")
22002200
.post(body);
22012201

22022202
addPortalSessionCookie(builder);
@@ -2221,7 +2221,7 @@ public ConfigureGitProviderResponse configureGitProvider(ConfigureGitProviderReq
22212221
RequestBody body = RequestBody.create(json, JSON);
22222222

22232223
Request.Builder builder = new Request.Builder()
2224-
.url(getPortalUrl() + "/api/v1/code-governance/git-providers")
2224+
.url(config.getEndpoint() + "/api/v1/code-governance/git-providers")
22252225
.post(body);
22262226

22272227
addPortalSessionCookie(builder);
@@ -2242,7 +2242,7 @@ public ListGitProvidersResponse listGitProviders() throws IOException {
22422242
logger.debug("Listing Git providers");
22432243

22442244
Request.Builder builder = new Request.Builder()
2245-
.url(getPortalUrl() + "/api/v1/code-governance/git-providers")
2245+
.url(config.getEndpoint() + "/api/v1/code-governance/git-providers")
22462246
.get();
22472247

22482248
addPortalSessionCookie(builder);
@@ -2263,7 +2263,7 @@ public void deleteGitProvider(GitProviderType providerType) throws IOException {
22632263
logger.debug("Deleting Git provider: {}", providerType);
22642264

22652265
Request.Builder builder = new Request.Builder()
2266-
.url(getPortalUrl() + "/api/v1/code-governance/git-providers/" + providerType.getValue())
2266+
.url(config.getEndpoint() + "/api/v1/code-governance/git-providers/" + providerType.getValue())
22672267
.delete();
22682268

22692269
addPortalSessionCookie(builder);
@@ -2288,7 +2288,7 @@ public CreatePRResponse createPR(CreatePRRequest request) throws IOException {
22882288
RequestBody body = RequestBody.create(json, JSON);
22892289

22902290
Request.Builder builder = new Request.Builder()
2291-
.url(getPortalUrl() + "/api/v1/code-governance/prs")
2291+
.url(config.getEndpoint() + "/api/v1/code-governance/prs")
22922292
.post(body);
22932293

22942294
addPortalSessionCookie(builder);
@@ -2309,7 +2309,7 @@ public ListPRsResponse listPRs(ListPRsOptions options) throws IOException {
23092309
requirePortalLogin();
23102310
logger.debug("Listing PRs");
23112311

2312-
StringBuilder url = new StringBuilder(getPortalUrl() + "/api/v1/code-governance/prs");
2312+
StringBuilder url = new StringBuilder(config.getEndpoint() + "/api/v1/code-governance/prs");
23132313
StringBuilder query = new StringBuilder();
23142314

23152315
if (options != null) {
@@ -2361,7 +2361,7 @@ public PRRecord getPR(String prId) throws IOException {
23612361
logger.debug("Getting PR: {}", prId);
23622362

23632363
Request.Builder builder = new Request.Builder()
2364-
.url(getPortalUrl() + "/api/v1/code-governance/prs/" + prId)
2364+
.url(config.getEndpoint() + "/api/v1/code-governance/prs/" + prId)
23652365
.get();
23662366

23672367
addPortalSessionCookie(builder);
@@ -2385,7 +2385,7 @@ public PRRecord syncPRStatus(String prId) throws IOException {
23852385
RequestBody body = RequestBody.create("{}", JSON);
23862386

23872387
Request.Builder builder = new Request.Builder()
2388-
.url(getPortalUrl() + "/api/v1/code-governance/prs/" + prId + "/sync")
2388+
.url(config.getEndpoint() + "/api/v1/code-governance/prs/" + prId + "/sync")
23892389
.post(body);
23902390

23912391
addPortalSessionCookie(builder);
@@ -2409,7 +2409,7 @@ public PRRecord closePR(String prId, boolean deleteBranch) throws IOException {
24092409
requirePortalLogin();
24102410
logger.debug("Closing PR: {} (deleteBranch={})", prId, deleteBranch);
24112411

2412-
String url = getPortalUrl() + "/api/v1/code-governance/prs/" + prId;
2412+
String url = config.getEndpoint() + "/api/v1/code-governance/prs/" + prId;
24132413
if (deleteBranch) {
24142414
url += "?delete_branch=true";
24152415
}
@@ -2436,7 +2436,7 @@ public CodeGovernanceMetrics getCodeGovernanceMetrics() throws IOException {
24362436
logger.debug("Getting code governance metrics");
24372437

24382438
Request.Builder builder = new Request.Builder()
2439-
.url(getPortalUrl() + "/api/v1/code-governance/metrics")
2439+
.url(config.getEndpoint() + "/api/v1/code-governance/metrics")
24402440
.get();
24412441

24422442
addPortalSessionCookie(builder);
@@ -2457,7 +2457,7 @@ public ExportResponse exportCodeGovernanceData(ExportOptions options) throws IOE
24572457
requirePortalLogin();
24582458
logger.debug("Exporting code governance data");
24592459

2460-
StringBuilder url = new StringBuilder(getPortalUrl() + "/api/v1/code-governance/export");
2460+
StringBuilder url = new StringBuilder(config.getEndpoint() + "/api/v1/code-governance/export");
24612461
StringBuilder query = new StringBuilder();
24622462

24632463
if (options != null) {
@@ -2501,7 +2501,7 @@ public String exportCodeGovernanceDataCSV(ExportOptions options) throws IOExcept
25012501
requirePortalLogin();
25022502
logger.debug("Exporting code governance data as CSV");
25032503

2504-
StringBuilder url = new StringBuilder(getPortalUrl() + "/api/v1/code-governance/export");
2504+
StringBuilder url = new StringBuilder(config.getEndpoint() + "/api/v1/code-governance/export");
25052505
StringBuilder query = new StringBuilder();
25062506

25072507
appendQueryParam(query, "format", "csv");
@@ -2539,21 +2539,13 @@ public String exportCodeGovernanceDataCSV(ExportOptions options) throws IOExcept
25392539
// Execution Replay API
25402540
// ========================================================================
25412541

2542-
/**
2543-
* Gets the endpoint URL for API requests.
2544-
* All routes now go through a single endpoint (ADR-026 Single Entry Point).
2545-
*/
2546-
private String getOrchestratorUrl() {
2547-
return config.getEndpoint();
2548-
}
2549-
25502542
/**
25512543
* Builds a request for the orchestrator API.
25522544
*/
25532545
private Request buildOrchestratorRequest(String method, String path, Object body) {
2554-
HttpUrl url = HttpUrl.parse(getOrchestratorUrl() + path);
2546+
HttpUrl url = HttpUrl.parse(config.getEndpoint() + path);
25552547
if (url == null) {
2556-
throw new ConfigurationException("Invalid URL: " + getOrchestratorUrl() + path);
2548+
throw new ConfigurationException("Invalid URL: " + config.getEndpoint() + path);
25572549
}
25582550

25592551
Request.Builder builder = new Request.Builder()
@@ -2597,14 +2589,6 @@ private Request buildOrchestratorRequest(String method, String path, Object body
25972589
return builder.build();
25982590
}
25992591

2600-
/**
2601-
* Gets the endpoint URL for portal API requests.
2602-
* All routes now go through a single endpoint (ADR-026 Single Entry Point).
2603-
*/
2604-
private String getPortalUrl() {
2605-
return config.getEndpoint();
2606-
}
2607-
26082592
/**
26092593
* Requires portal login before making code governance requests.
26102594
*/
@@ -2630,9 +2614,9 @@ private void addPortalSessionCookie(Request.Builder builder) {
26302614
private Request buildPortalRequest(String method, String path, Object body) {
26312615
requirePortalLogin();
26322616

2633-
HttpUrl url = HttpUrl.parse(getPortalUrl() + path);
2617+
HttpUrl url = HttpUrl.parse(config.getEndpoint() + path);
26342618
if (url == null) {
2635-
throw new ConfigurationException("Invalid URL: " + getPortalUrl() + path);
2619+
throw new ConfigurationException("Invalid URL: " + config.getEndpoint() + path);
26362620
}
26372621

26382622
Request.Builder builder = new Request.Builder()

0 commit comments

Comments
 (0)