Skip to content

Commit

Permalink
Merge branch 'release/1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
vegegoku committed Dec 10, 2023
2 parents def37d3 + 0b46144 commit 07040d0
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion domino-rest-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>domino-rest</artifactId>
<groupId>org.dominokit</groupId>
<version>1.0.1</version>
<version>1.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion domino-rest-jaxrs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.dominokit</groupId>
<artifactId>domino-rest</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>
</parent>

<artifactId>domino-rest-jaxrs</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion domino-rest-jvm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>domino-rest</artifactId>
<groupId>org.dominokit</groupId>
<version>1.0.1</version>
<version>1.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion domino-rest-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>domino-rest</artifactId>
<groupId>org.dominokit</groupId>
<version>1.0.1</version>
<version>1.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion domino-rest-shared/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>domino-rest</artifactId>
<groupId>org.dominokit</groupId>
<version>1.0.1</version>
<version>1.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.dominokit.rest.shared.request;

import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;

import java.util.Arrays;
Expand Down Expand Up @@ -119,14 +120,28 @@ private void handleResponse(
if (Arrays.stream(request.getSuccessCodes())
.anyMatch(code -> code.equals(response.getStatusCode()))) {
callSuccessGlobalHandlers(request, response);
callBack.onSuccess(request.getResponseReader().read(response));
callBack.onSuccess(readResponse(request, response));
} else {
FailedResponseBean failedResponse = new FailedResponseBean(request, response);
callFailedResponseHandlers(request, failedResponse);
callBack.onFailure(failedResponse);
}
}

private <R, S> S readResponse(ServerRequest<R, S> request, Response response) {
int statusCode = response.getStatusCode();
switch (statusCode) {
case 204:
{
if (isNull(response.getBodyAsString()) || response.getBodyAsString().isEmpty()) {
return null;
}
}
default:
return request.getResponseReader().read(response);
}
}

private void callSuccessGlobalHandlers(ServerRequest<R, S> request, Response response) {
DominoRestContext.make()
.getConfig()
Expand Down
2 changes: 1 addition & 1 deletion domino-rest-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>domino-rest</artifactId>
<groupId>org.dominokit</groupId>
<version>1.0.1</version>
<version>1.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.dominokit</groupId>
<artifactId>domino-rest</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>
<packaging>pom</packaging>

<name>domino-rest</name>
Expand Down Expand Up @@ -70,7 +70,7 @@

<properties>
<snapshot.version>HEAD-SNAPSHOT</snapshot.version>
<next.release.version>1.0.1</next.release.version>
<next.release.version>1.0.2</next.release.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -90,7 +90,7 @@

<gwt.version>2.10.0</gwt.version>
<domino.logger.version>1.0.3</domino.logger.version>
<domino.jackson.version>1.0.3</domino.jackson.version>
<domino.jackson.version>1.0.4</domino.jackson.version>
<domino.history.version>1.0.2</domino.history.version>
<domino.aggregator.version>1.0.2</domino.aggregator.version>
<jax.rs.version>2.1.1</jax.rs.version>
Expand Down

0 comments on commit 07040d0

Please sign in to comment.