Skip to content

Commit

Permalink
RESTHeart 8.0 (#7471)
Browse files Browse the repository at this point in the history
* ⬆️ Upgrade RESTHeart to v8.0.0-beta

* ⬆️ Upgrade RESTHeart to v8.0.x

* 🔧 Update version in config.yaml

* ♻️ Exclude graalvm transitive dependencies in shaded jar using shade plugin configuration
  • Loading branch information
ujibang authored May 22, 2024
1 parent daf666e commit f43ba9a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion java/restheart/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
framework:
website: restheart.org
version: 8.0.0-beta
version: 8.0

build:
- mvn package
Expand Down
6 changes: 4 additions & 2 deletions java/restheart/etc/conf-overrides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@

/core/name: restheart-benchmarker

/fullAuthorizer/enabled: true

/logging/log-level: "OFF"
/logging/requests-log-mode: 0

/fullAuthorizer/enabled: true

/ping/enabled: false
/xPoweredBy/enabled: false
/dateHeader/enabled: false
8 changes: 7 additions & 1 deletion java/restheart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<restheart.version>8.0.0-beta</restheart.version>
<restheart.version>[8.0,8.1.0-SNAPSHOT)</restheart.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -37,6 +37,12 @@
</excludes>
</filter>
</filters>
<!-- avoids including graalvm transitive dependencies into shaded jar-->
<artifactSet>
<excludes>
<exclude>org.graalvm.*:*</exclude>
</excludes>
</artifactSet>
</configuration>
<executions>
<execution>
Expand Down
4 changes: 2 additions & 2 deletions java/restheart/src/main/java/org/restheart/RootService.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
import org.restheart.exchange.ByteArrayRequest;
import org.restheart.exchange.ByteArrayResponse;
import org.restheart.plugins.ByteArrayService;
import static org.restheart.plugins.InterceptPoint.ANY;
import org.restheart.plugins.RegisterPlugin;
import org.restheart.plugins.RegisterPlugin.MATCH_POLICY;
import static org.restheart.plugins.InterceptPoint.*;

@RegisterPlugin(name = "benchmarkRootService",
description = "service for root resource",
defaultURI = "/",
uriMatchPolicy = MATCH_POLICY.EXACT,
blocking = false,
dontIntercept = { REQUEST_BEFORE_EXCHANGE_INIT, REQUEST_BEFORE_AUTH, REQUEST_AFTER_AUTH, RESPONSE, RESPONSE_ASYNC })
dontIntercept = ANY)
public class RootService implements ByteArrayService {
@Override
public void handle(ByteArrayRequest request, ByteArrayResponse response) throws Exception {
Expand Down
5 changes: 3 additions & 2 deletions java/restheart/src/main/java/org/restheart/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,23 @@
import org.restheart.exchange.ByteArrayRequest;
import org.restheart.exchange.ByteArrayResponse;
import org.restheart.plugins.ByteArrayService;
import static org.restheart.plugins.InterceptPoint.*;
import static org.restheart.plugins.InterceptPoint.ANY;
import org.restheart.plugins.RegisterPlugin;
import org.restheart.utils.HttpStatus;

@RegisterPlugin(name = "benchmarkUserService",
description = "service for user resource",
defaultURI = "/user",
blocking = false,
dontIntercept = { REQUEST_BEFORE_EXCHANGE_INIT, REQUEST_BEFORE_AUTH, REQUEST_AFTER_AUTH, RESPONSE, RESPONSE_ASYNC }
dontIntercept = ANY
)
public class UserService implements ByteArrayService {
@Override
public void handle(ByteArrayRequest request, ByteArrayResponse response) throws Exception {
switch(request.getMethod()) {
case POST -> { /* nothing to do! this just sends 200 back */ }
case GET -> response.setContent(request.getPathParam("/user/{id}", "id"));
case OPTIONS -> handleOptions();
default -> response.setStatusCode(HttpStatus.SC_NOT_IMPLEMENTED);
}
}
Expand Down

0 comments on commit f43ba9a

Please sign in to comment.