Skip to content

Commit 95c095e

Browse files
Merge pull request #81 from OneBusAway/release-please--branches--main--changes--next
release: 0.1.0-alpha.25
2 parents d0b09b8 + 714d567 commit 95c095e

File tree

130 files changed

+1904
-239
lines changed

Some content is hidden

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

130 files changed

+1904
-239
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ on:
77
- 'integrated/**'
88
- 'stl-preview-head/**'
99
- 'stl-preview-base/**'
10+
pull_request:
11+
branches-ignore:
12+
- 'stl-preview-head/**'
13+
- 'stl-preview-base/**'
1014

1115
jobs:
1216
lint:
1317
timeout-minutes: 10
1418
name: lint
1519
runs-on: ${{ github.repository == 'stainless-sdks/open-transit-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
20+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
1621

1722
steps:
1823
- uses: actions/checkout@v4
@@ -35,6 +40,7 @@ jobs:
3540
timeout-minutes: 10
3641
name: test
3742
runs-on: ${{ github.repository == 'stainless-sdks/open-transit-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
43+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
3844
steps:
3945
- uses: actions/checkout@v4
4046

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.24"
2+
".": "0.1.0-alpha.25"
33
}

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.1.0-alpha.25 (2025-07-07)
4+
5+
Full Changelog: [v0.1.0-alpha.24...v0.1.0-alpha.25](https://github.com/OneBusAway/java-sdk/compare/v0.1.0-alpha.24...v0.1.0-alpha.25)
6+
7+
### Chores
8+
9+
* **internal:** version bump ([97b8b21](https://github.com/OneBusAway/java-sdk/commit/97b8b21fb686dbf3ec55c42b57a69353a14ee6e8))
10+
311
## 0.1.0-alpha.24 (2025-07-07)
412

513
Full Changelog: [v0.1.0-alpha.23...v0.1.0-alpha.24](https://github.com/OneBusAway/java-sdk/compare/v0.1.0-alpha.23...v0.1.0-alpha.24)

README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<!-- x-release-please-start-version -->
44

5-
[![Maven Central](https://img.shields.io/maven-central/v/org.onebusaway/onebusaway-sdk-java)](https://central.sonatype.com/artifact/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.24)
6-
[![javadoc](https://javadoc.io/badge2/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.24/javadoc.svg)](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.24)
5+
[![Maven Central](https://img.shields.io/maven-central/v/org.onebusaway/onebusaway-sdk-java)](https://central.sonatype.com/artifact/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.25)
6+
[![javadoc](https://javadoc.io/badge2/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.25/javadoc.svg)](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.25)
77

88
<!-- x-release-please-end -->
99

@@ -15,7 +15,7 @@ It is generated with [Stainless](https://www.stainless.com/).
1515

1616
<!-- x-release-please-start-version -->
1717

18-
The REST API documentation can be found on [developer.onebusaway.org](https://developer.onebusaway.org). Javadocs are available on [javadoc.io](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.24).
18+
The REST API documentation can be found on [developer.onebusaway.org](https://developer.onebusaway.org). Javadocs are available on [javadoc.io](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.25).
1919

2020
<!-- x-release-please-end -->
2121

@@ -26,7 +26,7 @@ The REST API documentation can be found on [developer.onebusaway.org](https://de
2626
### Gradle
2727

2828
```kotlin
29-
implementation("org.onebusaway:onebusaway-sdk-java:0.1.0-alpha.24")
29+
implementation("org.onebusaway:onebusaway-sdk-java:0.1.0-alpha.25")
3030
```
3131

3232
### Maven
@@ -35,7 +35,7 @@ implementation("org.onebusaway:onebusaway-sdk-java:0.1.0-alpha.24")
3535
<dependency>
3636
<groupId>org.onebusaway</groupId>
3737
<artifactId>onebusaway-sdk-java</artifactId>
38-
<version>0.1.0-alpha.24</version>
38+
<version>0.1.0-alpha.25</version>
3939
</dependency>
4040
```
4141

@@ -106,6 +106,21 @@ See this table for the available options:
106106
> Don't create more than one client in the same application. Each client has a connection pool and
107107
> thread pools, which are more efficient to share between requests.
108108
109+
### Modifying configuration
110+
111+
To temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:
112+
113+
```java
114+
import org.onebusaway.client.OnebusawaySdkClient;
115+
116+
OnebusawaySdkClient clientWithOptions = client.withOptions(optionsBuilder -> {
117+
optionsBuilder.baseUrl("https://example.com");
118+
optionsBuilder.maxRetries(42);
119+
});
120+
```
121+
122+
The `withOptions()` method does not affect the original client or service.
123+
109124
## Requests and responses
110125

111126
To send a request to the Onebusaway SDK API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class.

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ before making any information public.
1616
## Reporting Non-SDK Related Security Issues
1717

1818
If you encounter security issues that are not directly related to SDKs but pertain to the services
19-
or products provided by Onebusaway SDK please follow the respective company's security reporting guidelines.
19+
or products provided by Onebusaway SDK, please follow the respective company's security reporting guidelines.
2020

2121
### Onebusaway SDK Terms and Policies
2222

23-
Please contact [email protected] for any questions or concerns regarding security of our services.
23+
Please contact [email protected] for any questions or concerns regarding the security of our services.
2424

2525
---
2626

bin/check-release-environment

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
errors=()
44

55
if [ -z "${SONATYPE_USERNAME}" ]; then
6-
errors+=("The ONEBUSAWAY_SDK_SONATYPE_USERNAME secret has not been set. Please set it in either this repository's secrets or your organization secrets")
6+
errors+=("The SONATYPE_USERNAME secret has not been set. Please set it in either this repository's secrets or your organization secrets")
77
fi
88

99
if [ -z "${SONATYPE_PASSWORD}" ]; then
10-
errors+=("The ONEBUSAWAY_SDK_SONATYPE_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets")
10+
errors+=("The SONATYPE_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets")
1111
fi
1212

1313
if [ -z "${GPG_SIGNING_KEY}" ]; then
14-
errors+=("The ONEBUSAWAY_SDK_SONATYPE_GPG_SIGNING_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets")
14+
errors+=("The GPG_SIGNING_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets")
1515
fi
1616

1717
if [ -z "${GPG_SIGNING_PASSWORD}" ]; then
18-
errors+=("The ONEBUSAWAY_SDK_SONATYPE_GPG_SIGNING_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets")
18+
errors+=("The GPG_SIGNING_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets")
1919
fi
2020

2121
lenErrors=${#errors[@]}

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repositories {
88

99
allprojects {
1010
group = "org.onebusaway"
11-
version = "0.1.0-alpha.24" // x-release-please-version
11+
version = "0.1.0-alpha.25" // x-release-please-version
1212
}
1313

1414
subprojects {

onebusaway-sdk-java-client-okhttp/src/main/kotlin/org/onebusaway/client/okhttp/OkHttpClient.kt

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import java.time.Duration
77
import java.util.concurrent.CompletableFuture
88
import okhttp3.Call
99
import okhttp3.Callback
10-
import okhttp3.HttpUrl
1110
import okhttp3.HttpUrl.Companion.toHttpUrl
1211
import okhttp3.Interceptor
1312
import okhttp3.MediaType
@@ -20,7 +19,6 @@ import okhttp3.logging.HttpLoggingInterceptor
2019
import okio.BufferedSink
2120
import org.onebusaway.core.RequestOptions
2221
import org.onebusaway.core.Timeout
23-
import org.onebusaway.core.checkRequired
2422
import org.onebusaway.core.http.Headers
2523
import org.onebusaway.core.http.HttpClient
2624
import org.onebusaway.core.http.HttpMethod
@@ -29,8 +27,7 @@ import org.onebusaway.core.http.HttpRequestBody
2927
import org.onebusaway.core.http.HttpResponse
3028
import org.onebusaway.errors.OnebusawaySdkIoException
3129

32-
class OkHttpClient
33-
private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val baseUrl: HttpUrl) :
30+
class OkHttpClient private constructor(private val okHttpClient: okhttp3.OkHttpClient) :
3431
HttpClient {
3532

3633
override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse {
@@ -142,11 +139,7 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
142139
}
143140

144141
private fun HttpRequest.toUrl(): String {
145-
url?.let {
146-
return it
147-
}
148-
149-
val builder = baseUrl.newBuilder()
142+
val builder = baseUrl.toHttpUrl().newBuilder()
150143
pathSegments.forEach(builder::addPathSegment)
151144
queryParams.keys().forEach { key ->
152145
queryParams.values(key).forEach { builder.addQueryParameter(key, it) }
@@ -196,12 +189,9 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
196189

197190
class Builder internal constructor() {
198191

199-
private var baseUrl: HttpUrl? = null
200192
private var timeout: Timeout = Timeout.default()
201193
private var proxy: Proxy? = null
202194

203-
fun baseUrl(baseUrl: String) = apply { this.baseUrl = baseUrl.toHttpUrl() }
204-
205195
fun timeout(timeout: Timeout) = apply { this.timeout = timeout }
206196

207197
fun timeout(timeout: Duration) = timeout(Timeout.builder().request(timeout).build())
@@ -216,8 +206,12 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
216206
.writeTimeout(timeout.write())
217207
.callTimeout(timeout.request())
218208
.proxy(proxy)
219-
.build(),
220-
checkRequired("baseUrl", baseUrl),
209+
.build()
210+
.apply {
211+
// We usually make all our requests to the same host so it makes sense to
212+
// raise the per-host limit to the overall limit.
213+
dispatcher.maxRequestsPerHost = dispatcher.maxRequests
214+
}
221215
)
222216
}
223217
}

onebusaway-sdk-java-client-okhttp/src/main/kotlin/org/onebusaway/client/okhttp/OnebusawaySdkOkHttpClient.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,7 @@ class OnebusawaySdkOkHttpClient private constructor() {
163163
fun build(): OnebusawaySdkClient =
164164
OnebusawaySdkClientImpl(
165165
clientOptions
166-
.httpClient(
167-
OkHttpClient.builder()
168-
.baseUrl(clientOptions.baseUrl())
169-
.timeout(timeout)
170-
.proxy(proxy)
171-
.build()
172-
)
166+
.httpClient(OkHttpClient.builder().timeout(timeout).proxy(proxy).build())
173167
.build()
174168
)
175169
}

onebusaway-sdk-java-client-okhttp/src/main/kotlin/org/onebusaway/client/okhttp/OnebusawaySdkOkHttpClientAsync.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,7 @@ class OnebusawaySdkOkHttpClientAsync private constructor() {
164164
fun build(): OnebusawaySdkClientAsync =
165165
OnebusawaySdkClientAsyncImpl(
166166
clientOptions
167-
.httpClient(
168-
OkHttpClient.builder()
169-
.baseUrl(clientOptions.baseUrl())
170-
.timeout(timeout)
171-
.proxy(proxy)
172-
.build()
173-
)
167+
.httpClient(OkHttpClient.builder().timeout(timeout).proxy(proxy).build())
174168
.build()
175169
)
176170
}

0 commit comments

Comments
 (0)