@@ -53,21 +53,23 @@ import org.onebusaway.client.okhttp.OnebusawaySdkOkHttpClient;
5353import org.onebusaway.models.currenttime.CurrentTimeRetrieveParams ;
5454import org.onebusaway.models.currenttime.CurrentTimeRetrieveResponse ;
5555
56- // Configures using the `ONEBUSAWAY_API_KEY` and `ONEBUSAWAY_SDK_BASE_URL` environment variables
56+ // Configures using the `onebusawaysdk.onebusawayApiKey` and `onebusawaysdk.baseUrl` system properties
57+ // Or configures using the `ONEBUSAWAY_API_KEY` and `ONEBUSAWAY_SDK_BASE_URL` environment variables
5758OnebusawaySdkClient client = OnebusawaySdkOkHttpClient . fromEnv();
5859
5960CurrentTimeRetrieveResponse currentTime = client. currentTime(). retrieve();
6061```
6162
6263## Client configuration
6364
64- Configure the client using environment variables:
65+ Configure the client using system properties or environment variables:
6566
6667``` java
6768import org.onebusaway.client.OnebusawaySdkClient ;
6869import org.onebusaway.client.okhttp.OnebusawaySdkOkHttpClient ;
6970
70- // Configures using the `ONEBUSAWAY_API_KEY` and `ONEBUSAWAY_SDK_BASE_URL` environment variables
71+ // Configures using the `onebusawaysdk.onebusawayApiKey` and `onebusawaysdk.baseUrl` system properties
72+ // Or configures using the `ONEBUSAWAY_API_KEY` and `ONEBUSAWAY_SDK_BASE_URL` environment variables
7173OnebusawaySdkClient client = OnebusawaySdkOkHttpClient . fromEnv();
7274```
7375
@@ -89,18 +91,21 @@ import org.onebusaway.client.OnebusawaySdkClient;
8991import org.onebusaway.client.okhttp.OnebusawaySdkOkHttpClient ;
9092
9193OnebusawaySdkClient client = OnebusawaySdkOkHttpClient . builder()
92- // Configures using the `ONEBUSAWAY_API_KEY` and `ONEBUSAWAY_SDK_BASE_URL` environment variables
94+ // Configures using the `onebusawaysdk.onebusawayApiKey` and `onebusawaysdk.baseUrl` system properties
95+ Or configures using the `ONEBUSAWAY_API_KEY ` and `ONEBUSAWAY_SDK_BASE_URL ` environment variables
9396 .fromEnv()
9497 .apiKey(" My API Key" )
9598 .build();
9699```
97100
98101See this table for the available options:
99102
100- | Setter | Environment variable | Required | Default value |
101- | --------- | ------------------------- | -------- | ----------------------------------------- |
102- | ` apiKey ` | ` ONEBUSAWAY_API_KEY ` | true | - |
103- | ` baseUrl ` | ` ONEBUSAWAY_SDK_BASE_URL ` | true | ` "https://api.pugetsound.onebusaway.org" ` |
103+ | Setter | System property | Environment variable | Required | Default value |
104+ | --------- | -------------------------------- | ------------------------- | -------- | ----------------------------------------- |
105+ | ` apiKey ` | ` onebusawaysdk.onebusawayApiKey ` | ` ONEBUSAWAY_API_KEY ` | true | - |
106+ | ` baseUrl ` | ` onebusawaysdk.baseUrl ` | ` ONEBUSAWAY_SDK_BASE_URL ` | true | ` "https://api.pugetsound.onebusaway.org" ` |
107+
108+ System properties take precedence over environment variables.
104109
105110> [ !TIP]
106111> Don't create more than one client in the same application. Each client has a connection pool and
@@ -146,7 +151,8 @@ import org.onebusaway.client.okhttp.OnebusawaySdkOkHttpClient;
146151import org.onebusaway.models.currenttime.CurrentTimeRetrieveParams ;
147152import org.onebusaway.models.currenttime.CurrentTimeRetrieveResponse ;
148153
149- // Configures using the `ONEBUSAWAY_API_KEY` and `ONEBUSAWAY_SDK_BASE_URL` environment variables
154+ // Configures using the `onebusawaysdk.onebusawayApiKey` and `onebusawaysdk.baseUrl` system properties
155+ // Or configures using the `ONEBUSAWAY_API_KEY` and `ONEBUSAWAY_SDK_BASE_URL` environment variables
150156OnebusawaySdkClient client = OnebusawaySdkOkHttpClient . fromEnv();
151157
152158CompletableFuture<CurrentTimeRetrieveResponse > currentTime = client. async(). currentTime(). retrieve();
@@ -161,7 +167,8 @@ import org.onebusaway.client.okhttp.OnebusawaySdkOkHttpClientAsync;
161167import org.onebusaway.models.currenttime.CurrentTimeRetrieveParams ;
162168import org.onebusaway.models.currenttime.CurrentTimeRetrieveResponse ;
163169
164- // Configures using the `ONEBUSAWAY_API_KEY` and `ONEBUSAWAY_SDK_BASE_URL` environment variables
170+ // Configures using the `onebusawaysdk.onebusawayApiKey` and `onebusawaysdk.baseUrl` system properties
171+ // Or configures using the `ONEBUSAWAY_API_KEY` and `ONEBUSAWAY_SDK_BASE_URL` environment variables
165172OnebusawaySdkClientAsync client = OnebusawaySdkOkHttpClientAsync . fromEnv();
166173
167174CompletableFuture<CurrentTimeRetrieveResponse > currentTime = client. currentTime(). retrieve();
0 commit comments