2929 * <p>Use the builder to create a configuration:
3030 * <pre>{@code
3131 * AxonFlowConfig config = AxonFlowConfig.builder()
32- * .agentUrl ("http://localhost:8080")
32+ * .endpoint ("http://localhost:8080")
3333 * .clientId("my-client")
3434 * .clientSecret("my-secret")
3535 * .build();
@@ -45,12 +45,10 @@ public final class AxonFlowConfig {
4545 /** Default timeout for HTTP requests. */
4646 public static final Duration DEFAULT_TIMEOUT = Duration .ofSeconds (60 );
4747
48- /** Default Agent URL. */
49- public static final String DEFAULT_AGENT_URL = "http://localhost:8080" ;
48+ /** Default endpoint URL. */
49+ public static final String DEFAULT_ENDPOINT = "http://localhost:8080" ;
5050
51- private final String agentUrl ;
52- private final String orchestratorUrl ;
53- private final String portalUrl ;
51+ private final String endpoint ;
5452 private final String clientId ;
5553 private final String clientSecret ;
5654 private final String licenseKey ;
@@ -63,9 +61,7 @@ public final class AxonFlowConfig {
6361 private final String userAgent ;
6462
6563 private AxonFlowConfig (Builder builder ) {
66- this .agentUrl = normalizeUrl (builder .agentUrl != null ? builder .agentUrl : DEFAULT_AGENT_URL );
67- this .orchestratorUrl = normalizeUrl (builder .orchestratorUrl );
68- this .portalUrl = normalizeUrl (builder .portalUrl );
64+ this .endpoint = normalizeUrl (builder .endpoint != null ? builder .endpoint : DEFAULT_ENDPOINT );
6965 this .clientId = builder .clientId ;
7066 this .clientSecret = builder .clientSecret ;
7167 this .licenseKey = builder .licenseKey ;
@@ -81,8 +77,8 @@ private AxonFlowConfig(Builder builder) {
8177 }
8278
8379 private void validate () {
84- if (agentUrl == null || agentUrl .isEmpty ()) {
85- throw new ConfigurationException ("agentUrl is required" , "agentUrl " );
80+ if (endpoint == null || endpoint .isEmpty ()) {
81+ throw new ConfigurationException ("endpoint is required" , "endpoint " );
8682 }
8783 // Credentials are optional for community/self-hosted deployments
8884 // Enterprise features require credentials (validated at method call time)
@@ -106,15 +102,15 @@ private String normalizeUrl(String url) {
106102 }
107103
108104 /**
109- * Checks if the configured agent URL is localhost.
105+ * Checks if the configured endpoint is localhost.
110106 *
111107 * @return true if connecting to localhost
112108 */
113109 public boolean isLocalhost () {
114- return agentUrl != null && (
115- agentUrl .contains ("localhost" ) ||
116- agentUrl .contains ("127.0.0.1" ) ||
117- agentUrl .contains ("[::1]" )
110+ return endpoint != null && (
111+ endpoint .contains ("localhost" ) ||
112+ endpoint .contains ("127.0.0.1" ) ||
113+ endpoint .contains ("[::1]" )
118114 );
119115 }
120116
@@ -123,7 +119,7 @@ public boolean isLocalhost() {
123119 *
124120 * <p>Supported environment variables:
125121 * <ul>
126- * <li>AXONFLOW_AGENT_URL - The Agent URL</li>
122+ * <li>AXONFLOW_AGENT_URL - The endpoint URL (kept for backwards compatibility) </li>
127123 * <li>AXONFLOW_CLIENT_ID - The client ID</li>
128124 * <li>AXONFLOW_CLIENT_SECRET - The client secret</li>
129125 * <li>AXONFLOW_LICENSE_KEY - The license key</li>
@@ -137,9 +133,10 @@ public boolean isLocalhost() {
137133 public static AxonFlowConfig fromEnvironment () {
138134 Builder builder = builder ();
139135
140- String agentUrl = System .getenv ("AXONFLOW_AGENT_URL" );
141- if (agentUrl != null && !agentUrl .isEmpty ()) {
142- builder .agentUrl (agentUrl );
136+ // Keep AXONFLOW_AGENT_URL for backwards compatibility, map to endpoint
137+ String endpoint = System .getenv ("AXONFLOW_AGENT_URL" );
138+ if (endpoint != null && !endpoint .isEmpty ()) {
139+ builder .endpoint (endpoint );
143140 }
144141
145142 String clientId = System .getenv ("AXONFLOW_CLIENT_ID" );
@@ -179,16 +176,8 @@ public static AxonFlowConfig fromEnvironment() {
179176 return builder .build ();
180177 }
181178
182- public String getAgentUrl () {
183- return agentUrl ;
184- }
185-
186- public String getOrchestratorUrl () {
187- return orchestratorUrl ;
188- }
189-
190- public String getPortalUrl () {
191- return portalUrl ;
179+ public String getEndpoint () {
180+ return endpoint ;
192181 }
193182
194183 public String getClientId () {
@@ -242,21 +231,21 @@ public boolean equals(Object o) {
242231 AxonFlowConfig that = (AxonFlowConfig ) o ;
243232 return debug == that .debug &&
244233 insecureSkipVerify == that .insecureSkipVerify &&
245- Objects .equals (agentUrl , that .agentUrl ) &&
234+ Objects .equals (endpoint , that .endpoint ) &&
246235 Objects .equals (clientId , that .clientId ) &&
247236 Objects .equals (licenseKey , that .licenseKey ) &&
248237 mode == that .mode ;
249238 }
250239
251240 @ Override
252241 public int hashCode () {
253- return Objects .hash (agentUrl , clientId , licenseKey , mode , debug , insecureSkipVerify );
242+ return Objects .hash (endpoint , clientId , licenseKey , mode , debug , insecureSkipVerify );
254243 }
255244
256245 @ Override
257246 public String toString () {
258247 return "AxonFlowConfig{" +
259- "agentUrl ='" + agentUrl + '\'' +
248+ "endpoint ='" + endpoint + '\'' +
260249 ", clientId='" + clientId + '\'' +
261250 ", mode=" + mode +
262251 ", timeout=" + timeout +
@@ -268,9 +257,7 @@ public String toString() {
268257 * Builder for AxonFlowConfig.
269258 */
270259 public static final class Builder {
271- private String agentUrl ;
272- private String orchestratorUrl ;
273- private String portalUrl ;
260+ private String endpoint ;
274261 private String clientId ;
275262 private String clientSecret ;
276263 private String licenseKey ;
@@ -285,41 +272,32 @@ public static final class Builder {
285272 private Builder () {}
286273
287274 /**
288- * Sets the AxonFlow Agent URL.
275+ * Sets the AxonFlow endpoint URL.
276+ * All routes now go through a single endpoint (ADR-026 Single Entry Point).
289277 *
290- * @param agentUrl the Agent URL
278+ * @param endpoint the endpoint URL
291279 * @return this builder
292280 */
293- public Builder agentUrl (String agentUrl ) {
294- this .agentUrl = agentUrl ;
281+ public Builder endpoint (String endpoint ) {
282+ this .endpoint = endpoint ;
295283 return this ;
296284 }
297285
298286 /**
299- * Sets the Orchestrator URL for Execution Replay API.
300- *
301- * <p>If not set, defaults to the Agent URL with port 8081.
287+ * Sets the AxonFlow Agent URL.
288+ * @deprecated Use {@link #endpoint(String)} instead. This method is kept for backwards compatibility.
302289 *
303- * @param orchestratorUrl the Orchestrator URL
290+ * @param agentUrl the Agent URL
304291 * @return this builder
305292 */
306- public Builder orchestratorUrl (String orchestratorUrl ) {
307- this .orchestratorUrl = orchestratorUrl ;
293+ @ Deprecated
294+ public Builder agentUrl (String agentUrl ) {
295+ this .endpoint = agentUrl ;
308296 return this ;
309297 }
310298
311- /**
312- * Sets the Customer Portal URL for enterprise PR workflow features.
313- *
314- * <p>If not set, defaults to the Agent URL with port 8082.
315- *
316- * @param portalUrl the Customer Portal URL
317- * @return this builder
318- */
319- public Builder portalUrl (String portalUrl ) {
320- this .portalUrl = portalUrl ;
321- return this ;
322- }
299+ // Note: portalUrl() and orchestratorUrl() methods were removed in v2.0.0
300+ // All routes now go through a single endpoint (ADR-026 Single Entry Point)
323301
324302 /**
325303 * Sets the client ID for authentication.
0 commit comments