From 3d5f4cce5e53858bd006e146f514fcdce179d0d7 Mon Sep 17 00:00:00 2001 From: "Ahmad K. Bawaneh" Date: Mon, 17 Jul 2023 14:15:42 +0300 Subject: [PATCH 1/3] Update for next development version --- domino-rest-client/pom.xml | 2 +- domino-rest-jaxrs/pom.xml | 2 +- domino-rest-jvm/pom.xml | 2 +- domino-rest-processor/pom.xml | 2 +- domino-rest-shared/pom.xml | 2 +- domino-rest-test/pom.xml | 2 +- pom.xml | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/domino-rest-client/pom.xml b/domino-rest-client/pom.xml index 872a1d5..1e98ee4 100644 --- a/domino-rest-client/pom.xml +++ b/domino-rest-client/pom.xml @@ -5,7 +5,7 @@ domino-rest org.dominokit - 1.0.0 + HEAD-SNAPSHOT 4.0.0 diff --git a/domino-rest-jaxrs/pom.xml b/domino-rest-jaxrs/pom.xml index 0de1719..86d8635 100644 --- a/domino-rest-jaxrs/pom.xml +++ b/domino-rest-jaxrs/pom.xml @@ -5,7 +5,7 @@ org.dominokit domino-rest - 1.0.0 + HEAD-SNAPSHOT domino-rest-jaxrs diff --git a/domino-rest-jvm/pom.xml b/domino-rest-jvm/pom.xml index ba49ba5..25c9905 100644 --- a/domino-rest-jvm/pom.xml +++ b/domino-rest-jvm/pom.xml @@ -5,7 +5,7 @@ domino-rest org.dominokit - 1.0.0 + HEAD-SNAPSHOT 4.0.0 diff --git a/domino-rest-processor/pom.xml b/domino-rest-processor/pom.xml index 8b2d411..a5febb1 100644 --- a/domino-rest-processor/pom.xml +++ b/domino-rest-processor/pom.xml @@ -4,7 +4,7 @@ domino-rest org.dominokit - 1.0.0 + HEAD-SNAPSHOT 4.0.0 diff --git a/domino-rest-shared/pom.xml b/domino-rest-shared/pom.xml index 1e4836d..66162f2 100644 --- a/domino-rest-shared/pom.xml +++ b/domino-rest-shared/pom.xml @@ -5,7 +5,7 @@ domino-rest org.dominokit - 1.0.0 + HEAD-SNAPSHOT 4.0.0 diff --git a/domino-rest-test/pom.xml b/domino-rest-test/pom.xml index 116f4ff..03c8c3f 100644 --- a/domino-rest-test/pom.xml +++ b/domino-rest-test/pom.xml @@ -5,7 +5,7 @@ domino-rest org.dominokit - 1.0.0 + HEAD-SNAPSHOT 4.0.0 diff --git a/pom.xml b/pom.xml index 0860a27..f2b5307 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.dominokit domino-rest - 1.0.0 + HEAD-SNAPSHOT pom domino-rest @@ -70,7 +70,7 @@ HEAD-SNAPSHOT - 1.0.0 + 1.0.1 1.8 1.8 UTF-8 From 3580d2aaa4abe3b8b58f29dd7101823e9988bc9a Mon Sep 17 00:00:00 2001 From: "Ahmad K. Bawaneh" Date: Mon, 27 Nov 2023 16:26:35 +0300 Subject: [PATCH 2/3] update dependencies and use a new super source approach compatible with j2cl --- .github/workflows/deploy.yaml | 43 +- .mvn/maven.config | 1 - .mvn/settings.xml | 6 - domino-rest-client/pom.xml | 46 ++- .../org/dominokit/rest/DominoRestConfig.java | 17 + domino-rest-client/src/main/module.gwt.xml | 1 + domino-rest-jaxrs/pom.xml | 5 - .../src/main/java/javax/ws/rs/Consumes.java | 80 ---- .../main/java/javax/ws/rs/CookieParam.java | 67 ---- .../main/java/javax/ws/rs/DefaultValue.java | 57 --- .../src/main/java/javax/ws/rs/Encoded.java | 48 --- .../src/main/java/javax/ws/rs/FormParam.java | 69 ---- .../main/java/javax/ws/rs/HeaderParam.java | 92 ----- .../main/java/javax/ws/rs/MatrixParam.java | 77 ---- .../src/main/java/javax/ws/rs/PATCH.java | 60 --- .../src/main/java/javax/ws/rs/POST.java | 61 --- .../src/main/java/javax/ws/rs/Path.java | 119 ------ .../src/main/java/javax/ws/rs/PathParam.java | 107 ----- .../src/main/java/javax/ws/rs/Produces.java | 79 ---- .../src/main/java/javax/ws/rs/QueryParam.java | 97 ----- .../main/java/javax/ws/rs/core/MediaType.java | 366 ------------------ .../java/javax/ws/rs/ext/ParamConverter.java | 89 ----- .../ws/rs/ext/ParamConverterProvider.java | 52 --- .../main/java/javax/ws/rs/package-info.java | 16 + .../javax/ws/rs/ApplicationPath.java | 34 ++ .../javax/ws/rs/BadRequestException.java | 22 ++ .../main/resources/javax/ws/rs/BeanParam.java | 30 ++ .../javax/ws/rs/ClientErrorException.java | 22 ++ .../resources/javax/ws/rs/ConstrainedTo.java | 34 ++ .../main/resources/javax/ws/rs/Consumes.java | 36 ++ .../resources/javax/ws/rs/CookieParam.java | 34 ++ .../main/resources/javax/ws/rs/DELETE.java | 31 ++ .../resources/javax/ws/rs/DefaultValue.java | 34 ++ .../main/resources/javax/ws/rs/Encoded.java | 36 ++ .../javax/ws/rs/ForbiddenException.java | 22 ++ .../main/resources/javax/ws/rs/FormParam.java | 34 ++ .../src/main/resources/javax/ws/rs/GET.java | 31 ++ .../javax/ws/rs/GwtIncompatible.java | 12 +- .../src/main/resources/javax/ws/rs/HEAD.java | 31 ++ .../resources/javax/ws/rs/HeaderParam.java | 34 ++ .../resources/javax/ws/rs/HttpMethod.java | 47 +++ .../ws/rs/InternalServerErrorException.java | 22 ++ .../javax/ws/rs/JaxRs.gwt.xml} | 0 .../resources/javax/ws/rs/MatrixParam.java | 34 ++ .../resources/javax/ws/rs/NameBinding.java | 30 ++ .../javax/ws/rs/NotAcceptableException.java | 22 ++ .../javax/ws/rs/NotAllowedException.java | 25 ++ .../javax/ws/rs/NotAuthorizedException.java | 22 ++ .../javax/ws/rs/NotFoundException.java | 26 ++ .../javax/ws/rs/NotSupportedException.java | 26 ++ .../main/resources/javax/ws/rs/OPTIONS.java | 31 ++ .../src/main/resources/javax/ws/rs/PATCH.java | 31 ++ .../src/main/resources/javax/ws/rs/POST.java | 31 ++ .../src/main/resources/javax/ws/rs/PUT.java | 31 ++ .../src/main/resources/javax/ws/rs/Path.java | 34 ++ .../main/resources/javax/ws/rs/PathParam.java | 34 ++ .../resources/javax/ws/rs/Priorities.java | 37 ++ .../main/resources/javax/ws/rs/Produces.java | 36 ++ .../resources/javax/ws/rs/QueryParam.java | 34 ++ .../resources/javax/ws/rs/RuntimeType.java | 26 ++ .../ws/rs/ServiceUnavailableException.java | 24 ++ .../javax/ws/rs/WebApplicationException.java | 21 + .../javax/ws/rs/container/AsyncResponse.java | 0 .../ws/rs/container/CompletionCallback.java} | 25 +- .../ws/rs/container/ConnectionCallback.java | 45 +++ .../container/ContainerRequestContext.java} | 108 ++++-- .../rs/container/ContainerRequestFilter.java | 45 +++ .../container/ContainerResponseContext.java} | 131 ++++--- .../rs/container/ContainerResponseFilter.java | 48 +++ .../javax/ws/rs/container/DynamicFeature.java | 48 +++ .../javax/ws/rs/container/PreMatching.java} | 16 +- .../ws/rs/container/ResourceContext.java | 48 +++ .../javax/ws/rs/container/ResourceInfo.java | 52 +++ .../javax/ws/rs/container/Suspended.java | 4 - .../javax/ws/rs/container/TimeoutHandler.java | 4 - .../javax/ws/rs/container/package-info.java | 42 ++ .../ws/rs/core/AbstractMultivaluedMap.java | 261 +++++++++++++ .../javax/ws/rs/core/Application.java} | 30 +- .../javax/ws/rs/core/CacheControl.java | 269 +++++++++++++ .../javax/ws/rs/core/Configurable.java | 54 +++ .../javax/ws/rs/core/Configuration.java | 58 +++ .../resources/javax/ws/rs/core/Context.java | 30 ++ .../resources/javax/ws/rs/core/Cookie.java | 123 ++++++ .../resources/javax/ws/rs/core/EntityTag.java | 73 ++++ .../resources/javax/ws/rs/core/Feature.java | 25 ++ .../javax/ws/rs/core/FeatureContext.java | 21 + .../main/resources/javax/ws/rs/core/Form.java | 58 +++ .../javax/ws/rs/core/GenericEntity.java | 63 +++ .../javax/ws/rs/core/GenericType.java | 45 +++ .../javax/ws/rs/core/HttpHeaders.java | 125 ++++++ .../main/resources/javax/ws/rs/core/Link.java | 54 +++ .../resources/javax/ws/rs/core/MediaType.java | 240 ++++++++++++ .../javax/ws/rs/core/MultivaluedHashMap.java | 66 ++++ .../javax/ws/rs/core/MultivaluedMap.java | 46 +++ .../resources/javax/ws/rs/core/NewCookie.java | 232 +++++++++++ .../javax/ws/rs/core/NoContentException.java | 40 ++ .../javax/ws/rs/core/PathSegment.java | 27 ++ .../resources/javax/ws/rs/core/Request.java | 31 ++ .../resources/javax/ws/rs/core/Response.java | 300 ++++++++++++++ .../javax/ws/rs/core/SecurityContext.java | 47 +++ .../javax/ws/rs/core/StreamingOutput.java | 30 ++ .../javax/ws/rs/core/UriBuilder.java | 100 +++++ .../javax/ws/rs/core/UriBuilderException.java | 41 ++ .../resources/javax/ws/rs/core/UriInfo.java | 70 ++++ .../resources/javax/ws/rs/core/Variant.java | 26 ++ .../javax/ws/rs/core/package-info.java} | 22 +- .../javax/ws/rs/ext/ContextResolver.java | 24 ++ .../javax/ws/rs/ext/ExceptionMapper.java | 27 ++ .../javax/ws/rs/ext/FactoryFinder.java | 38 ++ .../javax/ws/rs/ext/InterceptorContext.java | 64 +++ .../javax/ws/rs/ext/MessageBodyReader.java | 46 +++ .../javax/ws/rs/ext/MessageBodyWriter.java | 51 +++ .../javax/ws/rs/ext/ParamConverter.java | 40 ++ .../ws/rs/ext/ParamConverterProvider.java | 29 ++ .../resources/javax/ws/rs/ext/Provider.java | 30 ++ .../resources/javax/ws/rs/ext/Providers.java | 42 ++ .../javax/ws/rs/ext/ReaderInterceptor.java | 29 ++ .../ws/rs/ext/ReaderInterceptorContext.java | 40 ++ .../javax/ws/rs/ext/RuntimeDelegate.java | 105 +++++ .../javax/ws/rs/ext/WriterInterceptor.java | 29 ++ .../ws/rs/ext/WriterInterceptorContext.java | 46 +++ .../javax/ws/rs/ext/package-info.java} | 22 +- .../javax/ws/rs/package-info.java} | 40 +- domino-rest-jvm/pom.xml | 9 +- .../org/dominokit/rest/DominoRestConfig.java | 16 + domino-rest-processor/pom.xml | 20 +- domino-rest-shared/pom.xml | 17 +- .../rest/shared/request/RestConfig.java | 2 + .../rest/shared/request/ServerRequest.java | 7 +- .../rest/shared/request/UrlFormatter.java | 12 +- .../shared/request/UrlTokenRegexMatcher.java | 20 + pom.xml | 70 +++- 132 files changed, 5044 insertions(+), 1810 deletions(-) delete mode 100644 .mvn/maven.config delete mode 100755 .mvn/settings.xml delete mode 100644 domino-rest-jaxrs/src/main/java/javax/ws/rs/Consumes.java delete mode 100644 domino-rest-jaxrs/src/main/java/javax/ws/rs/CookieParam.java delete mode 100644 domino-rest-jaxrs/src/main/java/javax/ws/rs/DefaultValue.java delete mode 100644 domino-rest-jaxrs/src/main/java/javax/ws/rs/Encoded.java delete mode 100644 domino-rest-jaxrs/src/main/java/javax/ws/rs/FormParam.java delete mode 100644 domino-rest-jaxrs/src/main/java/javax/ws/rs/HeaderParam.java delete mode 100644 domino-rest-jaxrs/src/main/java/javax/ws/rs/MatrixParam.java delete mode 100644 domino-rest-jaxrs/src/main/java/javax/ws/rs/PATCH.java delete mode 100644 domino-rest-jaxrs/src/main/java/javax/ws/rs/POST.java delete mode 100644 domino-rest-jaxrs/src/main/java/javax/ws/rs/Path.java delete mode 100644 domino-rest-jaxrs/src/main/java/javax/ws/rs/PathParam.java delete mode 100644 domino-rest-jaxrs/src/main/java/javax/ws/rs/Produces.java delete mode 100644 domino-rest-jaxrs/src/main/java/javax/ws/rs/QueryParam.java delete mode 100644 domino-rest-jaxrs/src/main/java/javax/ws/rs/core/MediaType.java delete mode 100644 domino-rest-jaxrs/src/main/java/javax/ws/rs/ext/ParamConverter.java delete mode 100644 domino-rest-jaxrs/src/main/java/javax/ws/rs/ext/ParamConverterProvider.java create mode 100644 domino-rest-jaxrs/src/main/java/javax/ws/rs/package-info.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ApplicationPath.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/BadRequestException.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/BeanParam.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ClientErrorException.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ConstrainedTo.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/Consumes.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/CookieParam.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/DELETE.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/DefaultValue.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/Encoded.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ForbiddenException.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/FormParam.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/GET.java rename domino-rest-jaxrs/src/main/{java => resources}/javax/ws/rs/GwtIncompatible.java (80%) create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/HEAD.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/HeaderParam.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/HttpMethod.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/InternalServerErrorException.java rename domino-rest-jaxrs/src/main/{module.gwt.xml => resources/javax/ws/rs/JaxRs.gwt.xml} (100%) create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/MatrixParam.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/NameBinding.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotAcceptableException.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotAllowedException.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotAuthorizedException.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotFoundException.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotSupportedException.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/OPTIONS.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/PATCH.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/POST.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/PUT.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/Path.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/PathParam.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/Priorities.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/Produces.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/QueryParam.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/RuntimeType.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ServiceUnavailableException.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/WebApplicationException.java rename domino-rest-jaxrs/src/main/{java => resources}/javax/ws/rs/container/AsyncResponse.java (100%) rename domino-rest-jaxrs/src/main/{java/javax/ws/rs/PUT.java => resources/javax/ws/rs/container/CompletionCallback.java} (76%) create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ConnectionCallback.java rename domino-rest-jaxrs/src/main/{java/javax/ws/rs/HttpMethod.java => resources/javax/ws/rs/container/ContainerRequestContext.java} (51%) create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ContainerRequestFilter.java rename domino-rest-jaxrs/src/main/{java/javax/ws/rs/BeanParam.java => resources/javax/ws/rs/container/ContainerResponseContext.java} (50%) create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ContainerResponseFilter.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/DynamicFeature.java rename domino-rest-jaxrs/src/main/{java/javax/ws/rs/GET.java => resources/javax/ws/rs/container/PreMatching.java} (87%) create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ResourceContext.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ResourceInfo.java rename domino-rest-jaxrs/src/main/{java => resources}/javax/ws/rs/container/Suspended.java (94%) rename domino-rest-jaxrs/src/main/{java => resources}/javax/ws/rs/container/TimeoutHandler.java (85%) create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/package-info.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/AbstractMultivaluedMap.java rename domino-rest-jaxrs/src/main/{java/javax/ws/rs/core/Context.java => resources/javax/ws/rs/core/Application.java} (80%) create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/CacheControl.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Configurable.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Configuration.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Context.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Cookie.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/EntityTag.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Feature.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/FeatureContext.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Form.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/GenericEntity.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/GenericType.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/HttpHeaders.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Link.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/MediaType.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/MultivaluedHashMap.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/MultivaluedMap.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/NewCookie.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/NoContentException.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/PathSegment.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Request.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Response.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/SecurityContext.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/StreamingOutput.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/UriBuilder.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/UriBuilderException.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/UriInfo.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Variant.java rename domino-rest-jaxrs/src/main/{java/javax/ws/rs/HEAD.java => resources/javax/ws/rs/core/package-info.java} (79%) create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ContextResolver.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ExceptionMapper.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/FactoryFinder.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/InterceptorContext.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/MessageBodyReader.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/MessageBodyWriter.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ParamConverter.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ParamConverterProvider.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/Provider.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/Providers.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ReaderInterceptor.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ReaderInterceptorContext.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/RuntimeDelegate.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/WriterInterceptor.java create mode 100644 domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/WriterInterceptorContext.java rename domino-rest-jaxrs/src/main/{java/javax/ws/rs/DELETE.java => resources/javax/ws/rs/ext/package-info.java} (79%) rename domino-rest-jaxrs/src/main/{java/javax/ws/rs/OPTIONS.java => resources/javax/ws/rs/package-info.java} (76%) create mode 100644 domino-rest-shared/src/main/java/org/dominokit/rest/shared/request/UrlTokenRegexMatcher.java diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index c8527ee..1b9ab20 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -18,40 +18,45 @@ name: Deploy on: push: - branches: [ master , development] + branches: [ master , development ] jobs: verify: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: - java-version: [ 8, 11 ] + java-version: [ 11 ] steps: - name: Check out Git repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Java and Maven - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: java-version: ${{ matrix.java-version }} - - run: mvn verify + distribution: 'temurin' + - run: mvn verify -B -e release: needs: verify - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Check out Git repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Java and Maven - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: - java-version: 1.8 - - - name: Release Maven package - uses: samuelmeuli/action-maven-publish@v1 - with: - gpg_private_key: ${{ secrets.gpg_private_key }} - gpg_passphrase: ${{ secrets.gpg_passphrase }} - nexus_username: ${{ secrets.nexus_username }} - nexus_password: ${{ secrets.nexus_password }} - maven_args: -Dci=true + java-version: 11 + distribution: 'temurin' + server-id: ossrh + server-username: SONATYPE_USERNAME + server-password: SONATYPE_PASSWORD + - id: install-secret-key + name: Install gpg secret key + run: | + cat <(echo -e "${{ secrets.gpg_private_key }}") | gpg --batch --import + - name: publish to snapshot + run: mvn --no-transfer-progress clean deploy -B -e -Dci=true -Dgpg.passphrase=${{ secrets.gpg_passphrase }} + env: + SONATYPE_USERNAME: ${{ secrets.nexus_username }} + SONATYPE_PASSWORD: ${{ secrets.nexus_password }} \ No newline at end of file diff --git a/.mvn/maven.config b/.mvn/maven.config deleted file mode 100644 index 39d4ab0..0000000 --- a/.mvn/maven.config +++ /dev/null @@ -1 +0,0 @@ ---settings ./.mvn/settings.xml \ No newline at end of file diff --git a/.mvn/settings.xml b/.mvn/settings.xml deleted file mode 100755 index 26bf165..0000000 --- a/.mvn/settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/domino-rest-client/pom.xml b/domino-rest-client/pom.xml index 1e98ee4..7f89da0 100644 --- a/domino-rest-client/pom.xml +++ b/domino-rest-client/pom.xml @@ -21,12 +21,12 @@ 1.0.0-RC1 - com.google.gwt + org.gwtproject gwt-user test - com.google.gwt + org.gwtproject gwt-dev test @@ -40,11 +40,6 @@ domino-rest-shared ${project.version} - - org.dominokit - domino-rest-jaxrs - ${project.version} - org.gwtproject.core gwt-core @@ -60,6 +55,43 @@ gwt-xhr 1.0.0-RC1 + + + org.gwtproject.regexp + gwt-regexp + 1.0.0-RC1 + + + com.google.elemental2 + elemental2-core + + + com.google.elemental2 + elemental2-dom + + + com.google.elemental2 + elemental2-promise + + + + + com.google.elemental2 + elemental2-promise + + + + javax.ws.rs + javax.ws.rs-api + ${jax.rs.version} + + + + org.dominokit + domino-rest-jaxrs + ${project.version} + + junit junit diff --git a/domino-rest-client/src/main/java/org/dominokit/rest/DominoRestConfig.java b/domino-rest-client/src/main/java/org/dominokit/rest/DominoRestConfig.java index b652e32..c7204a6 100644 --- a/domino-rest-client/src/main/java/org/dominokit/rest/DominoRestConfig.java +++ b/domino-rest-client/src/main/java/org/dominokit/rest/DominoRestConfig.java @@ -25,6 +25,8 @@ import org.dominokit.rest.js.ServerEventFactory; import org.dominokit.rest.shared.request.*; import org.gwtproject.i18n.shared.DateTimeFormat; +import org.gwtproject.regexp.shared.MatchResult; +import org.gwtproject.regexp.shared.RegExp; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -253,4 +255,19 @@ public RestConfig setNullQueryParamStrategy(NullQueryParamStrategy strategy) { } return this; } + + @Override + public UrlTokenRegexMatcher getUrlTokenRegexMatcher() { + return url -> { + if (url.contains("http:") || url.contains("https:")) { + RegExp regExp = RegExp.compile("^((.*:)//([a-z0-9\\-.]+)(|:[0-9]+)/)(.*)$"); + MatchResult matcher = regExp.exec(url); + boolean matchFound = matcher != null; // equivalent to regExp.test(inputStr); + if (matchFound) { + return matcher.getGroup(matcher.getGroupCount() - 1); + } + } + return url; + }; + } } diff --git a/domino-rest-client/src/main/module.gwt.xml b/domino-rest-client/src/main/module.gwt.xml index 4946f79..1e3f4e9 100644 --- a/domino-rest-client/src/main/module.gwt.xml +++ b/domino-rest-client/src/main/module.gwt.xml @@ -20,5 +20,6 @@ + diff --git a/domino-rest-jaxrs/pom.xml b/domino-rest-jaxrs/pom.xml index 86d8635..9a3a248 100644 --- a/domino-rest-jaxrs/pom.xml +++ b/domino-rest-jaxrs/pom.xml @@ -16,11 +16,6 @@ domino rest jax-rs super sources - - - src/main/java - - org.apache.maven.plugins diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/Consumes.java b/domino-rest-jaxrs/src/main/java/javax/ws/rs/Consumes.java deleted file mode 100644 index 825517e..0000000 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/Consumes.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 2010-2015 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ - -package javax.ws.rs; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Defines the media types that the methods of a resource class. If not specified, a container will - * assume that any media type is acceptable. Method level annotations override a class level - * annotation. A container is responsible for ensuring that the method invoked is capable of - * consuming the media type of the HTTP request entity body. If no such method is available the - * container must respond with a HTTP "415 Unsupported Media Type" as specified by RFC 2616. - * - * @author Paul Sandoz - * @author Marc Hadley - * @since 1.0 - */ -@Inherited -@Target({ElementType.TYPE, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface Consumes { - - /** - * A list of media types. Each entry may specify a single type or consist of a comma separated - * list of types, with any leading or trailing white-spaces in a single type entry being ignored. - * For example: - * - *
-   *  {"image/jpeg, image/gif ", " image/png"}
-   * 
- * - * Use of the comma-separated form allows definition of a common string constant for use on - * multiple targets. - */ - String[] value() default "*/*"; -} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/CookieParam.java b/domino-rest-jaxrs/src/main/java/javax/ws/rs/CookieParam.java deleted file mode 100644 index d2ae0c7..0000000 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/CookieParam.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package javax.ws.rs; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Binds the value of a HTTP cookie to a resource method parameter, resource class field, or - * resource class bean property. A default value can be specified using the {@link DefaultValue} - * annotation. - * - *

The type {@code T} of the annotated parameter, field or property must either: - * - *

    - *
  1. Be a primitive type - *
  2. Be {@link javax.ws.rs.core.Cookie} - *
  3. Have a constructor that accepts a single String argument - *
  4. Have a static method named {@code valueOf} or {@code fromString} that accepts a single - * String argument (see, for example, {@link Integer#valueOf(String)}) - *
  5. Have a registered implementation of {@link javax.ws.rs.ext.ParamConverterProvider} JAX-RS - * extension SPI that returns a {@link javax.ws.rs.ext.ParamConverter} instance capable of a - * "from string" conversion for the type. - *
  6. Be {@code List}, {@code Set} or {@code SortedSet}, where {@code T} satisfies 2, 3, - * 4 or 5 above. The resulting collection is read-only. - *
- * - *

Because injection occurs at object creation time, use of this annotation on resource class - * fields and bean properties is only supported for the default per-request resource class - * lifecycle. Resource classes using other lifecycles should only use this annotation on resource - * method parameters. - * - * @author Paul Sandoz - * @author Marc Hadley - * @see DefaultValue - * @see javax.ws.rs.core.Cookie - * @see javax.ws.rs.core.HttpHeaders#getCookies - * @since 1.0 - */ -@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface CookieParam { - - /** - * Defines the name of the HTTP cookie whose value will be used to initialize the value of the - * annotated method argument, class field or bean property. - */ - String value(); -} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/DefaultValue.java b/domino-rest-jaxrs/src/main/java/javax/ws/rs/DefaultValue.java deleted file mode 100644 index 0f7c0b9..0000000 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/DefaultValue.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package javax.ws.rs; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Defines the default value of request meta-data that is bound using one of the following - * annotations: {@link javax.ws.rs.PathParam}, {@link javax.ws.rs.QueryParam}, {@link - * javax.ws.rs.MatrixParam}, {@link javax.ws.rs.CookieParam}, {@link javax.ws.rs.FormParam}, or - * {@link javax.ws.rs.HeaderParam}. The default value is used if the corresponding meta-data is not - * present in the request. - * - *

If the type of the annotated parameter is {@link java.util.List}, {@link java.util.Set} or - * {@link java.util.SortedSet} then the resulting collection will have a single entry mapped from - * the supplied default value. - * - *

If this annotation is not used and the corresponding meta-data is not present in the request, - * the value will be an empty collection for {@code List}, {@code Set} or {@code SortedSet}, {@code - * null} for other object types, and the Java-defined default for primitive types. - * - * @author Paul Sandoz - * @author Marc Hadley - * @see PathParam - * @see QueryParam - * @see FormParam - * @see HeaderParam - * @see MatrixParam - * @see CookieParam - * @since 1.0 - */ -@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface DefaultValue { - - /** The specified default value. */ - String value(); -} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/Encoded.java b/domino-rest-jaxrs/src/main/java/javax/ws/rs/Encoded.java deleted file mode 100644 index 8582ca3..0000000 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/Encoded.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package javax.ws.rs; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Disables automatic decoding of parameter values bound using {@link QueryParam}, {@link - * PathParam}, {@link FormParam} or {@link MatrixParam}. Using this annotation on a method will - * disable decoding for all parameters. Using this annotation on a class will disable decoding for - * all parameters of all methods. - * - * @author Paul Sandoz - * @author Marc Hadley - * @see QueryParam - * @see MatrixParam - * @see PathParam - * @see FormParam - * @since 1.0 - */ -@Target({ - ElementType.PARAMETER, - ElementType.METHOD, - ElementType.FIELD, - ElementType.CONSTRUCTOR, - ElementType.TYPE -}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface Encoded {} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/FormParam.java b/domino-rest-jaxrs/src/main/java/javax/ws/rs/FormParam.java deleted file mode 100644 index 4ee2f01..0000000 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/FormParam.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package javax.ws.rs; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Binds the value(s) of a form parameter contained within a request entity body to a resource - * method parameter. Values are URL decoded unless this is disabled using the {@link Encoded} - * annotation. A default value can be specified using the {@link DefaultValue} annotation. If the - * request entity body is absent or is an unsupported media type, the default value is used. - * - *

The type {@code T} of the annotated parameter must either: - * - *

    - *
  1. Be a primitive type - *
  2. Have a constructor that accepts a single {@code String} argument - *
  3. Have a static method named {@code valueOf} or {@code fromString} that accepts a single - * {@code String} argument (see, for example, {@link Integer#valueOf(String)}) - *
  4. Have a registered implementation of {@link javax.ws.rs.ext.ParamConverterProvider} JAX-RS - * extension SPI that returns a {@link javax.ws.rs.ext.ParamConverter} instance capable of a - * "from string" conversion for the type. - *
  5. Be {@code List}, {@code Set} or {@code SortedSet}, where {@code T} satisfies 2, 3 - * or 4 above. The resulting collection is read-only. - *
- * - *

If the type is not one of the collection types listed in 5 above and the form parameter is - * represented by multiple values then the first value (lexically) of the parameter is used. - * - *

Note that, whilst the annotation target permits use on fields and methods, this annotation is - * only required to be supported on resource method parameters. - * - * @author Paul Sandoz - * @author Marc Hadley - * @see DefaultValue - * @see Encoded - * @since 1.0 - */ -@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface FormParam { - - /** - * Defines the name of the form parameter whose value will be used to initialize the value of the - * annotated method argument. The name is specified in decoded form, any percent encoded literals - * within the value will not be decoded and will instead be treated as literal text. E.g. if the - * parameter name is "a b" then the value of the annotation is "a b", not "a+b" or "a%20b". - */ - String value(); -} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/HeaderParam.java b/domino-rest-jaxrs/src/main/java/javax/ws/rs/HeaderParam.java deleted file mode 100644 index 35a05be..0000000 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/HeaderParam.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 2010-2015 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ - -package javax.ws.rs; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Binds the value(s) of a HTTP header to a resource method parameter, resource class field, or - * resource class bean property. A default value can be specified using the {@link DefaultValue} - * annotation. - * - *

The type {@code T} of the annotated parameter, field or property must either: - * - *

    - *
  1. Be a primitive type - *
  2. Have a constructor that accepts a single {@code String} argument - *
  3. Have a static method named {@code valueOf} or {@code fromString} that accepts a single - * {@code String} argument (see, for example, {@link Integer#valueOf(String)}) - *
  4. Have a registered implementation of {@link javax.ws.rs.ext.ParamConverterProvider} JAX-RS - * extension SPI that returns a {@link javax.ws.rs.ext.ParamConverter} instance capable of a - * "from string" conversion for the type. - *
  5. Be {@code List}, {@code Set} or {@code SortedSet}, where {@code T} satisfies 2, 3 - * or 4 above. The resulting collection is read-only. - *
- * - *

If the type is not one of the collection types listed in 5 above and the header parameter is - * represented by multiple values then the first value (lexically) of the parameter is used. - * - *

Because injection occurs at object creation time, use of this annotation on resource class - * fields and bean properties is only supported for the default per-request resource class - * lifecycle. Resource classes using other lifecycles should only use this annotation on resource - * method parameters. - * - * @author Paul Sandoz - * @author Marc Hadley - * @see DefaultValue - * @see javax.ws.rs.core.HttpHeaders - * @since 1.0 - */ -@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface HeaderParam { - - /** - * Defines the name of the HTTP header whose value will be used to initialize the value of the - * annotated method argument, class field or bean property. Case insensitive. - */ - String value(); -} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/MatrixParam.java b/domino-rest-jaxrs/src/main/java/javax/ws/rs/MatrixParam.java deleted file mode 100644 index 8f7ef05..0000000 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/MatrixParam.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package javax.ws.rs; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Binds the value(s) of a URI matrix parameter to a resource method parameter, resource class - * field, or resource class bean property. Values are URL decoded unless this is disabled using the - * {@link Encoded} annotation. A default value can be specified using the {@link DefaultValue} - * annotation. - * - *

Note that the {@code @MatrixParam} {@link #value() annotation value} refers to a name of a - * matrix parameter that resides in the last matched path segment of the {@link Path}-annotated Java - * structure that injects the value of the matrix parameter. - * - *

The type {@code T} of the annotated parameter, field or property must either: - * - *

    - *
  1. Be a primitive type - *
  2. Have a constructor that accepts a single {@code String} argument - *
  3. Have a static method named {@code valueOf} or {@code fromString} that accepts a single - * {@code String} argument (see, for example, {@link Integer#valueOf(String)}) - *
  4. Have a registered implementation of {@link javax.ws.rs.ext.ParamConverterProvider} JAX-RS - * extension SPI that returns a {@link javax.ws.rs.ext.ParamConverter} instance capable of a - * "from string" conversion for the type. - *
  5. Be {@code List}, {@code Set} or {@code SortedSet}, where {@code T} satisfies 2, 3 - * or 4 above. The resulting collection is read-only. - *
- * - *

If the type is not one of the collection types listed in 5 above and the matrix parameter is - * represented by multiple values then the first value (lexically) of the parameter is used. - * - *

Because injection occurs at object creation time, use of this annotation on resource class - * fields and bean properties is only supported for the default per-request resource class - * lifecycle. Resource classes using other lifecycles should only use this annotation on resource - * method parameters. - * - * @author Paul Sandoz - * @author Marc Hadley - * @see DefaultValue - * @see Encoded - * @see Matrix URIs - * @since 1.0 - */ -@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface MatrixParam { - - /** - * Defines the name of the URI matrix parameter whose value will be used to initialize the value - * of the annotated method argument, class field or bean property. The name is specified in - * decoded form, any percent encoded literals within the value will not be decoded and will - * instead be treated as literal text. E.g. if the parameter name is "a b" then the value of the - * annotation is "a b", not "a+b" or "a%20b". - */ - String value(); -} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/PATCH.java b/domino-rest-jaxrs/src/main/java/javax/ws/rs/PATCH.java deleted file mode 100644 index 696e694..0000000 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/PATCH.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ - -package javax.ws.rs; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Indicates that the annotated method responds to HTTP PATCH requests. - * - * @author Pavel Bucek (pavel.bucek at oracle.com) - * @see HttpMethod - * @since 2.1 - */ -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@HttpMethod(HttpMethod.PATCH) -@Documented -public @interface PATCH {} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/POST.java b/domino-rest-jaxrs/src/main/java/javax/ws/rs/POST.java deleted file mode 100644 index d59ff81..0000000 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/POST.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 2010-2015 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ - -package javax.ws.rs; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Indicates that the annotated method responds to HTTP POST requests. - * - * @author Paul Sandoz - * @author Marc Hadley - * @see HttpMethod - * @since 1.0 - */ -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@HttpMethod(HttpMethod.POST) -@Documented -public @interface POST {} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/Path.java b/domino-rest-jaxrs/src/main/java/javax/ws/rs/Path.java deleted file mode 100644 index 17693da..0000000 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/Path.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 2010-2015 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ - -package javax.ws.rs; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Identifies the URI path that a resource class or class method will serve requests for. - * - *

Paths are relative. For an annotated class the base URI is the application path. For an - * annotated method the base URI is the effective URI of the containing class. For the purposes of - * absolutizing a path against the base URI , a leading '/' in a path is ignored and base URIs are - * treated as if they ended in '/'. E.g.: - * - *

@Path("widgets")
- * public class WidgetsResource {
- *  @GET
- *  String getList() {...}
- *
- *  @GET @Path("{id}")
- *  String getWidget(@PathParam("id") String id) {...}
- * }
- * - *

In the above, if the application path is {@code catalogue} and the application is deployed at - * {@code http://example.com/}, then {@code GET} requests for {@code - * http://example.com/catalogue/widgets} will be handled by the {@code getList} method while - * requests for http://example.com/catalogue/widgets/nnn (where nnn - * is some value) will be handled by the {@code getWidget} method. The same would apply if - * the value of either {@code @Path} annotation started with '/'. - * - *

Classes and methods may also be annotated with {@link Consumes} and {@link Produces} to filter - * the requests they will receive. - * - * @author Paul Sandoz - * @author Marc Hadley - * @see Consumes - * @see Produces - * @since 1.0 - */ -@Target({ElementType.TYPE, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface Path { - - /** - * Defines a URI template for the resource class or method, must not include matrix parameters. - * - *

Embedded template parameters are allowed and are of the form: - * - *

 param = "{" *WSP name *WSP [ ":" *WSP regex *WSP ] "}"
-   * name = (ALPHA / DIGIT / "_")*(ALPHA / DIGIT / "." / "_" / "-" ) ; \w[\w\.-]*
-   * regex = *( nonbrace / "{" *nonbrace "}" ) ; where nonbrace is any char other than "{" and "}"
-   * 
- * - *

See {@link RFC 5234} for a description of - * the syntax used above and the expansions of {@code WSP}, {@code ALPHA} and {@code DIGIT}. In - * the above {@code name} is the template parameter name and the optional {@code regex} specifies - * the contents of the capturing group for the parameter. If {@code regex} is not supplied then a - * default value of {@code [^/]+} which terminates at a path segment boundary, is used. Matching - * of request URIs to URI templates is performed against encoded path values and implementations - * will not escape literal characters in regex automatically, therefore any literals in {@code - * regex} should be escaped by the author according to the rules of {@link RFC 3986 section 3.3}. Caution is - * recommended in the use of {@code regex}, incorrect use can lead to a template parameter - * matching unexpected URI paths. See {@link Pattern} - * for further information on the syntax of regular expressions. Values of template parameters may - * be extracted using PathParam. - * - *

The literal part of the supplied value (those characters that are not part of a template - * parameter) is automatically percent encoded to conform to the {@code path} production of {@link - * RFC 3986 section 3.3}. Note that - * percent encoded values are allowed in the literal part of the value, an implementation will - * recognize such values and will not double encode the '%' character. - */ - String value(); -} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/PathParam.java b/domino-rest-jaxrs/src/main/java/javax/ws/rs/PathParam.java deleted file mode 100644 index 385654b..0000000 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/PathParam.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 2010-2015 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ - -package javax.ws.rs; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Binds the value of a URI template parameter or a path segment containing the template parameter - * to a resource method parameter, resource class field, or resource class bean property. The value - * is URL decoded unless this is disabled using the {@link Encoded @Encoded} annotation. A - * default value can be specified using the {@link DefaultValue @DefaultValue} annotation. - * - *

The type of the annotated parameter, field or property must either: - * - *

    - *
  • Be {@link javax.ws.rs.core.PathSegment}, the value will be the final segment of the - * matching part of the path. See {@link javax.ws.rs.core.UriInfo} for a means of retrieving - * all request path segments. - *
  • Be {@code List}, the value will be a list of {@code - * PathSegment} corresponding to the path segment(s) that matched the named template - * parameter. See {@link javax.ws.rs.core.UriInfo} for a means of retrieving all request path - * segments. - *
  • Be a primitive type. - *
  • Have a constructor that accepts a single String argument. - *
  • Have a static method named {@code valueOf} or {@code fromString} that accepts a single - * String argument (see, for example, {@link Integer#valueOf(String)}). - *
  • Have a registered implementation of {@link javax.ws.rs.ext.ParamConverterProvider} JAX-RS - * extension SPI that returns a {@link javax.ws.rs.ext.ParamConverter} instance capable of a - * "from string" conversion for the type. - *
- * - *

The injected value corresponds to the latest use (in terms of scope) of the path parameter. - * E.g. if a class and a sub-resource method are both annotated with a {@link Path @Path} - * containing the same URI template parameter, use of {@code @PathParam} on a sub-resource method - * parameter will bind the value matching URI template parameter in the method's {@code @Path} - * annotation. - * - *

Because injection occurs at object creation time, use of this annotation on resource class - * fields and bean properties is only supported for the default per-request resource class - * lifecycle. Resource classes using other lifecycles should only use this annotation on resource - * method parameters. - * - * @author Paul Sandoz - * @author Marc Hadley - * @see Encoded @Encoded - * @see DefaultValue @DefaultValue - * @see javax.ws.rs.core.PathSegment - * @see javax.ws.rs.core.UriInfo - * @since 1.0 - */ -@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface PathParam { - - /** - * Defines the name of the URI template parameter whose value will be used to initialize the value - * of the annotated method parameter, class field or property. See {@link Path#value()} for a - * description of the syntax of template parameters. - * - *

E.g. a class annotated with: {@code @Path("widgets/{id}")} can have methods annotated whose - * arguments are annotated with {@code @PathParam("id")}. - */ - String value(); -} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/Produces.java b/domino-rest-jaxrs/src/main/java/javax/ws/rs/Produces.java deleted file mode 100644 index 14ea10f..0000000 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/Produces.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 2010-2015 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ - -package javax.ws.rs; - -import java.lang.annotation.*; - -/** - * Defines the media type(s) that the methods of a resource class can produce. If not specified then - * a container will assume that any type can be produced. Method level annotations override a class - * level annotation. A container is responsible for ensuring that the method invoked is capable of - * producing one of the media types requested in the HTTP request. If no such method is available - * the container must respond with a HTTP "406 Not Acceptable" as specified by RFC 2616. - * - *

A method for which there is a single-valued {@code @Produces} is not required to set the media - * type of representations that it produces: the container will use the value of the - * {@code @Produces} when sending a response. - * - * @author Paul Sandoz - * @author Marc Hadley - * @since 1.0 - */ -@Inherited -@Target({ElementType.TYPE, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface Produces { - - /** - * A list of media types. Each entry may specify a single type or consist of a comma separated - * list of types, with any leading or trailing white-spaces in a single type entry being ignored. - * For example: - * - *

-   *  {"image/jpeg, image/gif ", " image/png"}
-   * 
- * - * Use of the comma-separated form allows definition of a common string constant for use on - * multiple targets. - */ - String[] value() default "*/*"; -} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/QueryParam.java b/domino-rest-jaxrs/src/main/java/javax/ws/rs/QueryParam.java deleted file mode 100644 index 49a726b..0000000 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/QueryParam.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 2010-2015 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ - -package javax.ws.rs; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Binds the value(s) of a HTTP query parameter to a resource method parameter, resource class - * field, or resource class bean property. Values are URL decoded unless this is disabled using the - * {@link Encoded} annotation. A default value can be specified using the {@link DefaultValue} - * annotation. - * - *

The type {@code T} of the annotated parameter, field or property must either: - * - *

    - *
  1. Be a primitive type - *
  2. Have a constructor that accepts a single {@code String} argument - *
  3. Have a static method named {@code valueOf} or {@code fromString} that accepts a single - * {@code String} argument (see, for example, {@link Integer#valueOf(String)}) - *
  4. Have a registered implementation of {@link javax.ws.rs.ext.ParamConverterProvider} JAX-RS - * extension SPI that returns a {@link javax.ws.rs.ext.ParamConverter} instance capable of a - * "from string" conversion for the type. - *
  5. Be {@code List}, {@code Set} or {@code SortedSet}, where {@code T} satisfies 2, 3 - * or 4 above. The resulting collection is read-only. - *
- * - *

If the type is not one of the collection types listed in 5 above and the query parameter is - * represented by multiple values then the first value (lexically) of the parameter is used. - * - *

Because injection occurs at object creation time, use of this annotation on resource class - * fields and bean properties is only supported for the default per-request resource class - * lifecycle. Resource classes using other lifecycles should only use this annotation on resource - * method parameters. - * - * @author Paul Sandoz - * @author Marc Hadley - * @see DefaultValue - * @see Encoded - * @see javax.ws.rs.core.UriInfo#getQueryParameters - * @since 1.0 - */ -@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface QueryParam { - - /** - * Defines the name of the HTTP query parameter whose value will be used to initialize the value - * of the annotated method argument, class field or bean property. The name is specified in - * decoded form, any percent encoded literals within the value will not be decoded and will - * instead be treated as literal text. E.g. if the parameter name is "a b" then the value of the - * annotation is "a b", not "a+b" or "a%20b". - */ - String value(); -} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/core/MediaType.java b/domino-rest-jaxrs/src/main/java/javax/ws/rs/core/MediaType.java deleted file mode 100644 index bd3b02f..0000000 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/core/MediaType.java +++ /dev/null @@ -1,366 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 2010-2017 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ - -package javax.ws.rs.core; - -import java.util.Collections; -import java.util.Comparator; -import java.util.Map; -import java.util.TreeMap; - -/** - * An abstraction for a media type. Instances are immutable. - * - * @author Paul Sandoz - * @author Marc Hadley - * @see HTTP/1.1 section - * 3.7 - * @since 1.0 - */ -@SuppressWarnings("JavaDoc") -public class MediaType { - - private String type; - private String subtype; - private Map parameters; - - /** The media type {@code charset} parameter name. */ - public static final String CHARSET_PARAMETER = "charset"; - /** The value of a type or subtype wildcard {@value #MEDIA_TYPE_WILDCARD}. */ - public static final String MEDIA_TYPE_WILDCARD = "*"; - // Common media type constants - /** A {@code String} constant representing wildcard {@value #WILDCARD} media type . */ - public static final String WILDCARD = "*/*"; - /** A {@link MediaType} constant representing wildcard {@value #WILDCARD} media type. */ - public static final MediaType WILDCARD_TYPE = new MediaType(); - /** A {@code String} constant representing {@value #APPLICATION_XML} media type. */ - public static final String APPLICATION_XML = "application/xml"; - /** A {@link MediaType} constant representing {@value #APPLICATION_XML} media type. */ - public static final MediaType APPLICATION_XML_TYPE = new MediaType("application", "xml"); - /** A {@code String} constant representing {@value #APPLICATION_ATOM_XML} media type. */ - public static final String APPLICATION_ATOM_XML = "application/atom+xml"; - /** A {@link MediaType} constant representing {@value #APPLICATION_ATOM_XML} media type. */ - public static final MediaType APPLICATION_ATOM_XML_TYPE = - new MediaType("application", "atom+xml"); - /** A {@code String} constant representing {@value #APPLICATION_XHTML_XML} media type. */ - public static final String APPLICATION_XHTML_XML = "application/xhtml+xml"; - /** A {@link MediaType} constant representing {@value #APPLICATION_XHTML_XML} media type. */ - public static final MediaType APPLICATION_XHTML_XML_TYPE = - new MediaType("application", "xhtml+xml"); - /** A {@code String} constant representing {@value #APPLICATION_SVG_XML} media type. */ - public static final String APPLICATION_SVG_XML = "application/svg+xml"; - /** A {@link MediaType} constant representing {@value #APPLICATION_SVG_XML} media type. */ - public static final MediaType APPLICATION_SVG_XML_TYPE = new MediaType("application", "svg+xml"); - /** A {@code String} constant representing {@value #APPLICATION_JSON} media type. */ - public static final String APPLICATION_JSON = "application/json"; - /** A {@link MediaType} constant representing {@value #APPLICATION_JSON} media type. */ - public static final MediaType APPLICATION_JSON_TYPE = new MediaType("application", "json"); - /** A {@code String} constant representing {@value #APPLICATION_FORM_URLENCODED} media type. */ - public static final String APPLICATION_FORM_URLENCODED = "application/x-www-form-urlencoded"; - /** A {@link MediaType} constant representing {@value #APPLICATION_FORM_URLENCODED} media type. */ - public static final MediaType APPLICATION_FORM_URLENCODED_TYPE = - new MediaType("application", "x-www-form-urlencoded"); - /** A {@code String} constant representing {@value #MULTIPART_FORM_DATA} media type. */ - public static final String MULTIPART_FORM_DATA = "multipart/form-data"; - /** A {@link MediaType} constant representing {@value #MULTIPART_FORM_DATA} media type. */ - public static final MediaType MULTIPART_FORM_DATA_TYPE = new MediaType("multipart", "form-data"); - /** A {@code String} constant representing {@value #APPLICATION_OCTET_STREAM} media type. */ - public static final String APPLICATION_OCTET_STREAM = "application/octet-stream"; - /** A {@link MediaType} constant representing {@value #APPLICATION_OCTET_STREAM} media type. */ - public static final MediaType APPLICATION_OCTET_STREAM_TYPE = - new MediaType("application", "octet-stream"); - /** A {@code String} constant representing {@value #TEXT_PLAIN} media type. */ - public static final String TEXT_PLAIN = "text/plain"; - /** A {@link MediaType} constant representing {@value #TEXT_PLAIN} media type. */ - public static final MediaType TEXT_PLAIN_TYPE = new MediaType("text", "plain"); - /** A {@code String} constant representing {@value #TEXT_XML} media type. */ - public static final String TEXT_XML = "text/xml"; - /** A {@link MediaType} constant representing {@value #TEXT_XML} media type. */ - public static final MediaType TEXT_XML_TYPE = new MediaType("text", "xml"); - /** A {@code String} constant representing {@value #TEXT_HTML} media type. */ - public static final String TEXT_HTML = "text/html"; - /** A {@link MediaType} constant representing {@value #TEXT_HTML} media type. */ - public static final MediaType TEXT_HTML_TYPE = new MediaType("text", "html"); - /** {@link String} representation of Server sent events media type. ("{@value}"). */ - public static final String SERVER_SENT_EVENTS = "text/event-stream"; - /** Server sent events media type. */ - public static final MediaType SERVER_SENT_EVENTS_TYPE = new MediaType("text", "event-stream"); - /** {@link String} representation of {@value #APPLICATION_JSON_PATCH_JSON} media type.. */ - public static final String APPLICATION_JSON_PATCH_JSON = "application/json-patch+json"; - /** A {@link MediaType} constant representing {@value #APPLICATION_JSON_PATCH_JSON} media type. */ - public static final MediaType APPLICATION_JSON_PATCH_JSON_TYPE = - new MediaType("application", "json-patch+json"); - - /** - * Creates a new instance of {@code MediaType} by parsing the supplied string. - * - * @param type the media type string. - * @return the newly created MediaType. - * @throws IllegalArgumentException if the supplied string cannot be parsed or is {@code null}. - */ - public static MediaType valueOf(String type) { - if (type.contains("/")) { - String[] pair = type.split("/"); - return new MediaType(pair[0], pair[1]); - } - return new MediaType(type, type); - } - - private static TreeMap createParametersMap(Map initialValues) { - final TreeMap map = - new TreeMap( - new Comparator() { - - @Override - public int compare(String o1, String o2) { - return o1.compareToIgnoreCase(o2); - } - }); - if (initialValues != null) { - for (Map.Entry e : initialValues.entrySet()) { - map.put(e.getKey().toLowerCase(), e.getValue()); - } - } - return map; - } - - /** - * Creates a new instance of {@code MediaType} with the supplied type, subtype and parameters. - * - * @param type the primary type, {@code null} is equivalent to {@link #MEDIA_TYPE_WILDCARD}. - * @param subtype the subtype, {@code null} is equivalent to {@link #MEDIA_TYPE_WILDCARD}. - * @param parameters a map of media type parameters, {@code null} is the same as an empty map. - */ - public MediaType(String type, String subtype, Map parameters) { - this(type, subtype, null, createParametersMap(parameters)); - } - - /** - * Creates a new instance of {@code MediaType} with the supplied type and subtype. - * - * @param type the primary type, {@code null} is equivalent to {@link #MEDIA_TYPE_WILDCARD} - * @param subtype the subtype, {@code null} is equivalent to {@link #MEDIA_TYPE_WILDCARD} - */ - public MediaType(String type, String subtype) { - this(type, subtype, null, null); - } - - /** - * Creates a new instance of {@code MediaType} with the supplied type, subtype and {@value - * #CHARSET_PARAMETER} parameter. - * - * @param type the primary type, {@code null} is equivalent to {@link #MEDIA_TYPE_WILDCARD} - * @param subtype the subtype, {@code null} is equivalent to {@link #MEDIA_TYPE_WILDCARD} - * @param charset the {@value #CHARSET_PARAMETER} parameter value. If {@code null} or empty the - * {@value #CHARSET_PARAMETER} parameter will not be set. - */ - public MediaType(String type, String subtype, String charset) { - this(type, subtype, charset, null); - } - - /** - * Creates a new instance of {@code MediaType}, both type and subtype are wildcards. Consider - * using the constant {@link #WILDCARD_TYPE} instead. - */ - public MediaType() { - this(MEDIA_TYPE_WILDCARD, MEDIA_TYPE_WILDCARD, null, null); - } - - private MediaType(String type, String subtype, String charset, Map parameterMap) { - - this.type = type == null ? MEDIA_TYPE_WILDCARD : type; - this.subtype = subtype == null ? MEDIA_TYPE_WILDCARD : subtype; - - if (parameterMap == null) { - parameterMap = - new TreeMap( - new Comparator() { - - @Override - public int compare(String o1, String o2) { - return o1.compareToIgnoreCase(o2); - } - }); - } - - if (charset != null && !charset.isEmpty()) { - parameterMap.put(CHARSET_PARAMETER, charset); - } - this.parameters = Collections.unmodifiableMap(parameterMap); - } - - /** - * Getter for primary type. - * - * @return value of primary type. - */ - public String getType() { - return this.type; - } - - /** - * Checks if the primary type is a wildcard. - * - * @return true if the primary type is a wildcard. - */ - public boolean isWildcardType() { - return this.getType().equals(MEDIA_TYPE_WILDCARD); - } - - /** - * Getter for subtype. - * - * @return value of subtype. - */ - public String getSubtype() { - return this.subtype; - } - - /** - * Checks if the subtype is a wildcard. - * - * @return true if the subtype is a wildcard. - */ - public boolean isWildcardSubtype() { - return this.getSubtype().equals(MEDIA_TYPE_WILDCARD); - } - - /** - * Getter for a read-only parameter map. Keys are case-insensitive. - * - * @return an immutable map of parameters. - */ - public Map getParameters() { - return parameters; - } - - /** - * Create a new {@code MediaType} instance with the same type, subtype and parameters copied from - * the original instance and the supplied {@value #CHARSET_PARAMETER} parameter. - * - * @param charset the {@value #CHARSET_PARAMETER} parameter value. If {@code null} or empty the - * {@value #CHARSET_PARAMETER} parameter will not be set or updated. - * @return copy of the current {@code MediaType} instance with the {@value #CHARSET_PARAMETER} - * parameter set to the supplied value. - * @since 2.0 - */ - public MediaType withCharset(String charset) { - return new MediaType(this.type, this.subtype, charset, createParametersMap(this.parameters)); - } - - /** - * Check if this media type is compatible with another media type. E.g. image/* is compatible with - * image/jpeg, image/png, etc. Media type parameters are ignored. The function is commutative. - * - * @param other the media type to compare with. - * @return true if the types are compatible, false otherwise. - */ - public boolean isCompatible(MediaType other) { - return other != null - && // return false if other is null, else - (type.equals(MEDIA_TYPE_WILDCARD) - || other.type.equals(MEDIA_TYPE_WILDCARD) - || // both are wildcard types, or - (type.equalsIgnoreCase(other.type) - && (subtype.equals(MEDIA_TYPE_WILDCARD) - || other.subtype.equals(MEDIA_TYPE_WILDCARD))) - || // same types, wildcard sub-types, or - (type.equalsIgnoreCase(other.type) - && this.subtype.equalsIgnoreCase(other.subtype))); // same types & sub-types - } - - /** - * Compares {@code obj} to this media type to see if they are the same by comparing type, subtype - * and parameters. Note that the case-sensitivity of parameter values is dependent on the - * semantics of the parameter name, see {@link HTTP/1.1}. This method - * assumes that values are case-sensitive. - * - *

Note that the {@code equals(...)} implementation does not perform a class equality check - * ({@code this.getClass() == obj.getClass()}). Therefore any class that extends from {@code - * MediaType} class and needs to override one of the {@code equals(...)} and {@link #hashCode()} - * methods must always override both methods to ensure the contract between {@link - * Object#equals(Object)} and {@link Object#hashCode()} does not break. - * - * @param obj the object to compare to. - * @return true if the two media types are the same, false otherwise. - */ - @SuppressWarnings("UnnecessaryJavaDocLink") - @Override - public boolean equals(Object obj) { - if (!(obj instanceof MediaType)) { - return false; - } - - MediaType other = (MediaType) obj; - return (this.type.equalsIgnoreCase(other.type) - && this.subtype.equalsIgnoreCase(other.subtype) - && this.parameters.equals(other.parameters)); - } - - /** - * Generate a hash code from the type, subtype and parameters. - * - *

Note that the {@link #equals(Object)} implementation does not perform a class equality check - * ({@code this.getClass() == obj.getClass()}). Therefore any class that extends from {@code - * MediaType} class and needs to override one of the {@link #equals(Object)} and {@code - * hashCode()} methods must always override both methods to ensure the contract between {@link - * Object#equals(Object)} and {@link Object#hashCode()} does not break. - * - * @return a generated hash code. - */ - @SuppressWarnings("UnnecessaryJavaDocLink") - @Override - public int hashCode() { - return (this.type.toLowerCase() + this.subtype.toLowerCase()).hashCode() - + this.parameters.hashCode(); - } - - /** - * Convert the media type to a string suitable for use as the value of a corresponding HTTP - * header. - * - * @return a string version of the media type. - */ - @Override - public String toString() { - return type + "/" + subtype; - } -} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/ext/ParamConverter.java b/domino-rest-jaxrs/src/main/java/javax/ws/rs/ext/ParamConverter.java deleted file mode 100644 index 5be5f03..0000000 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/ext/ParamConverter.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package javax.ws.rs.ext; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import javax.ws.rs.DefaultValue; - -/** - * Defines a contract for a delegate responsible for converting between a {@code String} form of a - * message parameter value and the corresponding custom Java type {@code T}. - * - *

Conversion of message parameter values injected via {@link javax.ws.rs.PathParam - * @PathParam}, {@link javax.ws.rs.QueryParam @QueryParam}, {@link javax.ws.rs.MatrixParam - * @MatrixParam}, {@link javax.ws.rs.FormParam @FormParam}, {@link javax.ws.rs.CookieParam - * @CookieParam} and {@link javax.ws.rs.HeaderParam @HeaderParam} is supported. - * - *

By default, when used for injection of parameter values, a selected {@code ParamConverter} - * instance MUST be used eagerly by a JAX-RS runtime to convert any {@link DefaultValue default - * value} in the resource or provider model, that is during the application deployment, before any - * value – default or otherwise – is actually required. This conversion strategy ensures - * that any errors in the default values are reported as early as possible. This default behavior - * may be overridden by annotating the {@code ParamConverter} implementation class with a {@link - * Lazy @Lazy} annotation. In such case any default value conversion delegated to the - * {@code @Lazy}-annotated converter will be deferred to a latest possible moment (i.e. until the - * injection of such default value is required). - * - *

NOTE: A service implementing this contract is not recognized as a registrable JAX-RS extension - * provider. Instead, a {@link ParamConverterProvider} instance responsible for providing {@code - * ParamConverter} instances has to be registered as one of the JAX-RS extension providers. - * - * @param the supported Java type convertible to/from a {@code String} format. - * @author Marek Potociar - * @since 2.0 - */ -public interface ParamConverter { - - /** - * Mandates that a conversion of any {@link DefaultValue default value} delegated to a {@link - * ParamConverter parameter converter} annotated with {@code @Lazy} annotation SHOULD occur only - * once the value is actually required (e.g. to be injected for the first time). - * - * @since 2.0 - */ - @Target({ElementType.TYPE}) - @Retention(RetentionPolicy.RUNTIME) - @Documented - public static @interface Lazy {} - - /** - * Parse the supplied value and create an instance of {@code T}. - * - * @param value the string value. - * @return the newly created instance of {@code T}. - * @throws IllegalArgumentException if the supplied string cannot be parsed or is {@code null}. - */ - public T fromString(String value); - - /** - * Convert the supplied value to a String. - * - *

This method is reserved for future use. Proprietary JAX-RS extensions may leverage the - * method. Users should be aware that any such support for the method comes at the expense of - * producing non-portable code. - * - * @param value the value of type {@code T}. - * @return a String representation of the value. - * @throws IllegalArgumentException if the supplied object cannot be serialized or is {@code - * null}. - */ - public String toString(T value); -} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/ext/ParamConverterProvider.java b/domino-rest-jaxrs/src/main/java/javax/ws/rs/ext/ParamConverterProvider.java deleted file mode 100644 index f545f81..0000000 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/ext/ParamConverterProvider.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package javax.ws.rs.ext; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; - -/** - * Contract for a provider of {@link ParamConverter} instances. - * - *

Providers implementing {@code ParamConverterProvider} contract must be either programmatically - * registered in a JAX-RS runtime or must be annotated with {@link javax.ws.rs.ext.Provider - * @Provider} annotation to be automatically discovered by the JAX-RS runtime during a provider - * scanning phase. - * - * @author Marek Potociar - * @since 2.0 - */ -public interface ParamConverterProvider { - - /** - * Obtain a {@link ParamConverter} that can provide from/to string conversion for an instance of a - * particular Java type. - * - * @param the supported Java type convertible to/from a {@code String} format. - * @param rawType the raw type of the object to be converted. - * @param genericType the type of object to be converted. E.g. if an String value representing the - * injected request parameter is to be converted into a method parameter, this will be the - * formal type of the method parameter as returned by {@code Class.getGenericParameterTypes}. - * @param annotations an array of the annotations associated with the convertible parameter - * instance. E.g. if a string value is to be converted into a method parameter, this would be - * the annotations on that parameter as returned by {@link - * java.lang.reflect.Method#getParameterAnnotations}. - * @return the string converter, otherwise {@code null}. - */ - public ParamConverter getConverter( - Class rawType, Type genericType, Annotation annotations[]); -} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/package-info.java b/domino-rest-jaxrs/src/main/java/javax/ws/rs/package-info.java new file mode 100644 index 0000000..e77a6bc --- /dev/null +++ b/domino-rest-jaxrs/src/main/java/javax/ws/rs/package-info.java @@ -0,0 +1,16 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package javax.ws.rs; diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ApplicationPath.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ApplicationPath.java new file mode 100644 index 0000000..772bdf0 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ApplicationPath.java @@ -0,0 +1,34 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Documented +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +public @interface ApplicationPath { + + + String value(); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/BadRequestException.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/BadRequestException.java new file mode 100644 index 0000000..dbfafec --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/BadRequestException.java @@ -0,0 +1,22 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +public class BadRequestException extends ClientErrorException { + +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/BeanParam.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/BeanParam.java new file mode 100644 index 0000000..5781c8b --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/BeanParam.java @@ -0,0 +1,30 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface BeanParam {} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ClientErrorException.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ClientErrorException.java new file mode 100644 index 0000000..09f3412 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ClientErrorException.java @@ -0,0 +1,22 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +public class ClientErrorException extends RuntimeException { + +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ConstrainedTo.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ConstrainedTo.java new file mode 100644 index 0000000..3f0b34c --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ConstrainedTo.java @@ -0,0 +1,34 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface ConstrainedTo { + + + RuntimeType value(); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/Consumes.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/Consumes.java new file mode 100644 index 0000000..4ffa927 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/Consumes.java @@ -0,0 +1,36 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Inherited +@Target({ElementType.TYPE, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Consumes { + + + String[] value() default "*/*"; +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/CookieParam.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/CookieParam.java new file mode 100644 index 0000000..33c21b5 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/CookieParam.java @@ -0,0 +1,34 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface CookieParam { + + + String value(); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/DELETE.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/DELETE.java new file mode 100644 index 0000000..7027410 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/DELETE.java @@ -0,0 +1,31 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@HttpMethod(HttpMethod.DELETE) +@Documented +public @interface DELETE {} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/DefaultValue.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/DefaultValue.java new file mode 100644 index 0000000..f143818 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/DefaultValue.java @@ -0,0 +1,34 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface DefaultValue { + + + String value(); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/Encoded.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/Encoded.java new file mode 100644 index 0000000..3a4e558 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/Encoded.java @@ -0,0 +1,36 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ + ElementType.PARAMETER, + ElementType.METHOD, + ElementType.FIELD, + ElementType.CONSTRUCTOR, + ElementType.TYPE +}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Encoded {} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ForbiddenException.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ForbiddenException.java new file mode 100644 index 0000000..11188d5 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ForbiddenException.java @@ -0,0 +1,22 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +public class ForbiddenException extends ClientErrorException { + +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/FormParam.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/FormParam.java new file mode 100644 index 0000000..fff191d --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/FormParam.java @@ -0,0 +1,34 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface FormParam { + + + String value(); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/GET.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/GET.java new file mode 100644 index 0000000..1048bc5 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/GET.java @@ -0,0 +1,31 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@HttpMethod(HttpMethod.GET) +@Documented +public @interface GET {} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/GwtIncompatible.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/GwtIncompatible.java similarity index 80% rename from domino-rest-jaxrs/src/main/java/javax/ws/rs/GwtIncompatible.java rename to domino-rest-jaxrs/src/main/resources/javax/ws/rs/GwtIncompatible.java index 0f1cafd..2bb9c3b 100644 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/GwtIncompatible.java +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/GwtIncompatible.java @@ -13,14 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package javax.ws.rs; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + -/** - * Used to annotate code that incompatible with GWT annotated code will be stripped out during js - * compilation - */ @Retention(RetentionPolicy.CLASS) @Target({ ElementType.TYPE, ElementType.METHOD, diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/HEAD.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/HEAD.java new file mode 100644 index 0000000..60e13fd --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/HEAD.java @@ -0,0 +1,31 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@HttpMethod(HttpMethod.HEAD) +@Documented +public @interface HEAD {} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/HeaderParam.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/HeaderParam.java new file mode 100644 index 0000000..907180b --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/HeaderParam.java @@ -0,0 +1,34 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface HeaderParam { + + + String value(); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/HttpMethod.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/HttpMethod.java new file mode 100644 index 0000000..9c481f0 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/HttpMethod.java @@ -0,0 +1,47 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.ANNOTATION_TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface HttpMethod { + + + public static final String GET = "GET"; + + public static final String POST = "POST"; + + public static final String PUT = "PUT"; + + public static final String DELETE = "DELETE"; + + public static final String PATCH = "PATCH"; + + public static final String HEAD = "HEAD"; + + public static final String OPTIONS = "OPTIONS"; + + + String value(); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/InternalServerErrorException.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/InternalServerErrorException.java new file mode 100644 index 0000000..e5b4761 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/InternalServerErrorException.java @@ -0,0 +1,22 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +public class InternalServerErrorException extends ClientErrorException{ + +} diff --git a/domino-rest-jaxrs/src/main/module.gwt.xml b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/JaxRs.gwt.xml similarity index 100% rename from domino-rest-jaxrs/src/main/module.gwt.xml rename to domino-rest-jaxrs/src/main/resources/javax/ws/rs/JaxRs.gwt.xml diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/MatrixParam.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/MatrixParam.java new file mode 100644 index 0000000..e94d34d --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/MatrixParam.java @@ -0,0 +1,34 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface MatrixParam { + + + String value(); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/NameBinding.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/NameBinding.java new file mode 100644 index 0000000..e760096 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/NameBinding.java @@ -0,0 +1,30 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target(ElementType.ANNOTATION_TYPE) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface NameBinding {} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotAcceptableException.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotAcceptableException.java new file mode 100644 index 0000000..5ea71e5 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotAcceptableException.java @@ -0,0 +1,22 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +public class NotAcceptableException extends ClientErrorException{ + +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotAllowedException.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotAllowedException.java new file mode 100644 index 0000000..eb192d2 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotAllowedException.java @@ -0,0 +1,25 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +public class NotAllowedException extends ClientErrorException{ + + private static final long serialVersionUID = -586776054369626119L; + + +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotAuthorizedException.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotAuthorizedException.java new file mode 100644 index 0000000..28361f9 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotAuthorizedException.java @@ -0,0 +1,22 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +public class NotAuthorizedException extends ClientErrorException { + +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotFoundException.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotFoundException.java new file mode 100644 index 0000000..16816e0 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotFoundException.java @@ -0,0 +1,26 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + + +public class NotFoundException extends ClientErrorException { + + private static final long serialVersionUID = -6820866117511628388L; + + +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotSupportedException.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotSupportedException.java new file mode 100644 index 0000000..cbb97fd --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/NotSupportedException.java @@ -0,0 +1,26 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +public class NotSupportedException extends RuntimeException { + + private static final long serialVersionUID = -8286622745725405656L; + + + +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/OPTIONS.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/OPTIONS.java new file mode 100644 index 0000000..8eb08e6 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/OPTIONS.java @@ -0,0 +1,31 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@HttpMethod(HttpMethod.OPTIONS) +@Documented +public @interface OPTIONS {} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/PATCH.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/PATCH.java new file mode 100644 index 0000000..d12caec --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/PATCH.java @@ -0,0 +1,31 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@HttpMethod(HttpMethod.PATCH) +@Documented +public @interface PATCH {} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/POST.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/POST.java new file mode 100644 index 0000000..6ff996c --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/POST.java @@ -0,0 +1,31 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@HttpMethod(HttpMethod.POST) +@Documented +public @interface POST {} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/PUT.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/PUT.java new file mode 100644 index 0000000..5f0aea6 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/PUT.java @@ -0,0 +1,31 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@HttpMethod(HttpMethod.PUT) +@Documented +public @interface PUT {} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/Path.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/Path.java new file mode 100644 index 0000000..dd76df1 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/Path.java @@ -0,0 +1,34 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.TYPE, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Path { + + + String value(); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/PathParam.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/PathParam.java new file mode 100644 index 0000000..0c84e43 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/PathParam.java @@ -0,0 +1,34 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface PathParam { + + + String value(); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/Priorities.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/Priorities.java new file mode 100644 index 0000000..2e56dd1 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/Priorities.java @@ -0,0 +1,37 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + + +public final class Priorities { + + private Priorities() { + // prevents construction + } + + + public static final int AUTHENTICATION = 1000; + + public static final int AUTHORIZATION = 2000; + + public static final int HEADER_DECORATOR = 3000; + + public static final int ENTITY_CODER = 4000; + + public static final int USER = 5000; +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/Produces.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/Produces.java new file mode 100644 index 0000000..3d9b504 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/Produces.java @@ -0,0 +1,36 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Inherited +@Target({ElementType.TYPE, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Produces { + + + String[] value() default "*/*"; +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/QueryParam.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/QueryParam.java new file mode 100644 index 0000000..0d37874 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/QueryParam.java @@ -0,0 +1,34 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface QueryParam { + + + String value(); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/RuntimeType.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/RuntimeType.java new file mode 100644 index 0000000..67eaa1c --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/RuntimeType.java @@ -0,0 +1,26 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + + +public enum RuntimeType { + + CLIENT, + + SERVER +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ServiceUnavailableException.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ServiceUnavailableException.java new file mode 100644 index 0000000..e7e0503 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ServiceUnavailableException.java @@ -0,0 +1,24 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + + +public class ServiceUnavailableException { + + +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/WebApplicationException.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/WebApplicationException.java new file mode 100644 index 0000000..54a70d0 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/WebApplicationException.java @@ -0,0 +1,21 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs; + +public class WebApplicationException extends RuntimeException { +} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/container/AsyncResponse.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/AsyncResponse.java similarity index 100% rename from domino-rest-jaxrs/src/main/java/javax/ws/rs/container/AsyncResponse.java rename to domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/AsyncResponse.java diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/PUT.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/CompletionCallback.java similarity index 76% rename from domino-rest-jaxrs/src/main/java/javax/ws/rs/PUT.java rename to domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/CompletionCallback.java index 5aeee48..1ea637e 100644 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/PUT.java +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/CompletionCallback.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2010-2015 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -38,24 +38,9 @@ * holder. */ -package javax.ws.rs; +package javax.ws.rs.container; -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; +public interface CompletionCallback { -/** - * Indicates that the annotated method responds to HTTP PUT requests. - * - * @author Paul Sandoz - * @author Marc Hadley - * @see HttpMethod - * @since 1.0 - */ -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@HttpMethod(HttpMethod.PUT) -@Documented -public @interface PUT {} + public void onComplete(Throwable throwable); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ConnectionCallback.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ConnectionCallback.java new file mode 100644 index 0000000..ab82671 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ConnectionCallback.java @@ -0,0 +1,45 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2012-2015 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * http://glassfish.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ + +package javax.ws.rs.container; + +public interface ConnectionCallback { + public void onDisconnect(AsyncResponse disconnected); +} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/HttpMethod.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ContainerRequestContext.java similarity index 51% rename from domino-rest-jaxrs/src/main/java/javax/ws/rs/HttpMethod.java rename to domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ContainerRequestContext.java index 8e86629..bcf5beb 100644 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/HttpMethod.java +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ContainerRequestContext.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2010-2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -38,44 +38,74 @@ * holder. */ -package javax.ws.rs; +package javax.ws.rs.container; -import java.lang.annotation.*; +import java.io.InputStream; +import java.net.URI; +import java.util.Collection; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import javax.ws.rs.GwtIncompatible; +import javax.ws.rs.core.Cookie; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Request; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.core.UriInfo; -/** - * Associates the name of a HTTP method with an annotation. A Java method annotated with a runtime - * annotation that is itself annotated with this annotation will be used to handle HTTP requests of - * the indicated HTTP method. It is an error for a method to be annotated with more than one - * annotation that is annotated with {@code HttpMethod}. - * - * @author Paul Sandoz - * @author Marc Hadley - * @since 1.0 - */ -@Target({ElementType.ANNOTATION_TYPE}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface HttpMethod { - - /** HTTP GET method. */ - public static final String GET = "GET"; - /** HTTP POST method. */ - public static final String POST = "POST"; - /** HTTP PUT method. */ - public static final String PUT = "PUT"; - /** HTTP DELETE method. */ - public static final String DELETE = "DELETE"; - /** - * HTTP PATCH method. - * - * @since 2.1 - */ - public static final String PATCH = "PATCH"; - /** HTTP HEAD method. */ - public static final String HEAD = "HEAD"; - /** HTTP OPTIONS method. */ - public static final String OPTIONS = "OPTIONS"; - - /** Specifies the name of a HTTP method. E.g. "GET". */ - String value(); +public interface ContainerRequestContext { + + public Object getProperty(String name); + + public Collection getPropertyNames(); + + public void setProperty(String name, Object object); + + public void removeProperty(String name); + + public UriInfo getUriInfo(); + + @GwtIncompatible + public void setRequestUri(URI requestUri); + + @GwtIncompatible + public void setRequestUri(URI baseUri, URI requestUri); + + public Request getRequest(); + public String getMethod(); + + public void setMethod(String method); + public MultivaluedMap getHeaders(); + + public String getHeaderString(String name); + + public Date getDate(); + + @GwtIncompatible + public Locale getLanguage(); + public int getLength(); + + public MediaType getMediaType(); + public List getAcceptableMediaTypes(); + + @GwtIncompatible + public List getAcceptableLanguages(); + + public Map getCookies(); + public boolean hasEntity(); + + @GwtIncompatible + public InputStream getEntityStream(); + + @GwtIncompatible + public void setEntityStream(InputStream input); + + public SecurityContext getSecurityContext(); + + public void setSecurityContext(SecurityContext context); + + public void abortWith(Response response); } diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ContainerRequestFilter.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ContainerRequestFilter.java new file mode 100644 index 0000000..692a93c --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ContainerRequestFilter.java @@ -0,0 +1,45 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2012-2015 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * http://glassfish.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ + +package javax.ws.rs.container; + +public interface ContainerRequestFilter { + public void filter(ContainerRequestContext requestContext); +} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/BeanParam.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ContainerResponseContext.java similarity index 50% rename from domino-rest-jaxrs/src/main/java/javax/ws/rs/BeanParam.java rename to domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ContainerResponseContext.java index 60ffbcb..a86077e 100644 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/BeanParam.java +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ContainerResponseContext.java @@ -38,59 +38,82 @@ * holder. */ -package javax.ws.rs; +package javax.ws.rs.container; -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; +import java.io.OutputStream; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; +import java.net.URI; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import javax.ws.rs.GwtIncompatible; +import javax.ws.rs.core.EntityTag; +import javax.ws.rs.core.Link; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.NewCookie; +import javax.ws.rs.core.Response; -/** - * The annotation that may be used to inject custom JAX-RS "parameter aggregator" value object into - * a resource class field, property or resource method parameter. - * - *

The JAX-RS runtime will instantiate the object and inject all it's fields and properties - * annotated with either one of the {@code @XxxParam} annotation ({@link PathParam @PathParam}, - * {@link FormParam @FormParam} ...) or the {@link javax.ws.rs.core.Context @Context} - * annotation. For the POJO classes same instantiation and injection rules apply as in case of - * instantiation and injection of request-scoped root resource classes. - * - *

For example: - * - *

- * public class MyBean {
- *   @FormParam("myData")
- *   private String data;
- *
- *   @HeaderParam("myHeader")
- *   private String header;
- *
- *   @PathParam("id")
- *   public void setResourceId(String id) {...}
- *
- *   ...
- * }
- *
- * @Path("myresources")
- * public class MyResources {
- *   @POST
- *   @Path("{id}")
- *   public void post(@BeanParam MyBean myBean) {...}
- *
- *   ...
- * }
- * 
- * - *

Because injection occurs at object creation time, use of this annotation on resource class - * fields and bean properties is only supported for the default per-request resource class - * lifecycle. Resource classes using other lifecycles should only use this annotation on resource - * method parameters. - * - * @author Marek Potociar - * @since 2.0 - */ -@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface BeanParam {} +public interface ContainerResponseContext { + + public int getStatus(); + + public void setStatus(int code); + + public Response.StatusType getStatusInfo(); + public void setStatusInfo(Response.StatusType statusInfo); + + public MultivaluedMap getHeaders(); + + public abstract MultivaluedMap getStringHeaders(); + + public String getHeaderString(String name); + public Set getAllowedMethods(); + public Date getDate(); + @GwtIncompatible + public Locale getLanguage(); + + public int getLength(); + + public MediaType getMediaType(); + + public Map getCookies(); + + public EntityTag getEntityTag(); + + public Date getLastModified(); + + @GwtIncompatible + public URI getLocation(); + public Set getLinks(); + + boolean hasLink(String relation); + + public Link getLink(String relation); + + public Link.Builder getLinkBuilder(String relation); + + public boolean hasEntity(); + public Object getEntity(); + + public Class getEntityClass(); + @GwtIncompatible + public Type getEntityType(); + + public void setEntity(final Object entity); + + @GwtIncompatible + public void setEntity( + final Object entity, final Annotation[] annotations, final MediaType mediaType); + + @GwtIncompatible + public Annotation[] getEntityAnnotations(); + + @GwtIncompatible + public OutputStream getEntityStream(); + + @GwtIncompatible + public void setEntityStream(OutputStream outputStream); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ContainerResponseFilter.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ContainerResponseFilter.java new file mode 100644 index 0000000..9f67f8f --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ContainerResponseFilter.java @@ -0,0 +1,48 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2012-2015 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * http://glassfish.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ + +package javax.ws.rs.container; + +public interface ContainerResponseFilter { + + + public void filter( + ContainerRequestContext requestContext, ContainerResponseContext responseContext); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/DynamicFeature.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/DynamicFeature.java new file mode 100644 index 0000000..375128b --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/DynamicFeature.java @@ -0,0 +1,48 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2011-2015 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * http://glassfish.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ + +package javax.ws.rs.container; + +import javax.ws.rs.core.FeatureContext; + +public interface DynamicFeature { + + public void configure(ResourceInfo resourceInfo, FeatureContext context); +} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/GET.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/PreMatching.java similarity index 87% rename from domino-rest-jaxrs/src/main/java/javax/ws/rs/GET.java rename to domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/PreMatching.java index a1e41df..5965bf5 100644 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/GET.java +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/PreMatching.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2010-2015 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -38,7 +38,7 @@ * holder. */ -package javax.ws.rs; +package javax.ws.rs.container; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; @@ -46,15 +46,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -/** - * Indicates that the annotated method responds to HTTP GET requests. - * - * @author Paul Sandoz - * @author Marc Hadley - * @since 1.0 - */ -@Target({ElementType.METHOD}) +@Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) -@HttpMethod(HttpMethod.GET) @Documented -public @interface GET {} +public @interface PreMatching {} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ResourceContext.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ResourceContext.java new file mode 100644 index 0000000..fdcc2e2 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ResourceContext.java @@ -0,0 +1,48 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2012-2015 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * http://glassfish.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ + +package javax.ws.rs.container; + +public interface ResourceContext { + + public T getResource(Class resourceClass); + + public T initResource(T resource); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ResourceInfo.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ResourceInfo.java new file mode 100644 index 0000000..d27fe59 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/ResourceInfo.java @@ -0,0 +1,52 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2011-2015 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * http://glassfish.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ + +package javax.ws.rs.container; + +import java.lang.reflect.Method; +import javax.ws.rs.GwtIncompatible; + +public interface ResourceInfo { + + @GwtIncompatible + Method getResourceMethod(); + + Class getResourceClass(); +} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/container/Suspended.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/Suspended.java similarity index 94% rename from domino-rest-jaxrs/src/main/java/javax/ws/rs/container/Suspended.java rename to domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/Suspended.java index 0779bb5..1ce36d4 100644 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/container/Suspended.java +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/Suspended.java @@ -46,10 +46,6 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -/** - * Used for emulating Context in domino-rest, arguments annotated with this annotation will be - * ignored in domino-rest client generation - */ @Target({ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) @Documented diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/container/TimeoutHandler.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/TimeoutHandler.java similarity index 85% rename from domino-rest-jaxrs/src/main/java/javax/ws/rs/container/TimeoutHandler.java rename to domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/TimeoutHandler.java index 4333a14..fd11849 100644 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/container/TimeoutHandler.java +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/TimeoutHandler.java @@ -17,10 +17,6 @@ import javax.ws.rs.GwtIncompatible; -/** - * Used for emulating Context in domino-rest, arguments of this type will be ignored in domino-rest - * client generation - */ @GwtIncompatible public interface TimeoutHandler { void handleTimeout(AsyncResponse asyncResponse); diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/package-info.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/package-info.java new file mode 100644 index 0000000..4e92ddd --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/container/package-info.java @@ -0,0 +1,42 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2012-2015 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * http://glassfish.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ + +/** Container-specific JAX-RS API. */ +package javax.ws.rs.container; diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/AbstractMultivaluedMap.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/AbstractMultivaluedMap.java new file mode 100644 index 0000000..648c1b7 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/AbstractMultivaluedMap.java @@ -0,0 +1,261 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2012-2015 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * http://glassfish.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ + +package javax.ws.rs.core; + +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public abstract class AbstractMultivaluedMap implements MultivaluedMap { + + protected final Map> store; + + public AbstractMultivaluedMap(Map> store) { + if (store == null) { + throw new NullPointerException("Underlying store must not be 'null'."); + } + this.store = store; + } + + + @Override + public final void putSingle(K key, V value) { + List values = getValues(key); + + values.clear(); + if (value != null) { + values.add(value); + } else { + addNull(values); + } + } + + @SuppressWarnings("UnusedParameters") + protected void addNull(List values) { + // do nothing in the default implementation; ignore the null value + } + + @SuppressWarnings("UnusedParameters") + protected void addFirstNull(List values) { + // do nothing in the default implementation; ignore the null value + } + + @Override + public final void add(K key, V value) { + List values = getValues(key); + + if (value != null) { + values.add(value); + } else { + addNull(values); + } + } + + @Override + public final void addAll(K key, V... newValues) { + if (newValues == null) { + throw new NullPointerException("Supplied array of values must not be null."); + } + if (newValues.length == 0) { + return; + } + + List values = getValues(key); + + for (V value : newValues) { + if (value != null) { + values.add(value); + } else { + addNull(values); + } + } + } + + @Override + public final void addAll(K key, List valueList) { + if (valueList == null) { + throw new NullPointerException("Supplied list of values must not be null."); + } + if (valueList.isEmpty()) { + return; + } + + List values = getValues(key); + + for (V value : valueList) { + if (value != null) { + values.add(value); + } else { + addNull(values); + } + } + } + + @Override + public final V getFirst(K key) { + List values = store.get(key); + if (values != null && values.size() > 0) { + return values.get(0); + } else { + return null; + } + } + + @Override + public final void addFirst(K key, V value) { + List values = getValues(key); + + if (value != null) { + values.add(0, value); + } else { + addFirstNull(values); + } + } + + protected final List getValues(K key) { + List l = store.get(key); + if (l == null) { + l = new LinkedList(); + store.put(key, l); + } + return l; + } + + @Override + public String toString() { + return store.toString(); + } + + @Override + public int hashCode() { + return store.hashCode(); + } + + @Override + @SuppressWarnings("EqualsWhichDoesntCheckParameterClass") + public boolean equals(Object o) { + return store.equals(o); + } + + @Override + public Collection> values() { + return store.values(); + } + + @Override + public int size() { + return store.size(); + } + + @Override + public List remove(Object key) { + return store.remove(key); + } + + @Override + public void putAll(Map> m) { + store.putAll(m); + } + + @Override + public List put(K key, List value) { + return store.put(key, value); + } + + @Override + public Set keySet() { + return store.keySet(); + } + + @Override + public boolean isEmpty() { + return store.isEmpty(); + } + + @Override + public List get(Object key) { + return store.get(key); + } + + @Override + public Set>> entrySet() { + return store.entrySet(); + } + + @Override + public boolean containsValue(Object value) { + return store.containsValue(value); + } + + @Override + public boolean containsKey(Object key) { + return store.containsKey(key); + } + + @Override + public void clear() { + store.clear(); + } + + @Override + public boolean equalsIgnoreValueOrder(MultivaluedMap omap) { + if (this == omap) { + return true; + } + if (!keySet().equals(omap.keySet())) { + return false; + } + for (Entry> e : entrySet()) { + List olist = omap.get(e.getKey()); + if (e.getValue().size() != olist.size()) { + return false; + } + for (V v : e.getValue()) { + if (!olist.contains(v)) { + return false; + } + } + } + return true; + } +} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/core/Context.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Application.java similarity index 80% rename from domino-rest-jaxrs/src/main/java/javax/ws/rs/core/Context.java rename to domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Application.java index 162f87c..70fa339 100644 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/core/Context.java +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Application.java @@ -40,17 +40,21 @@ package javax.ws.rs.core; -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; +import java.util.Collections; +import java.util.Map; +import java.util.Set; -/** - * Used for emulating Context in domino-rest, arguments annotated with this annotation will be - * ignored in domino-rest client generation - */ -@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface Context {} +public class Application { + + public Set> getClasses() { + return Collections.emptySet(); + } + + public Set getSingletons() { + return Collections.emptySet(); + } + + public Map getProperties() { + return Collections.emptyMap(); + } +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/CacheControl.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/CacheControl.java new file mode 100644 index 0000000..62e6845 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/CacheControl.java @@ -0,0 +1,269 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.GwtIncompatible; +import javax.ws.rs.ext.RuntimeDelegate; +import javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate; + +@GwtIncompatible +public class CacheControl { + + private static final HeaderDelegate HEADER_DELEGATE = + RuntimeDelegate.getInstance().createHeaderDelegate(CacheControl.class); + private List privateFields; + private List noCacheFields; + private Map cacheExtension; + + private boolean privateFlag; + private boolean noCache; + private boolean noStore; + private boolean noTransform; + private boolean mustRevalidate; + private boolean proxyRevalidate; + private int maxAge = -1; + private int sMaxAge = -1; + + public CacheControl() { + privateFlag = false; + noCache = false; + noStore = false; + noTransform = true; + mustRevalidate = false; + proxyRevalidate = false; + } + + public static CacheControl valueOf(final String value) { + return HEADER_DELEGATE.fromString(value); + } + + public boolean isMustRevalidate() { + return mustRevalidate; + } + + public void setMustRevalidate(final boolean mustRevalidate) { + this.mustRevalidate = mustRevalidate; + } + + public boolean isProxyRevalidate() { + return proxyRevalidate; + } + + public void setProxyRevalidate(final boolean proxyRevalidate) { + this.proxyRevalidate = proxyRevalidate; + } + public int getMaxAge() { + return maxAge; + } + + public void setMaxAge(final int maxAge) { + this.maxAge = maxAge; + } + + public int getSMaxAge() { + return sMaxAge; + } + + + public void setSMaxAge(final int sMaxAge) { + this.sMaxAge = sMaxAge; + } + + + public List getNoCacheFields() { + if (noCacheFields == null) { + noCacheFields = new ArrayList(); + } + return noCacheFields; + } + + + public void setNoCache(final boolean noCache) { + this.noCache = noCache; + } + + + public boolean isNoCache() { + return noCache; + } + + + public boolean isPrivate() { + return privateFlag; + } + + + public List getPrivateFields() { + if (privateFields == null) { + privateFields = new ArrayList(); + } + return privateFields; + } + + + public void setPrivate(final boolean flag) { + this.privateFlag = flag; + } + + + public boolean isNoTransform() { + return noTransform; + } + + + public void setNoTransform(final boolean noTransform) { + this.noTransform = noTransform; + } + + + public boolean isNoStore() { + return noStore; + } + + + public void setNoStore(final boolean noStore) { + this.noStore = noStore; + } + + + public Map getCacheExtension() { + if (cacheExtension == null) { + cacheExtension = new HashMap(); + } + return cacheExtension; + } + + + @Override + public String toString() { + return HEADER_DELEGATE.toString(this); + } + + + @Override + public int hashCode() { + int hash = 7; + hash = 41 * hash + (this.privateFlag ? 1 : 0); + hash = 41 * hash + (this.noCache ? 1 : 0); + hash = 41 * hash + (this.noStore ? 1 : 0); + hash = 41 * hash + (this.noTransform ? 1 : 0); + hash = 41 * hash + (this.mustRevalidate ? 1 : 0); + hash = 41 * hash + (this.proxyRevalidate ? 1 : 0); + hash = 41 * hash + this.maxAge; + hash = 41 * hash + this.sMaxAge; + hash = 41 * hash + hashCodeOf(this.privateFields); + hash = 41 * hash + hashCodeOf(this.noCacheFields); + hash = 41 * hash + hashCodeOf(this.cacheExtension); + return hash; + } + + + @Override + public boolean equals(final Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CacheControl other = (CacheControl) obj; + if (this.privateFlag != other.privateFlag) { + return false; + } + if (this.noCache != other.noCache) { + return false; + } + if (this.noStore != other.noStore) { + return false; + } + if (this.noTransform != other.noTransform) { + return false; + } + if (this.mustRevalidate != other.mustRevalidate) { + return false; + } + if (this.proxyRevalidate != other.proxyRevalidate) { + return false; + } + if (this.maxAge != other.maxAge) { + return false; + } + if (this.sMaxAge != other.sMaxAge) { + return false; + } + if (notEqual(this.privateFields, other.privateFields)) { + return false; + } + if (notEqual(this.noCacheFields, other.noCacheFields)) { + return false; + } + if (notEqual(this.cacheExtension, other.cacheExtension)) { + return false; + } + return true; + } + + + private static boolean notEqual(Collection first, Collection second) { + if (first == second) { + return false; + } + if (first == null) { + // if first is 'null', consider equal to empty + return !second.isEmpty(); + } + if (second == null) { + // if second is 'null', consider equal to empty + return !first.isEmpty(); + } + + return !first.equals(second); + } + + + private static boolean notEqual(Map first, Map second) { + if (first == second) { + return false; + } + if (first == null) { + // if first is 'null', consider equal to empty + return !second.isEmpty(); + } + if (second == null) { + // if second is 'null', consider equal to empty + return !first.isEmpty(); + } + + return !first.equals(second); + } + + + private static int hashCodeOf(Collection instance) { + return (instance == null || instance.isEmpty()) ? 0 : instance.hashCode(); + } + + + private static int hashCodeOf(Map instance) { + return (instance == null || instance.isEmpty()) ? 0 : instance.hashCode(); + } +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Configurable.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Configurable.java new file mode 100644 index 0000000..221ba6b --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Configurable.java @@ -0,0 +1,54 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + +import java.util.Map; + + +public interface Configurable { + + + public Configuration getConfiguration(); + + + public C property(String name, Object value); + + + public C register(Class componentClass); + + + public C register(Class componentClass, int priority); + + + public C register(Class componentClass, Class... contracts); + + + public C register(Class componentClass, Map, Integer> contracts); + + + public C register(Object component); + + + public C register(Object component, int priority); + + + public C register(Object component, Class... contracts); + + + public C register(Object component, Map, Integer> contracts); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Configuration.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Configuration.java new file mode 100644 index 0000000..46170e2 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Configuration.java @@ -0,0 +1,58 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package javax.ws.rs.core; + +import java.util.Collection; +import java.util.Map; +import java.util.Set; +import javax.ws.rs.RuntimeType; + + +public interface Configuration { + + + public RuntimeType getRuntimeType(); + + + public Map getProperties(); + + + public Object getProperty(String name); + + + public Collection getPropertyNames(); + + + public boolean isEnabled(Feature feature); + + + public boolean isEnabled(Class featureClass); + + + public boolean isRegistered(Object component); + + + public boolean isRegistered(Class componentClass); + + + public Map, Integer> getContracts(Class componentClass); + + + public Set> getClasses(); + + + public Set getInstances(); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Context.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Context.java new file mode 100644 index 0000000..74dafbd --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Context.java @@ -0,0 +1,30 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Context {} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Cookie.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Cookie.java new file mode 100644 index 0000000..83f7ed2 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Cookie.java @@ -0,0 +1,123 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package javax.ws.rs.core; + +public class Cookie { + + public static final int DEFAULT_VERSION = 1; + + private final String name; + private final String value; + private final int version; + private final String path; + private final String domain; + + public Cookie( + final String name, + final String value, + final String path, + final String domain, + final int version) + throws IllegalArgumentException { + if (name == null) { + throw new IllegalArgumentException("name==null"); + } + this.name = name; + this.value = value; + this.version = version; + this.domain = domain; + this.path = path; + } + + + public Cookie(final String name, final String value, final String path, final String domain) + throws IllegalArgumentException { + this(name, value, path, domain, DEFAULT_VERSION); + } + + public Cookie(final String name, final String value) throws IllegalArgumentException { + this(name, value, null, null); + } + + public static Cookie valueOf(final String value) { + return null; + } + + public String getName() { + return name; + } + + public String getValue() { + return value; + } + + public int getVersion() { + return version; + } + + public String getDomain() { + return domain; + } + + public String getPath() { + return path; + } + + @Override + public String toString() { + return null; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 97 * hash + (this.name != null ? this.name.hashCode() : 0); + hash = 97 * hash + (this.value != null ? this.value.hashCode() : 0); + hash = 97 * hash + this.version; + hash = 97 * hash + (this.path != null ? this.path.hashCode() : 0); + hash = 97 * hash + (this.domain != null ? this.domain.hashCode() : 0); + return hash; + } + + + @SuppressWarnings({"StringEquality", "RedundantIfStatement"}) + @Override + public boolean equals(final Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Cookie other = (Cookie) obj; + if (this.name != other.name && (this.name == null || !this.name.equals(other.name))) { + return false; + } + if (this.value != other.value && (this.value == null || !this.value.equals(other.value))) { + return false; + } + if (this.version != other.version) { + return false; + } + if (this.path != other.path && (this.path == null || !this.path.equals(other.path))) { + return false; + } + if (this.domain != other.domain && (this.domain == null || !this.domain.equals(other.domain))) { + return false; + } + return true; + } +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/EntityTag.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/EntityTag.java new file mode 100644 index 0000000..9f3e3c4 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/EntityTag.java @@ -0,0 +1,73 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package javax.ws.rs.core; +public class EntityTag { + + private String value; + private boolean weak; + + public EntityTag(final String value) { + this(value, false); + } + + public EntityTag(final String value, final boolean weak) { + if (value == null) { + throw new IllegalArgumentException("value==null"); + } + this.value = value; + this.weak = weak; + } + + public static EntityTag valueOf(final String value) { + return null; + } + + public boolean isWeak() { + return weak; + } + + public String getValue() { + return value; + } + + @Override + public boolean equals(final Object obj) { + if (obj == null) { + return false; + } + if (!(obj instanceof EntityTag)) { + return super.equals(obj); + } + EntityTag other = (EntityTag) obj; + if (value.equals(other.getValue()) && weak == other.isWeak()) { + return true; + } + return false; + } + + @Override + public int hashCode() { + int hash = 3; + hash = 17 * hash + (this.value != null ? this.value.hashCode() : 0); + hash = 17 * hash + (this.weak ? 1 : 0); + return hash; + } + + @Override + public String toString() { + return null; + } +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Feature.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Feature.java new file mode 100644 index 0000000..171f06c --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Feature.java @@ -0,0 +1,25 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + + +public interface Feature { + + + public boolean configure(FeatureContext context); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/FeatureContext.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/FeatureContext.java new file mode 100644 index 0000000..9c0e176 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/FeatureContext.java @@ -0,0 +1,21 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + + +public interface FeatureContext extends Configurable {} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Form.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Form.java new file mode 100644 index 0000000..a6bcf17 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Form.java @@ -0,0 +1,58 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + +import java.util.LinkedHashMap; +import java.util.List; + + +public class Form { + private final MultivaluedMap parameters; + + + public Form() { + this( + new AbstractMultivaluedMap(new LinkedHashMap>()) { + // by default, the items in a Form are iterable based on their insertion order. + }); + } + + + public Form(final String parameterName, final String parameterValue) { + this(); + + parameters.add(parameterName, parameterValue); + } + + + public Form(final MultivaluedMap store) { + this.parameters = store; + } + + + public Form param(final String name, final String value) { + parameters.add(name, value); + + return this; + } + + + public MultivaluedMap asMap() { + return parameters; + } +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/GenericEntity.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/GenericEntity.java new file mode 100644 index 0000000..3836839 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/GenericEntity.java @@ -0,0 +1,63 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + +import javax.ws.rs.GwtIncompatible; + + +@GwtIncompatible +public class GenericEntity { + + private final Class rawType; + private final T entity; + + + protected GenericEntity(final T entity) { + if (entity == null) { + throw new IllegalArgumentException("The entity must not be null"); + } + this.entity = entity; + this.rawType = entity.getClass(); + } + + + + public final Class getRawType() { + return rawType; + } + + + public final T getEntity() { + return entity; + } + + @Override + public boolean equals(Object obj) { + return false; + } + + @Override + public int hashCode() { + return entity.hashCode(); + } + + @Override + public String toString() { + return "GenericEntity{" + entity.toString()+ "}"; + } +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/GenericType.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/GenericType.java new file mode 100644 index 0000000..b848555 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/GenericType.java @@ -0,0 +1,45 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2010-2017 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * http://glassfish.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ + +package javax.ws.rs.core; + +public class GenericType { + +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/HttpHeaders.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/HttpHeaders.java new file mode 100644 index 0000000..e7e6e49 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/HttpHeaders.java @@ -0,0 +1,125 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import javax.ws.rs.GwtIncompatible; + + +public interface HttpHeaders { + + + public List getRequestHeader(String name); + + + public String getHeaderString(String name); + + + public MultivaluedMap getRequestHeaders(); + + + public List getAcceptableMediaTypes(); + + + @GwtIncompatible + public List getAcceptableLanguages(); + + + public MediaType getMediaType(); + + + @GwtIncompatible + public Locale getLanguage(); + + + public Map getCookies(); + + + public Date getDate(); + + + public int getLength(); + + + public static final String ACCEPT = "Accept"; + + public static final String ACCEPT_CHARSET = "Accept-Charset"; + + public static final String ACCEPT_ENCODING = "Accept-Encoding"; + + public static final String ACCEPT_LANGUAGE = "Accept-Language"; + + public static final String ALLOW = "Allow"; + + public static final String AUTHORIZATION = "Authorization"; + + public static final String CACHE_CONTROL = "Cache-Control"; + + public static final String CONTENT_DISPOSITION = "Content-Disposition"; + + public static final String CONTENT_ENCODING = "Content-Encoding"; + + public static final String CONTENT_ID = "Content-ID"; + + public static final String CONTENT_LANGUAGE = "Content-Language"; + + public static final String CONTENT_LENGTH = "Content-Length"; + + public static final String CONTENT_LOCATION = "Content-Location"; + + public static final String CONTENT_TYPE = "Content-Type"; + + public static final String DATE = "Date"; + + public static final String ETAG = "ETag"; + + public static final String EXPIRES = "Expires"; + + public static final String HOST = "Host"; + + public static final String IF_MATCH = "If-Match"; + + public static final String IF_MODIFIED_SINCE = "If-Modified-Since"; + + public static final String IF_NONE_MATCH = "If-None-Match"; + + public static final String IF_UNMODIFIED_SINCE = "If-Unmodified-Since"; + + public static final String LAST_MODIFIED = "Last-Modified"; + + public static final String LOCATION = "Location"; + + public static final String LINK = "Link"; + + public static final String RETRY_AFTER = "Retry-After"; + + public static final String USER_AGENT = "User-Agent"; + + public static final String VARY = "Vary"; + + public static final String WWW_AUTHENTICATE = "WWW-Authenticate"; + + public static final String COOKIE = "Cookie"; + + public static final String SET_COOKIE = "Set-Cookie"; + + public static final String LAST_EVENT_ID_HEADER = "Last-Event-ID"; +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Link.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Link.java new file mode 100644 index 0000000..53902ac --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Link.java @@ -0,0 +1,54 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package javax.ws.rs.core; + +import java.util.List; +import java.util.Map; + + +public abstract class Link { + + public static final String TITLE = "title"; + + public static final String REL = "rel"; + + public static final String TYPE = "type"; + + public abstract UriBuilder getUriBuilder(); + + public abstract String getRel(); + + public abstract List getRels(); + + public abstract String getTitle(); + + public abstract String getType(); + + public abstract Map getParams(); + + @Override + public abstract String toString(); + + public interface Builder { + } + + public static class JaxbLink { + + } + + public static class JaxbAdapter {} +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/MediaType.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/MediaType.java new file mode 100644 index 0000000..138c5ae --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/MediaType.java @@ -0,0 +1,240 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + +import java.util.Collections; +import java.util.Comparator; +import java.util.Map; +import java.util.TreeMap; +import javax.ws.rs.GwtIncompatible; +import javax.ws.rs.ext.RuntimeDelegate; + + +@SuppressWarnings("JavaDoc") +public class MediaType { + + private String type; + private String subtype; + private Map parameters; + + + public static final String CHARSET_PARAMETER = "charset"; + + public static final String MEDIA_TYPE_WILDCARD = "*"; + // Common media type constants + + public static final String WILDCARD = "*"; + public static final MediaType WILDCARD_TYPE = new MediaType(); + + public static final String APPLICATION_XML = "application/xml"; + + public static final MediaType APPLICATION_XML_TYPE = new MediaType("application", "xml"); + + public static final String APPLICATION_ATOM_XML = "application/atom+xml"; + + public static final MediaType APPLICATION_ATOM_XML_TYPE = + new MediaType("application", "atom+xml"); + + public static final String APPLICATION_XHTML_XML = "application/xhtml+xml"; + + public static final MediaType APPLICATION_XHTML_XML_TYPE = + new MediaType("application", "xhtml+xml"); + + public static final String APPLICATION_SVG_XML = "application/svg+xml"; + + public static final MediaType APPLICATION_SVG_XML_TYPE = new MediaType("application", "svg+xml"); + + public static final String APPLICATION_JSON = "application/json"; + + public static final MediaType APPLICATION_JSON_TYPE = new MediaType("application", "json"); + + public static final String APPLICATION_FORM_URLENCODED = "application/x-www-form-urlencoded"; + + public static final MediaType APPLICATION_FORM_URLENCODED_TYPE = + new MediaType("application", "x-www-form-urlencoded"); + + public static final String MULTIPART_FORM_DATA = "multipart/form-data"; + + public static final MediaType MULTIPART_FORM_DATA_TYPE = new MediaType("multipart", "form-data"); + + public static final String APPLICATION_OCTET_STREAM = "application/octet-stream"; + + public static final MediaType APPLICATION_OCTET_STREAM_TYPE = + new MediaType("application", "octet-stream"); + + public static final String TEXT_PLAIN = "text/plain"; + + public static final MediaType TEXT_PLAIN_TYPE = new MediaType("text", "plain"); + + public static final String TEXT_XML = "text/xml"; + + public static final MediaType TEXT_XML_TYPE = new MediaType("text", "xml"); + + public static final String TEXT_HTML = "text/html"; + + public static final MediaType TEXT_HTML_TYPE = new MediaType("text", "html"); + + public static final String SERVER_SENT_EVENTS = "text/event-stream"; + + public static final MediaType SERVER_SENT_EVENTS_TYPE = new MediaType("text", "event-stream"); + + public static final String APPLICATION_JSON_PATCH_JSON = "application/json-patch+json"; + + public static final MediaType APPLICATION_JSON_PATCH_JSON_TYPE = + new MediaType("application", "json-patch+json"); + + + @GwtIncompatible + public static MediaType valueOf(String type) { + return RuntimeDelegate.getInstance().createHeaderDelegate(MediaType.class).fromString(type); + } + + private static TreeMap createParametersMap(Map initialValues) { + final TreeMap map = + new TreeMap( + new Comparator() { + + @Override + public int compare(String o1, String o2) { + return o1.compareToIgnoreCase(o2); + } + }); + if (initialValues != null) { + for (Map.Entry e : initialValues.entrySet()) { + map.put(e.getKey().toLowerCase(), e.getValue()); + } + } + return map; + } + + + public MediaType(String type, String subtype, Map parameters) { + this(type, subtype, null, createParametersMap(parameters)); + } + + + public MediaType(String type, String subtype) { + this(type, subtype, null, null); + } + + + public MediaType(String type, String subtype, String charset) { + this(type, subtype, charset, null); + } + + + public MediaType() { + this(MEDIA_TYPE_WILDCARD, MEDIA_TYPE_WILDCARD, null, null); + } + + private MediaType(String type, String subtype, String charset, Map parameterMap) { + + this.type = type == null ? MEDIA_TYPE_WILDCARD : type; + this.subtype = subtype == null ? MEDIA_TYPE_WILDCARD : subtype; + + if (parameterMap == null) { + parameterMap = + new TreeMap( + new Comparator() { + + @Override + public int compare(String o1, String o2) { + return o1.compareToIgnoreCase(o2); + } + }); + } + + if (charset != null && !charset.isEmpty()) { + parameterMap.put(CHARSET_PARAMETER, charset); + } + this.parameters = Collections.unmodifiableMap(parameterMap); + } + + + public String getType() { + return this.type; + } + + + public boolean isWildcardType() { + return this.getType().equals(MEDIA_TYPE_WILDCARD); + } + + + public String getSubtype() { + return this.subtype; + } + + + public boolean isWildcardSubtype() { + return this.getSubtype().equals(MEDIA_TYPE_WILDCARD); + } + + + public Map getParameters() { + return parameters; + } + + + public MediaType withCharset(String charset) { + return new MediaType(this.type, this.subtype, charset, createParametersMap(this.parameters)); + } + + + public boolean isCompatible(MediaType other) { + return other != null + && // return false if other is null, else + (type.equals(MEDIA_TYPE_WILDCARD) + || other.type.equals(MEDIA_TYPE_WILDCARD) + || // both are wildcard types, or + (type.equalsIgnoreCase(other.type) + && (subtype.equals(MEDIA_TYPE_WILDCARD) + || other.subtype.equals(MEDIA_TYPE_WILDCARD))) + || // same types, wildcard sub-types, or + (type.equalsIgnoreCase(other.type) + && this.subtype.equalsIgnoreCase(other.subtype))); // same types & sub-types + } + + + @SuppressWarnings("UnnecessaryJavaDocLink") + @Override + public boolean equals(Object obj) { + if (!(obj instanceof MediaType)) { + return false; + } + + MediaType other = (MediaType) obj; + return (this.type.equalsIgnoreCase(other.type) + && this.subtype.equalsIgnoreCase(other.subtype) + && this.parameters.equals(other.parameters)); + } + + + @SuppressWarnings("UnnecessaryJavaDocLink") + @Override + public int hashCode() { + return (this.type.toLowerCase() + this.subtype.toLowerCase()).hashCode() + + this.parameters.hashCode(); + } + + + @Override + public String toString() { + return RuntimeDelegate.getInstance().createHeaderDelegate(MediaType.class).toString(this); + } +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/MultivaluedHashMap.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/MultivaluedHashMap.java new file mode 100644 index 0000000..4d04cf7 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/MultivaluedHashMap.java @@ -0,0 +1,66 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class MultivaluedHashMap extends AbstractMultivaluedMap implements Serializable { + + private static final long serialVersionUID = -6052320403766368902L; + + + public MultivaluedHashMap() { + super(new HashMap>()); + } + + + public MultivaluedHashMap(int initialCapacity) { + super(new HashMap>(initialCapacity)); + } + + + public MultivaluedHashMap(int initialCapacity, float loadFactor) { + super(new HashMap>(initialCapacity, loadFactor)); + } + + + public MultivaluedHashMap(MultivaluedMap map) { + this(); + putAll(map); + } + + + private void putAll(MultivaluedMap map) { + for (Entry> e : map.entrySet()) { + store.put(e.getKey(), new ArrayList(e.getValue())); + } + } + + + public MultivaluedHashMap(Map map) { + this(); + for (Entry e : map.entrySet()) { + this.putSingle(e.getKey(), e.getValue()); + } + } +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/MultivaluedMap.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/MultivaluedMap.java new file mode 100644 index 0000000..1215ada --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/MultivaluedMap.java @@ -0,0 +1,46 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + +import java.util.List; +import java.util.Map; + + +public interface MultivaluedMap extends Map> { + + + void putSingle(K key, V value); + + + void add(K key, V value); + + + V getFirst(K key); + + + void addAll(K key, V... newValues); + + + void addAll(K key, List valueList); + + + void addFirst(K key, V value); + + + boolean equalsIgnoreValueOrder(MultivaluedMap otherMap); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/NewCookie.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/NewCookie.java new file mode 100644 index 0000000..4f2f21f --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/NewCookie.java @@ -0,0 +1,232 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + +import java.util.Date; +import javax.ws.rs.GwtIncompatible; +import javax.ws.rs.ext.RuntimeDelegate; +import javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate; + +public class NewCookie extends Cookie { + + + public static final int DEFAULT_MAX_AGE = -1; + + private static final HeaderDelegate delegate = + RuntimeDelegate.getInstance().createHeaderDelegate(NewCookie.class); + + private final String comment; + private final int maxAge; + private final Date expiry; + private final boolean secure; + private final boolean httpOnly; + + + public NewCookie(String name, String value) { + this(name, value, null, null, DEFAULT_VERSION, null, DEFAULT_MAX_AGE, null, false, false); + } + + + public NewCookie( + String name, + String value, + String path, + String domain, + String comment, + int maxAge, + boolean secure) { + this(name, value, path, domain, DEFAULT_VERSION, comment, maxAge, null, secure, false); + } + + + public NewCookie( + String name, + String value, + String path, + String domain, + String comment, + int maxAge, + boolean secure, + boolean httpOnly) { + this(name, value, path, domain, DEFAULT_VERSION, comment, maxAge, null, secure, httpOnly); + } + + + public NewCookie( + String name, + String value, + String path, + String domain, + int version, + String comment, + int maxAge, + boolean secure) { + this(name, value, path, domain, version, comment, maxAge, null, secure, false); + } + + + public NewCookie( + String name, + String value, + String path, + String domain, + int version, + String comment, + int maxAge, + Date expiry, + boolean secure, + boolean httpOnly) { + super(name, value, path, domain, version); + this.comment = comment; + this.maxAge = maxAge; + this.expiry = expiry; + this.secure = secure; + this.httpOnly = httpOnly; + } + + + public NewCookie(Cookie cookie) { + this(cookie, null, DEFAULT_MAX_AGE, null, false, false); + } + + + public NewCookie(Cookie cookie, String comment, int maxAge, boolean secure) { + this(cookie, comment, maxAge, null, secure, false); + } + + + public NewCookie( + Cookie cookie, String comment, int maxAge, Date expiry, boolean secure, boolean httpOnly) { + super( + cookie == null ? null : cookie.getName(), + cookie == null ? null : cookie.getValue(), + cookie == null ? null : cookie.getPath(), + cookie == null ? null : cookie.getDomain(), + cookie == null ? Cookie.DEFAULT_VERSION : cookie.getVersion()); + this.comment = comment; + this.maxAge = maxAge; + this.expiry = expiry; + this.secure = secure; + this.httpOnly = httpOnly; + } + + + public static NewCookie valueOf(String value) { + return delegate.fromString(value); + } + + + public String getComment() { + return comment; + } + + + public int getMaxAge() { + return maxAge; + } + + + public Date getExpiry() { + return expiry; + } + + + public boolean isSecure() { + return secure; + } + + + public boolean isHttpOnly() { + return httpOnly; + } + + + public Cookie toCookie() { + return new Cookie( + this.getName(), this.getValue(), this.getPath(), this.getDomain(), this.getVersion()); + } + + + @Override + public String toString() { + return delegate.toString(this); + } + + + @Override + public int hashCode() { + int hash = super.hashCode(); + hash = 59 * hash + (this.comment != null ? this.comment.hashCode() : 0); + hash = 59 * hash + this.maxAge; + hash = 59 + hash + (this.expiry != null ? this.expiry.hashCode() : 0); + hash = 59 * hash + (this.secure ? 1 : 0); + hash = 59 * hash + (this.httpOnly ? 1 : 0); + return hash; + } + + + @SuppressWarnings({"StringEquality", "RedundantIfStatement"}) + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final NewCookie other = (NewCookie) obj; + if (this.getName() != other.getName() + && (this.getName() == null || !this.getName().equals(other.getName()))) { + return false; + } + if (this.getValue() != other.getValue() + && (this.getValue() == null || !this.getValue().equals(other.getValue()))) { + return false; + } + if (this.getVersion() != other.getVersion()) { + return false; + } + if (this.getPath() != other.getPath() + && (this.getPath() == null || !this.getPath().equals(other.getPath()))) { + return false; + } + if (this.getDomain() != other.getDomain() + && (this.getDomain() == null || !this.getDomain().equals(other.getDomain()))) { + return false; + } + if (this.comment != other.comment + && (this.comment == null || !this.comment.equals(other.comment))) { + return false; + } + if (this.maxAge != other.maxAge) { + return false; + } + + if (this.expiry != other.expiry && (this.expiry == null || !this.expiry.equals(other.expiry))) { + return false; + } + + if (this.secure != other.secure) { + return false; + } + if (this.httpOnly != other.httpOnly) { + return false; + } + return true; + } +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/NoContentException.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/NoContentException.java new file mode 100644 index 0000000..79d96af --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/NoContentException.java @@ -0,0 +1,40 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + +import java.io.IOException; + + +public class NoContentException extends IOException { + private static final long serialVersionUID = -3082577759787473245L; + + + public NoContentException(String message) { + super(message); + } + + + public NoContentException(String message, Throwable cause) { + super(message, cause); + } + + + public NoContentException(Throwable cause) { + super(cause); + } +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/PathSegment.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/PathSegment.java new file mode 100644 index 0000000..617e0fc --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/PathSegment.java @@ -0,0 +1,27 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + +public interface PathSegment { + + + String getPath(); + + + MultivaluedMap getMatrixParameters(); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Request.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Request.java new file mode 100644 index 0000000..90a6b64 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Request.java @@ -0,0 +1,31 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + +import java.util.List; + + +public interface Request { + + + public String getMethod(); + + + public Variant selectVariant(List variants); + +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Response.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Response.java new file mode 100644 index 0000000..e19f164 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Response.java @@ -0,0 +1,300 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + +import java.lang.annotation.Annotation; +import java.net.URI; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import javax.ws.rs.GwtIncompatible; + + +public abstract class Response implements AutoCloseable { + + + protected Response() {} + + + public abstract int getStatus(); + + + public abstract StatusType getStatusInfo(); + + + public abstract Object getEntity(); + + + public abstract T readEntity(Class entityType); + + + public abstract T readEntity(GenericType entityType); + + + public abstract T readEntity(Class entityType, Annotation[] annotations); + + + public abstract T readEntity(GenericType entityType, Annotation[] annotations); + + + public abstract boolean hasEntity(); + + + public abstract boolean bufferEntity(); + + + @Override + public abstract void close(); + + + public abstract MediaType getMediaType(); + + + public abstract Locale getLanguage(); + + + public abstract int getLength(); + + + public abstract Set getAllowedMethods(); + + + public abstract Map getCookies(); + + + public abstract EntityTag getEntityTag(); + + + public abstract Date getDate(); + + + public abstract Date getLastModified(); + + + @GwtIncompatible + public abstract URI getLocation(); + + + public abstract Set getLinks(); + + + public abstract boolean hasLink(String relation); + + + public abstract Link getLink(String relation); + + + public abstract Link.Builder getLinkBuilder(String relation); + + + public abstract MultivaluedMap getMetadata(); + + + public MultivaluedMap getHeaders() { + return getMetadata(); + } + + + public abstract MultivaluedMap getStringHeaders(); + + + public abstract String getHeaderString(String name); + + + public interface StatusType { + + + public int getStatusCode(); + + + public Status.Family getFamily(); + + + public String getReasonPhrase(); + + + public default Status toEnum() { + return Status.fromStatusCode(getStatusCode()); + } + } + + + public enum Status implements StatusType { + + + OK(200, "OK"), + + CREATED(201, "Created"), + + ACCEPTED(202, "Accepted"), + + NO_CONTENT(204, "No Content"), + + RESET_CONTENT(205, "Reset Content"), + + PARTIAL_CONTENT(206, "Partial Content"), + + MOVED_PERMANENTLY(301, "Moved Permanently"), + + FOUND(302, "Found"), + + SEE_OTHER(303, "See Other"), + + NOT_MODIFIED(304, "Not Modified"), + + USE_PROXY(305, "Use Proxy"), + + TEMPORARY_REDIRECT(307, "Temporary Redirect"), + + BAD_REQUEST(400, "Bad Request"), + + UNAUTHORIZED(401, "Unauthorized"), + + PAYMENT_REQUIRED(402, "Payment Required"), + + FORBIDDEN(403, "Forbidden"), + + NOT_FOUND(404, "Not Found"), + + METHOD_NOT_ALLOWED(405, "Method Not Allowed"), + + NOT_ACCEPTABLE(406, "Not Acceptable"), + + PROXY_AUTHENTICATION_REQUIRED(407, "Proxy Authentication Required"), + + REQUEST_TIMEOUT(408, "Request Timeout"), + + CONFLICT(409, "Conflict"), + + GONE(410, "Gone"), + + LENGTH_REQUIRED(411, "Length Required"), + + PRECONDITION_FAILED(412, "Precondition Failed"), + + REQUEST_ENTITY_TOO_LARGE(413, "Request Entity Too Large"), + + REQUEST_URI_TOO_LONG(414, "Request-URI Too Long"), + + UNSUPPORTED_MEDIA_TYPE(415, "Unsupported Media Type"), + + REQUESTED_RANGE_NOT_SATISFIABLE(416, "Requested Range Not Satisfiable"), + + EXPECTATION_FAILED(417, "Expectation Failed"), + + PRECONDITION_REQUIRED(428, "Precondition Required"), + + TOO_MANY_REQUESTS(429, "Too Many Requests"), + + REQUEST_HEADER_FIELDS_TOO_LARGE(431, "Request Header Fields Too Large"), + + INTERNAL_SERVER_ERROR(500, "Internal Server Error"), + + NOT_IMPLEMENTED(501, "Not Implemented"), + + BAD_GATEWAY(502, "Bad Gateway"), + + SERVICE_UNAVAILABLE(503, "Service Unavailable"), + + GATEWAY_TIMEOUT(504, "Gateway Timeout"), + + HTTP_VERSION_NOT_SUPPORTED(505, "HTTP Version Not Supported"), + + NETWORK_AUTHENTICATION_REQUIRED(511, "Network Authentication Required"); + + private final int code; + private final String reason; + private final Family family; + + + public enum Family { + + + INFORMATIONAL, + + SUCCESSFUL, + + REDIRECTION, + + CLIENT_ERROR, + + SERVER_ERROR, + + OTHER; + + + public static Family familyOf(final int statusCode) { + switch (statusCode / 100) { + case 1: + return Family.INFORMATIONAL; + case 2: + return Family.SUCCESSFUL; + case 3: + return Family.REDIRECTION; + case 4: + return Family.CLIENT_ERROR; + case 5: + return Family.SERVER_ERROR; + default: + return Family.OTHER; + } + } + } + + Status(final int statusCode, final String reasonPhrase) { + this.code = statusCode; + this.reason = reasonPhrase; + this.family = Family.familyOf(statusCode); + } + + + @Override + public Family getFamily() { + return family; + } + + + @Override + public int getStatusCode() { + return code; + } + + + @Override + public String getReasonPhrase() { + return toString(); + } + + + @Override + public String toString() { + return reason; + } + + + public static Status fromStatusCode(final int statusCode) { + for (Status s : Status.values()) { + if (s.code == statusCode) { + return s; + } + } + return null; + } + } +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/SecurityContext.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/SecurityContext.java new file mode 100644 index 0000000..619bad2 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/SecurityContext.java @@ -0,0 +1,47 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + +import java.security.Principal; +import javax.ws.rs.GwtIncompatible; + + +public interface SecurityContext { + + + public static final String BASIC_AUTH = "BASIC"; + + public static final String CLIENT_CERT_AUTH = "CLIENT_CERT"; + + public static final String DIGEST_AUTH = "DIGEST"; + + public static final String FORM_AUTH = "FORM"; + + + @GwtIncompatible + public Principal getUserPrincipal(); + + + public boolean isUserInRole(String role); + + + public boolean isSecure(); + + + public String getAuthenticationScheme(); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/StreamingOutput.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/StreamingOutput.java new file mode 100644 index 0000000..4dfe5d6 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/StreamingOutput.java @@ -0,0 +1,30 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + +import java.io.IOException; +import java.io.OutputStream; +import javax.ws.rs.GwtIncompatible; + + +@GwtIncompatible +public interface StreamingOutput { + + + void write(OutputStream output) throws IOException; +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/UriBuilder.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/UriBuilder.java new file mode 100644 index 0000000..9227f5d --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/UriBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package javax.ws.rs.core; + +import java.util.Map; +import javax.ws.rs.GwtIncompatible; + +public abstract class UriBuilder { + + protected UriBuilder() {} + + protected static UriBuilder newInstance() { + return null; + } + + public static UriBuilder fromUri(String uriTemplate) { + return newInstance().uri(uriTemplate); + } + + public static UriBuilder fromPath(String path) throws IllegalArgumentException { + return newInstance().path(path); + } + + public static UriBuilder fromResource(Class resource) { + return newInstance().path(resource); + } + + public static UriBuilder fromMethod(Class resource, String method) { + return newInstance().path(resource, method); + } + + public UriBuilder clone(){ + return null; + } + + public abstract UriBuilder uri(String uriTemplate); + + public abstract UriBuilder scheme(String scheme); + + public abstract UriBuilder schemeSpecificPart(String ssp); + + public abstract UriBuilder userInfo(String ui); + + public abstract UriBuilder host(String host); + + public abstract UriBuilder port(int port); + + public abstract UriBuilder replacePath(String path); + + public abstract UriBuilder path(String path); + + public abstract UriBuilder path(Class resource); + + public abstract UriBuilder path(Class resource, String method); + + public abstract UriBuilder segment(String... segments); + + public abstract UriBuilder replaceMatrix(String matrix); + + public abstract UriBuilder matrixParam(String name, Object... values); + + public abstract UriBuilder replaceMatrixParam(String name, Object... values); + + public abstract UriBuilder replaceQuery(String query); + + public abstract UriBuilder queryParam(String name, Object... values); + + public abstract UriBuilder replaceQueryParam(String name, Object... values); + + public abstract UriBuilder fragment(String fragment); + + public abstract UriBuilder resolveTemplate(String name, Object value); + + public abstract UriBuilder resolveTemplate(String name, Object value, boolean encodeSlashInPath); + + public abstract UriBuilder resolveTemplateFromEncoded(String name, Object value); + + public abstract UriBuilder resolveTemplates(Map templateValues); + + public abstract UriBuilder resolveTemplates( + Map templateValues, boolean encodeSlashInPath) + throws IllegalArgumentException; + + public abstract UriBuilder resolveTemplatesFromEncoded(Map templateValues); + + public abstract String toTemplate(); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/UriBuilderException.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/UriBuilderException.java new file mode 100644 index 0000000..fe0ff10 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/UriBuilderException.java @@ -0,0 +1,41 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + +public class UriBuilderException extends RuntimeException { + + private static final long serialVersionUID = 956255913370721193L; + + + public UriBuilderException() {} + + + public UriBuilderException(String msg) { + super(msg); + } + + + public UriBuilderException(String msg, Throwable cause) { + super(msg, cause); + } + + + public UriBuilderException(Throwable cause) { + super(cause); + } +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/UriInfo.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/UriInfo.java new file mode 100644 index 0000000..ceacb27 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/UriInfo.java @@ -0,0 +1,70 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.core; + +import java.util.List; +import javax.ws.rs.GwtIncompatible; + + +public interface UriInfo { + + + public String getPath(); + + + public String getPath(boolean decode); + + + public List getPathSegments(); + + + public List getPathSegments(boolean decode); + + + + public UriBuilder getRequestUriBuilder(); + + + + public UriBuilder getAbsolutePathBuilder(); + + + + public UriBuilder getBaseUriBuilder(); + + + public MultivaluedMap getPathParameters(); + + + public MultivaluedMap getPathParameters(boolean decode); + + + public MultivaluedMap getQueryParameters(); + + + public MultivaluedMap getQueryParameters(boolean decode); + + + public List getMatchedURIs(); + + + public List getMatchedURIs(boolean decode); + + + public List getMatchedResources(); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Variant.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Variant.java new file mode 100644 index 0000000..eb48cef --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/Variant.java @@ -0,0 +1,26 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package javax.ws.rs.core; + +public class Variant { + + public abstract static class VariantListBuilder { + + protected VariantListBuilder() {} + + } +} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/HEAD.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/package-info.java similarity index 79% rename from domino-rest-jaxrs/src/main/java/javax/ws/rs/HEAD.java rename to domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/package-info.java index 96a0158..7529831 100644 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/HEAD.java +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/core/package-info.java @@ -38,23 +38,5 @@ * holder. */ -package javax.ws.rs; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Indicates that the annotated method responds to HTTP HEAD requests. - * - * @author Paul Sandoz - * @author Marc Hadley - * @since 1.0 - */ -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@HttpMethod(HttpMethod.HEAD) -@Documented -public @interface HEAD {} +/** Low-level interfaces and annotations used to create RESTful service resources. */ +package javax.ws.rs.core; diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ContextResolver.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ContextResolver.java new file mode 100644 index 0000000..4954203 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ContextResolver.java @@ -0,0 +1,24 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.ext; + +public interface ContextResolver { + + + T getContext(Class type); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ExceptionMapper.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ExceptionMapper.java new file mode 100644 index 0000000..66a4164 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ExceptionMapper.java @@ -0,0 +1,27 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.ext; + +import javax.ws.rs.core.Response; + + +public interface ExceptionMapper { + + + Response toResponse(E exception); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/FactoryFinder.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/FactoryFinder.java new file mode 100644 index 0000000..aae8829 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/FactoryFinder.java @@ -0,0 +1,38 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.ext; + +import java.util.logging.Logger; +import javax.ws.rs.GwtIncompatible; + + +@GwtIncompatible +final class FactoryFinder { + + private static final Logger LOGGER = Logger.getLogger(FactoryFinder.class.getName()); + + private FactoryFinder() { + // prevents instantiation + } + + + static Object find(final String factoryId, final String fallbackClassName, Class service) + throws ClassNotFoundException { + return null; + } +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/InterceptorContext.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/InterceptorContext.java new file mode 100644 index 0000000..7601f95 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/InterceptorContext.java @@ -0,0 +1,64 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.ext; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; +import java.util.Collection; +import javax.ws.rs.GwtIncompatible; +import javax.ws.rs.core.MediaType; + + +public interface InterceptorContext { + + + public Object getProperty(String name); + + + public Collection getPropertyNames(); + + + public void setProperty(String name, Object object); + + + public void removeProperty(String name); + + @GwtIncompatible + public Annotation[] getAnnotations(); + + @GwtIncompatible + public void setAnnotations(Annotation[] annotations); + + + Class getType(); + + + public void setType(Class type); + + @GwtIncompatible + Type getGenericType(); + + @GwtIncompatible + public void setGenericType(Type genericType); + + + public MediaType getMediaType(); + + + public void setMediaType(MediaType mediaType); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/MessageBodyReader.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/MessageBodyReader.java new file mode 100644 index 0000000..222e64a --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/MessageBodyReader.java @@ -0,0 +1,46 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.ext; + +import java.io.InputStream; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; +import javax.ws.rs.GwtIncompatible; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; + + +@GwtIncompatible +public interface MessageBodyReader { + + + @GwtIncompatible + public boolean isReadable( + Class type, Type genericType, Annotation[] annotations, MediaType mediaType); + + + @GwtIncompatible + public T readFrom( + Class type, + Type genericType, + Annotation[] annotations, + MediaType mediaType, + MultivaluedMap httpHeaders, + InputStream entityStream) + throws java.io.IOException; +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/MessageBodyWriter.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/MessageBodyWriter.java new file mode 100644 index 0000000..6d27f67 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/MessageBodyWriter.java @@ -0,0 +1,51 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.ext; + +import java.io.OutputStream; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; +import javax.ws.rs.GwtIncompatible; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; + + +@GwtIncompatible +public interface MessageBodyWriter { + + + public boolean isWriteable( + Class type, Type genericType, Annotation[] annotations, MediaType mediaType); + + + public default long getSize( + T t, Class type, Type genericType, Annotation[] annotations, MediaType mediaType) { + return -1L; + } + + + public void writeTo( + T t, + Class type, + Type genericType, + Annotation[] annotations, + MediaType mediaType, + MultivaluedMap httpHeaders, + OutputStream entityStream) + throws java.io.IOException; +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ParamConverter.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ParamConverter.java new file mode 100644 index 0000000..af41aad --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ParamConverter.java @@ -0,0 +1,40 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.ext; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +public interface ParamConverter { + + + @Target({ElementType.TYPE}) + @Retention(RetentionPolicy.RUNTIME) + @Documented + public static @interface Lazy {} + + + public T fromString(String value); + + + public String toString(T value); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ParamConverterProvider.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ParamConverterProvider.java new file mode 100644 index 0000000..e9dcc2a --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ParamConverterProvider.java @@ -0,0 +1,29 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.ext; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; + + +public interface ParamConverterProvider { + + + public ParamConverter getConverter( + Class rawType, Type genericType, Annotation annotations[]); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/Provider.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/Provider.java new file mode 100644 index 0000000..8f5caa3 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/Provider.java @@ -0,0 +1,30 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.ext; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Provider {} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/Providers.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/Providers.java new file mode 100644 index 0000000..44c3b78 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/Providers.java @@ -0,0 +1,42 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.ext; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; +import javax.ws.rs.GwtIncompatible; +import javax.ws.rs.core.MediaType; + + +@GwtIncompatible +public interface Providers { + + + MessageBodyReader getMessageBodyReader( + Class type, Type genericType, Annotation[] annotations, MediaType mediaType); + + + MessageBodyWriter getMessageBodyWriter( + Class type, Type genericType, Annotation[] annotations, MediaType mediaType); + + + ExceptionMapper getExceptionMapper(Class type); + + + ContextResolver getContextResolver(Class contextType, MediaType mediaType); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ReaderInterceptor.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ReaderInterceptor.java new file mode 100644 index 0000000..38d2188 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ReaderInterceptor.java @@ -0,0 +1,29 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.ext; + +import javax.ws.rs.GwtIncompatible; + + +@GwtIncompatible +public interface ReaderInterceptor { + + + public Object aroundReadFrom(ReaderInterceptorContext context) + throws java.io.IOException; +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ReaderInterceptorContext.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ReaderInterceptorContext.java new file mode 100644 index 0000000..b6059b0 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/ReaderInterceptorContext.java @@ -0,0 +1,40 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.ext; + +import java.io.IOException; +import java.io.InputStream; +import javax.ws.rs.GwtIncompatible; +import javax.ws.rs.core.MultivaluedMap; + + +@GwtIncompatible +public interface ReaderInterceptorContext extends InterceptorContext { + + + public Object proceed() throws IOException; + + + public InputStream getInputStream(); + + + public void setInputStream(InputStream is); + + + public MultivaluedMap getHeaders(); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/RuntimeDelegate.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/RuntimeDelegate.java new file mode 100644 index 0000000..e07718a --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/RuntimeDelegate.java @@ -0,0 +1,105 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.ext; + +import javax.ws.rs.core.Application; +import javax.ws.rs.core.Link; +import javax.ws.rs.core.UriBuilder; +import javax.ws.rs.core.Variant.VariantListBuilder; + +public abstract class RuntimeDelegate { + + private static volatile RuntimeDelegate cachedDelegate; + + + protected RuntimeDelegate() {} + + + public static RuntimeDelegate getInstance() { + return new RuntimeDelegate() { + @Override + public UriBuilder createUriBuilder() { + return null; + } + + @Override + public VariantListBuilder createVariantListBuilder() { + return null; + } + + @Override + public T createEndpoint(Application application, Class endpointType) + throws IllegalArgumentException, UnsupportedOperationException { + return null; + } + + @Override + public HeaderDelegate createHeaderDelegate(Class type) + throws IllegalArgumentException { + return new HeaderDelegate() { + @Override + public T fromString(String value) { + return null; + } + + @Override + public String toString(T value) { + return String.valueOf(value); + } + }; + } + + @Override + public Link.Builder createLinkBuilder() { + return null; + } + }; + } + + + public static void setInstance(final RuntimeDelegate rd) { + RuntimeDelegate.cachedDelegate = rd; + } + + + public abstract UriBuilder createUriBuilder(); + + + public abstract VariantListBuilder createVariantListBuilder(); + + + public abstract T createEndpoint(Application application, Class endpointType) + throws IllegalArgumentException, UnsupportedOperationException; + + + public abstract HeaderDelegate createHeaderDelegate(Class type) + throws IllegalArgumentException; + + + public static interface HeaderDelegate { + + + public T fromString(String value); + + + public String toString(T value); + } + + + public abstract Link.Builder createLinkBuilder(); +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/WriterInterceptor.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/WriterInterceptor.java new file mode 100644 index 0000000..cf611a5 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/WriterInterceptor.java @@ -0,0 +1,29 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.ext; + +import javax.ws.rs.GwtIncompatible; + + +@GwtIncompatible +public interface WriterInterceptor { + + + void aroundWriteTo(WriterInterceptorContext context) + throws java.io.IOException; +} diff --git a/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/WriterInterceptorContext.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/WriterInterceptorContext.java new file mode 100644 index 0000000..f71c765 --- /dev/null +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/WriterInterceptorContext.java @@ -0,0 +1,46 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package javax.ws.rs.ext; + +import java.io.IOException; +import java.io.OutputStream; +import javax.ws.rs.GwtIncompatible; +import javax.ws.rs.core.MultivaluedMap; + + +@GwtIncompatible +public interface WriterInterceptorContext extends InterceptorContext { + + + void proceed() throws IOException; + + + Object getEntity(); + + + void setEntity(Object entity); + + + OutputStream getOutputStream(); + + + public void setOutputStream(OutputStream os); + + + MultivaluedMap getHeaders(); +} diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/DELETE.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/package-info.java similarity index 79% rename from domino-rest-jaxrs/src/main/java/javax/ws/rs/DELETE.java rename to domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/package-info.java index 7bc5c9c..bd5e45d 100644 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/DELETE.java +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/ext/package-info.java @@ -38,23 +38,5 @@ * holder. */ -package javax.ws.rs; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Indicates that the annotated method responds to HTTP DELETE requests. - * - * @author Paul Sandoz - * @author Marc Hadley - * @since 1.0 - */ -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@HttpMethod(HttpMethod.DELETE) -@Documented -public @interface DELETE {} +/** APIs that provide extensions to the types supported by the JAX-RS API. */ +package javax.ws.rs.ext; diff --git a/domino-rest-jaxrs/src/main/java/javax/ws/rs/OPTIONS.java b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/package-info.java similarity index 76% rename from domino-rest-jaxrs/src/main/java/javax/ws/rs/OPTIONS.java rename to domino-rest-jaxrs/src/main/resources/javax/ws/rs/package-info.java index 1b0c728..0402ede 100644 --- a/domino-rest-jaxrs/src/main/java/javax/ws/rs/OPTIONS.java +++ b/domino-rest-jaxrs/src/main/resources/javax/ws/rs/package-info.java @@ -38,24 +38,28 @@ * holder. */ -package javax.ws.rs; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - /** - * Indicates that the annotated method responds to HTTP OPTIONS requests. + * High-level interfaces and annotations used to create RESTful service resources. For example: + * + *
+ * @Path("widgets/{widgetid}")
+ * @Consumes("application/widgets+xml")
+ * @Produces("application/widgets+xml")
+ * public class WidgetResource {
  *
- * @author Paul Sandoz
- * @author Marc Hadley
- * @see HttpMethod
- * @since 1.1
+ *     @GET
+ *     public String getWidget(@PathParam("widgetid") String id) {
+ *         return getWidgetAsXml(id);
+ *     }
+ *
+ *     @PUT
+ *     public void updateWidget(@PathParam("widgetid") String id,
+ *                              Source update) {
+ *         updateWidgetFromXml(id, update);
+ *     }
+ *
+ *     ...
+ * }
+ * 
*/ -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@HttpMethod(HttpMethod.OPTIONS) -@Documented -public @interface OPTIONS {} +package javax.ws.rs; diff --git a/domino-rest-jvm/pom.xml b/domino-rest-jvm/pom.xml index 25c9905..8c11b95 100644 --- a/domino-rest-jvm/pom.xml +++ b/domino-rest-jvm/pom.xml @@ -32,12 +32,11 @@ 4.13.1 test - + - org.dominokit - domino-rest-jaxrs - ${project.version} - test + javax.ws.rs + javax.ws.rs-api + ${jax.rs.version} diff --git a/domino-rest-jvm/src/main/java/org/dominokit/rest/DominoRestConfig.java b/domino-rest-jvm/src/main/java/org/dominokit/rest/DominoRestConfig.java index b2af4b1..eaab975 100644 --- a/domino-rest-jvm/src/main/java/org/dominokit/rest/DominoRestConfig.java +++ b/domino-rest-jvm/src/main/java/org/dominokit/rest/DominoRestConfig.java @@ -23,6 +23,8 @@ import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.dominokit.jackson.JacksonContextProvider; import org.dominokit.rest.jvm.DefaultServiceRoot; import org.dominokit.rest.jvm.OnServerRequestEventFactory; @@ -254,4 +256,18 @@ public DominoRestConfig setNullQueryParamStrategy(NullQueryParamStrategy nullQue } return this; } + + @Override + public UrlTokenRegexMatcher getUrlTokenRegexMatcher() { + return url -> { + if (url.contains("http:") || url.contains("https:")) { + Pattern pattern = Pattern.compile("^((.*:)//([a-z0-9\\-.]+)(|:[0-9]+)/)(.*)$"); + Matcher matcher = pattern.matcher(url); + if (matcher.find()) { + return matcher.group(matcher.groupCount()); + } + } + return url; + }; + } } diff --git a/domino-rest-processor/pom.xml b/domino-rest-processor/pom.xml index a5febb1..32141f6 100644 --- a/domino-rest-processor/pom.xml +++ b/domino-rest-processor/pom.xml @@ -20,14 +20,24 @@ org.dominokit - domino-rest-jaxrs - ${project.version} - provided + domino-jackson-processor + ${domino.jackson.version} + + + + javax.ws.rs + javax.ws.rs-api + ${jax.rs.version} + + + com.google.auto.service + auto-service + 1.1.1 org.dominokit - domino-jackson-processor - ${domino.jackson.version} + domino-apt-commons + 1.0.5 diff --git a/domino-rest-shared/pom.xml b/domino-rest-shared/pom.xml index 66162f2..a2f3f5f 100644 --- a/domino-rest-shared/pom.xml +++ b/domino-rest-shared/pom.xml @@ -15,23 +15,26 @@ domino-rest-shared - - org.gwtproject.regexp - gwt-regexp - 1.0.0-RC1 - + junit junit - 4.13.1 + 4.13.2 test + + + javax.ws.rs + javax.ws.rs-api + ${jax.rs.version} + + org.dominokit domino-rest-jaxrs ${project.version} - provided + org.dominokit domino-jackson diff --git a/domino-rest-shared/src/main/java/org/dominokit/rest/shared/request/RestConfig.java b/domino-rest-shared/src/main/java/org/dominokit/rest/shared/request/RestConfig.java index a8823c4..85e7dc1 100644 --- a/domino-rest-shared/src/main/java/org/dominokit/rest/shared/request/RestConfig.java +++ b/domino-rest-shared/src/main/java/org/dominokit/rest/shared/request/RestConfig.java @@ -174,6 +174,8 @@ default NullQueryParamStrategy getNullQueryParamStrategy() { */ RestConfig setNullQueryParamStrategy(NullQueryParamStrategy strategy); + UrlTokenRegexMatcher getUrlTokenRegexMatcher(); + /** Formatter to format the date parameter based on a patter */ @FunctionalInterface interface DateParamFormatter { diff --git a/domino-rest-shared/src/main/java/org/dominokit/rest/shared/request/ServerRequest.java b/domino-rest-shared/src/main/java/org/dominokit/rest/shared/request/ServerRequest.java index 1f4c3d3..6cd207a 100644 --- a/domino-rest-shared/src/main/java/org/dominokit/rest/shared/request/ServerRequest.java +++ b/domino-rest-shared/src/main/java/org/dominokit/rest/shared/request/ServerRequest.java @@ -52,7 +52,7 @@ public class ServerRequest extends BaseRequest private RestfulRequest httpRequest; private String url; - private String httpMethod = HttpMethod.GET; + private String httpMethod; private String path = ""; private String serviceRoot = ""; private Integer[] successCodes = new Integer[] {200, 201, 202, 203, 204}; @@ -101,11 +101,14 @@ public class ServerRequest extends BaseRequest private NullQueryParamStrategy nullQueryParamStrategy; private boolean multipartForm = false; - protected ServerRequest() {} + protected ServerRequest() { + this.httpMethod = HttpMethod.GET; + } protected ServerRequest(RequestMeta requestMeta, R requestBean) { this.requestMeta = requestMeta; this.requestBean = requestBean; + this.httpMethod = HttpMethod.GET; } /** prepare the request and execute it. */ diff --git a/domino-rest-shared/src/main/java/org/dominokit/rest/shared/request/UrlFormatter.java b/domino-rest-shared/src/main/java/org/dominokit/rest/shared/request/UrlFormatter.java index 2b1e393..9850d4b 100644 --- a/domino-rest-shared/src/main/java/org/dominokit/rest/shared/request/UrlFormatter.java +++ b/domino-rest-shared/src/main/java/org/dominokit/rest/shared/request/UrlFormatter.java @@ -21,8 +21,6 @@ import java.util.Map; import org.dominokit.domino.history.StateHistoryToken; import org.dominokit.rest.shared.request.exception.PathParameterMissingException; -import org.gwtproject.regexp.shared.MatchResult; -import org.gwtproject.regexp.shared.RegExp; /** Formats the url by adding the query parameters and normalizing path parameters */ public class UrlFormatter { @@ -70,15 +68,7 @@ private void replacePaths(StateHistoryToken tempToken) { } private String asTokenString(String url) { - if (url.contains("http:") || url.contains("https:")) { - RegExp regExp = RegExp.compile("^((.*:)//([a-z0-9\\-.]+)(|:[0-9]+)/)(.*)$"); - MatchResult matcher = regExp.exec(url); - boolean matchFound = matcher != null; // equivalent to regExp.test(inputStr); - if (matchFound) { - return matcher.getGroup(matcher.getGroupCount() - 1); - } - } - return url; + return DominoRestContext.make().getConfig().getUrlTokenRegexMatcher().asTokenString(url); } private boolean hasPathParameter(String path) { diff --git a/domino-rest-shared/src/main/java/org/dominokit/rest/shared/request/UrlTokenRegexMatcher.java b/domino-rest-shared/src/main/java/org/dominokit/rest/shared/request/UrlTokenRegexMatcher.java new file mode 100644 index 0000000..e14180c --- /dev/null +++ b/domino-rest-shared/src/main/java/org/dominokit/rest/shared/request/UrlTokenRegexMatcher.java @@ -0,0 +1,20 @@ +/* + * Copyright © 2019 Dominokit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.dominokit.rest.shared.request; + +public interface UrlTokenRegexMatcher { + String asTokenString(String url); +} diff --git a/pom.xml b/pom.xml index f2b5307..77113ef 100644 --- a/pom.xml +++ b/pom.xml @@ -63,22 +63,22 @@ domino-rest-shared domino-rest-test domino-rest-processor - domino-rest-jaxrs domino-rest-client domino-rest-jvm + domino-rest-jaxrs HEAD-SNAPSHOT 1.0.1 - 1.8 - 1.8 + 11 + 11 UTF-8 UTF-8 - 3.8.1 + 3.11.0 3.0.1 - 2.10.4 + 3.6.2 1.6 1.6.8 3.0.0-M1 @@ -86,18 +86,22 @@ 3.0.0-M1 3.0 3.0.0-M5 - 1.0.0 - 2.9.0 - 1.0.2 - 1.0.0 - 1.0.0 + 1.1.0 + + 2.10.0 + 1.0.3 + 1.0.3 + 1.0.2 1.0.2 + 2.1.1 + 2.16.0 + 1.2.1 - com.google.gwt + org.gwtproject gwt ${gwt.version} pom @@ -125,6 +129,47 @@ javax.annotation-api 1.3.2 + + com.google.elemental2 + elemental2-core + ${elemental2.version} + + + com.google.elemental2 + elemental2-dom + ${elemental2.version} + + + com.google.elemental2 + elemental2-promise + ${elemental2.version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.databind.version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.databind.version} + + + com.fasterxml.jackson.core + jackson-core + ${jackson.databind.version} + + + com.google.auto + auto-common + 1.2.2 + + + + com.google.guava + guava + 32.1.3-jre + @@ -135,8 +180,7 @@ maven-compiler-plugin ${maven.compiler.plugin} - ${maven.compiler.source} - ${maven.compiler.target} + ${maven.compiler.source} From 313e5b70c3196a0d9bdd30e5d7449efb3490d513 Mon Sep 17 00:00:00 2001 From: "Ahmad K. Bawaneh" Date: Tue, 28 Nov 2023 10:11:50 +0300 Subject: [PATCH 3/3] Update versions for release --- domino-rest-client/pom.xml | 2 +- domino-rest-jaxrs/pom.xml | 2 +- domino-rest-jvm/pom.xml | 2 +- domino-rest-processor/pom.xml | 2 +- domino-rest-shared/pom.xml | 2 +- domino-rest-test/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/domino-rest-client/pom.xml b/domino-rest-client/pom.xml index 7f89da0..7112c6d 100644 --- a/domino-rest-client/pom.xml +++ b/domino-rest-client/pom.xml @@ -5,7 +5,7 @@ domino-rest org.dominokit - HEAD-SNAPSHOT + 1.0.1 4.0.0 diff --git a/domino-rest-jaxrs/pom.xml b/domino-rest-jaxrs/pom.xml index 9a3a248..061c0ea 100644 --- a/domino-rest-jaxrs/pom.xml +++ b/domino-rest-jaxrs/pom.xml @@ -5,7 +5,7 @@ org.dominokit domino-rest - HEAD-SNAPSHOT + 1.0.1 domino-rest-jaxrs diff --git a/domino-rest-jvm/pom.xml b/domino-rest-jvm/pom.xml index 8c11b95..98f33c4 100644 --- a/domino-rest-jvm/pom.xml +++ b/domino-rest-jvm/pom.xml @@ -5,7 +5,7 @@ domino-rest org.dominokit - HEAD-SNAPSHOT + 1.0.1 4.0.0 diff --git a/domino-rest-processor/pom.xml b/domino-rest-processor/pom.xml index 32141f6..5574a7b 100644 --- a/domino-rest-processor/pom.xml +++ b/domino-rest-processor/pom.xml @@ -4,7 +4,7 @@ domino-rest org.dominokit - HEAD-SNAPSHOT + 1.0.1 4.0.0 diff --git a/domino-rest-shared/pom.xml b/domino-rest-shared/pom.xml index a2f3f5f..69ad06c 100644 --- a/domino-rest-shared/pom.xml +++ b/domino-rest-shared/pom.xml @@ -5,7 +5,7 @@ domino-rest org.dominokit - HEAD-SNAPSHOT + 1.0.1 4.0.0 diff --git a/domino-rest-test/pom.xml b/domino-rest-test/pom.xml index 03c8c3f..d761b6f 100644 --- a/domino-rest-test/pom.xml +++ b/domino-rest-test/pom.xml @@ -5,7 +5,7 @@ domino-rest org.dominokit - HEAD-SNAPSHOT + 1.0.1 4.0.0 diff --git a/pom.xml b/pom.xml index 77113ef..59ac96f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.dominokit domino-rest - HEAD-SNAPSHOT + 1.0.1 pom domino-rest