From 2e276a3910c087dc21e10e81cbb143f8638772a1 Mon Sep 17 00:00:00 2001 From: jGauravGupta Date: Sat, 5 May 2018 17:26:28 +0530 Subject: [PATCH 01/17] MicroProfile REST Client v1.1 support Signed-off-by: jGauravGupta --- bom/pom.xml | 6 + .../jersey/client/ClientRuntime.java | 10 +- .../JerseyCompletionStageRxInvoker.java | 60 +++- .../jersey/client/JerseyInvocation.java | 9 +- .../ResponseExceptionMappingStages.java | 101 +++++++ core-common/pom.xml | 5 + .../jersey/internal/inject/Providers.java | 3 + .../message/internal/MessageBodyFactory.java | 41 ++- ext/microprofile-rest-client/pom.xml | 81 +++++ .../microprofile/rest/client/Constant.java | 28 ++ .../rest/client/RestClientBuilderImpl.java | 180 +++++++++++ .../client/RestClientBuilderResolverImpl.java | 29 ++ .../rest/client/RestClientValidator.java | 169 +++++++++++ .../rest/client/cdi/AbstractBeanProducer.java | 79 +++++ .../client/cdi/RestClientCDIExtension.java | 61 ++++ .../rest/client/cdi/RestClientProducer.java | 147 +++++++++ .../rest/client/config/ConfigController.java | 56 ++++ .../ext/DefaultResponseExceptionMapper.java | 35 +++ .../javax.enterprise.inject.spi.Extension | 1 + ....rest.client.spi.RestClientBuilderResolver | 1 + ext/pom.xml | 2 + ext/proxy-client/pom.xml | 5 + .../client/proxy/WebResourceFactory.java | 279 ++++++++++++------ pom.xml | 37 +++ 24 files changed, 1307 insertions(+), 118 deletions(-) create mode 100644 core-client/src/main/java/org/glassfish/jersey/client/ResponseExceptionMappingStages.java create mode 100644 ext/microprofile-rest-client/pom.xml create mode 100644 ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/Constant.java create mode 100644 ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientBuilderImpl.java create mode 100644 ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientBuilderResolverImpl.java create mode 100644 ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientValidator.java create mode 100644 ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/cdi/AbstractBeanProducer.java create mode 100644 ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/cdi/RestClientCDIExtension.java create mode 100644 ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/cdi/RestClientProducer.java create mode 100644 ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/config/ConfigController.java create mode 100644 ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/ext/DefaultResponseExceptionMapper.java create mode 100644 ext/microprofile-rest-client/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension create mode 100644 ext/microprofile-rest-client/src/main/resources/META-INF/services/org.eclipse.microprofile.rest.client.spi.RestClientBuilderResolver diff --git a/bom/pom.xml b/bom/pom.xml index 50ee2a4463..9c84309798 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -16,6 +16,7 @@ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 --> + @@ -178,6 +179,11 @@ jersey-proxy-client ${project.version} + + org.glassfish.jersey.ext + jersey-microprofile-rest-client + ${project.version} + org.glassfish.jersey.ext jersey-servlet-portability diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientRuntime.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientRuntime.java index e40da77468..ab8bbad2cb 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/ClientRuntime.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientRuntime.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client; @@ -64,6 +65,7 @@ class ClientRuntime implements JerseyClient.ShutdownHook, ClientExecutor { private final Stage requestProcessingRoot; private final Stage responseProcessingRoot; + private final Stage responseExceptionMapperProcessingRoot; private final Connector connector; private final ClientConfig config; @@ -102,6 +104,11 @@ public ClientRuntime(final ClientConfig config, final Connector connector, final ChainableStage responseFilteringStage = ClientFilteringStages.createResponseFilteringStage( injectionManager); this.responseProcessingRoot = responseFilteringStage != null ? responseFilteringStage : Stages.identity(); + + ChainableStage responseExceptionMapperStage = + ResponseExceptionMappingStages.createResponseExceptionMappingStage(injectionManager); + this.responseExceptionMapperProcessingRoot = responseExceptionMapperStage != null + ? responseExceptionMapperStage : Stages.identity(); this.managedObjectsFinalizer = bootstrapBag.getManagedObjectsFinalizer(); this.config = config; this.connector = connector; @@ -256,7 +263,8 @@ public ClientResponse invoke(final ClientRequest request) { response = aborted.getAbortResponse(); } - return Stages.process(response, responseProcessingRoot); + ClientResponse processedResponse = Stages.process(response, responseProcessingRoot); + return Stages.process(processedResponse, responseExceptionMapperProcessingRoot); } catch (final ProcessingException pe) { throw pe; } catch (final Throwable t) { diff --git a/core-client/src/main/java/org/glassfish/jersey/client/JerseyCompletionStageRxInvoker.java b/core-client/src/main/java/org/glassfish/jersey/client/JerseyCompletionStageRxInvoker.java index 28531ed843..526fa2f76b 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/JerseyCompletionStageRxInvoker.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/JerseyCompletionStageRxInvoker.java @@ -13,17 +13,25 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client; +import java.util.ArrayList; +import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; import java.util.concurrent.ExecutorService; - +import java.util.function.Supplier; import javax.ws.rs.client.CompletionStageRxInvoker; import javax.ws.rs.client.Entity; import javax.ws.rs.client.Invocation; import javax.ws.rs.core.GenericType; +import org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptor; +import org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptorFactory; +import org.glassfish.jersey.internal.inject.InjectionManager; +import org.glassfish.jersey.internal.inject.Providers; +import org.glassfish.jersey.model.internal.RankedComparator; /** * Implementation of Reactive Invoker for {@code CompletionStage}. @@ -33,25 +41,65 @@ */ public class JerseyCompletionStageRxInvoker extends AbstractRxInvoker implements CompletionStageRxInvoker { - JerseyCompletionStageRxInvoker(Invocation.Builder builder, ExecutorService executor) { + private final InjectionManager injectionManager; + + JerseyCompletionStageRxInvoker(Invocation.Builder builder, ExecutorService executor, InjectionManager injectionManager) { super(builder, executor); + this.injectionManager = injectionManager; } @Override public CompletionStage method(final String name, final Entity entity, final Class responseType) { final ExecutorService executorService = getExecutorService(); + List asyncInvocationInterceptors = getAsyncInvocationInterceptors(); + + Supplier invoker = () -> { + asyncInvocationInterceptors.forEach(AsyncInvocationInterceptor::applyContext); + return getSyncInvoker().method(name, entity, responseType); + }; return executorService == null - ? CompletableFuture.supplyAsync(() -> getSyncInvoker().method(name, entity, responseType)) - : CompletableFuture.supplyAsync(() -> getSyncInvoker().method(name, entity, responseType), executorService); + ? CompletableFuture.supplyAsync(invoker) + : CompletableFuture.supplyAsync(invoker, executorService); } @Override public CompletionStage method(final String name, final Entity entity, final GenericType responseType) { final ExecutorService executorService = getExecutorService(); + List asyncInvocationInterceptors = getAsyncInvocationInterceptors(); + + Supplier invoker = () -> { + asyncInvocationInterceptors.forEach(AsyncInvocationInterceptor::applyContext); + return getSyncInvoker().method(name, entity, responseType); + }; return executorService == null - ? CompletableFuture.supplyAsync(() -> getSyncInvoker().method(name, entity, responseType)) - : CompletableFuture.supplyAsync(() -> getSyncInvoker().method(name, entity, responseType), executorService); + ? CompletableFuture.supplyAsync(invoker) + : CompletableFuture.supplyAsync(invoker, executorService); + } + + private List getAsyncInvocationInterceptors() { + RankedComparator comparator + = new RankedComparator<>(RankedComparator.Order.DESCENDING); + Iterable asyncInvocationInterceptorFactories + = Providers.getAllProviders(getInjectionManager(), AsyncInvocationInterceptorFactory.class, comparator); + + List asyncInvocationInterceptors = new ArrayList<>(); + asyncInvocationInterceptorFactories.forEach(factory -> { + AsyncInvocationInterceptor asyncInvocationInterceptor = factory.newInterceptor(); + asyncInvocationInterceptors.add(asyncInvocationInterceptor); + asyncInvocationInterceptor.prepareContext(); + }); + + return asyncInvocationInterceptors; +} + + /** + * Return injection manager this reactive invoker was initialized with. + * + * @return non-null injection manager. + */ + protected InjectionManager getInjectionManager() { + return injectionManager; } } diff --git a/core-client/src/main/java/org/glassfish/jersey/client/JerseyInvocation.java b/core-client/src/main/java/org/glassfish/jersey/client/JerseyInvocation.java index b2dfddd875..feca2ef567 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/JerseyInvocation.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/JerseyInvocation.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client; @@ -59,6 +60,7 @@ import org.glassfish.jersey.client.internal.LocalizationMessages; import org.glassfish.jersey.internal.MapPropertiesDelegate; +import org.glassfish.jersey.internal.inject.InjectionManager; import org.glassfish.jersey.internal.inject.Providers; import org.glassfish.jersey.internal.util.Producer; import org.glassfish.jersey.internal.util.PropertiesHelper; @@ -451,10 +453,9 @@ public Builder property(final String name, final Object value) { @Override public CompletionStageRxInvoker rx() { - ExecutorServiceProvider instance = this.requestContext.getInjectionManager() - .getInstance(ExecutorServiceProvider.class); - - return new JerseyCompletionStageRxInvoker(this, instance.getExecutorService()); + InjectionManager injectionManager = this.requestContext.getInjectionManager(); + ExecutorServiceProvider instance = injectionManager.getInstance(ExecutorServiceProvider.class); + return new JerseyCompletionStageRxInvoker(this, instance.getExecutorService(), injectionManager); } @Override diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ResponseExceptionMappingStages.java b/core-client/src/main/java/org/glassfish/jersey/client/ResponseExceptionMappingStages.java new file mode 100644 index 0000000000..e8576e76a5 --- /dev/null +++ b/core-client/src/main/java/org/glassfish/jersey/client/ResponseExceptionMappingStages.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2018 Payara Foundation 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 org.glassfish.jersey.client; + +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import javax.ws.rs.WebApplicationException; +import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper; + +import org.glassfish.jersey.internal.inject.InjectionManager; +import org.glassfish.jersey.internal.inject.Providers; +import org.glassfish.jersey.model.internal.RankedComparator; +import org.glassfish.jersey.process.internal.AbstractChainableStage; +import org.glassfish.jersey.process.internal.ChainableStage; +import org.glassfish.jersey.process.internal.RequestScope; +import org.glassfish.jersey.process.internal.Stage; + +class ResponseExceptionMappingStages { + + private ResponseExceptionMappingStages() { + // Prevents instantiation + } + + /** + * Create client response exception mapper stage using the injection + * manager. May return {@code null}. + * + * @param injectionManager injection manager to be used. + * @return configured response exception mapper stage, or {@code null} in + * case there are no + * {@link ResponseExceptionMapper response exception mappers} registered in + * the injection manager. + */ + static ChainableStage createResponseExceptionMappingStage(InjectionManager injectionManager) { + RankedComparator comparator = new RankedComparator<>(RankedComparator.Order.DESCENDING); + Iterable responseFilters + = Providers.getAllProviders(injectionManager, ResponseExceptionMapper.class, comparator); + return responseFilters.iterator().hasNext() ? new ExceptionMapperStage(responseFilters) : null; + } + + private static class ExceptionMapperStage extends AbstractChainableStage { + + private final Iterable mappers; + + private ExceptionMapperStage(Iterable mappers) { + this.mappers = mappers; + } + + @Override + public Stage.Continuation apply(ClientResponse responseContext) { + Map mapperPriorityMap = new HashMap<>(); + for (ResponseExceptionMapper mapper : mappers) { + if (mapper.handles(responseContext.getStatus(), responseContext.getHeaders())) { + mapperPriorityMap.put(mapper, mapper.getPriority()); + } + } + if (mapperPriorityMap.size() > 0) { + Map, Integer> errors = new HashMap<>(); + ClientRequest clientRequest = responseContext.getRequestContext(); + ClientRuntime runtime = clientRequest.getClientRuntime(); + RequestScope requestScope = runtime.getRequestScope(); + mapperPriorityMap.forEach((m, i) -> { + Optional t = Optional.ofNullable(m.toThrowable( + new InboundJaxrsResponse(responseContext, requestScope)) + ); + errors.put(t, i); + }); + + Optional prioritised = Optional.empty(); + for (Map.Entry, Integer> errorEntry : errors.entrySet()) { + if (errorEntry.getKey().isPresent()) { + if (!prioritised.isPresent() || errorEntry.getValue() < errors.get(prioritised)) { + prioritised = errorEntry.getKey(); + } + } + } + + if (prioritised.isPresent()) { + throw (WebApplicationException) prioritised.get(); + } + } + return Stage.Continuation.of(responseContext, getDefaultNext()); + } + + } + +} \ No newline at end of file diff --git a/core-common/pom.xml b/core-common/pom.xml index 37de72af06..e6f6bb5479 100644 --- a/core-common/pom.xml +++ b/core-common/pom.xml @@ -16,6 +16,7 @@ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 --> + 4.0.0 @@ -187,6 +188,10 @@ org.glassfish.hk2 osgi-resource-locator + + org.eclipse.microprofile.rest.client + microprofile-rest-client-api + diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/inject/Providers.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/Providers.java index a965574541..c86d321be5 100644 --- a/core-common/src/main/java/org/glassfish/jersey/internal/inject/Providers.java +++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/Providers.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.internal.inject; @@ -83,6 +84,7 @@ private static Map, ProviderRuntime> getJaxRsProviderInterfaces() { interfaces.put(javax.ws.rs.ext.ReaderInterceptor.class, ProviderRuntime.BOTH); interfaces.put(javax.ws.rs.ext.WriterInterceptor.class, ProviderRuntime.BOTH); interfaces.put(javax.ws.rs.ext.ParamConverterProvider.class, ProviderRuntime.BOTH); + interfaces.put(org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper.class, ProviderRuntime.BOTH); interfaces.put(javax.ws.rs.container.ContainerRequestFilter.class, ProviderRuntime.SERVER); interfaces.put(javax.ws.rs.container.ContainerResponseFilter.class, ProviderRuntime.SERVER); @@ -91,6 +93,7 @@ private static Map, ProviderRuntime> getJaxRsProviderInterfaces() { interfaces.put(javax.ws.rs.client.ClientResponseFilter.class, ProviderRuntime.CLIENT); interfaces.put(javax.ws.rs.client.ClientRequestFilter.class, ProviderRuntime.CLIENT); interfaces.put(javax.ws.rs.client.RxInvokerProvider.class, ProviderRuntime.CLIENT); + interfaces.put(org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptorFactory.class, ProviderRuntime.CLIENT); return interfaces; } diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/MessageBodyFactory.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/MessageBodyFactory.java index ae361ee6b6..4687963bca 100644 --- a/core-common/src/main/java/org/glassfish/jersey/message/internal/MessageBodyFactory.java +++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/MessageBodyFactory.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.message.internal; @@ -35,6 +36,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.Set; import java.util.function.Function; import java.util.logging.Level; @@ -792,21 +794,36 @@ private MessageBodyWriter _getMessageBodyWriter(final Class c, final T final TracingLogger tracingLogger = TracingLogger.getInstance(propertiesDelegate); MessageBodyWriter selected = null; - final Iterator iterator = writers.iterator(); - while (iterator.hasNext()) { - final WriterModel model = iterator.next(); - if (model.isWriteable(c, t, as, mediaType)) { - selected = (MessageBodyWriter) model.provider(); - tracingLogger.log(MsgTraceEvent.MBW_SELECTED, selected); - break; - } - tracingLogger.log(MsgTraceEvent.MBW_NOT_WRITEABLE, model.provider()); - } - if (tracingLogger.isLogEnabled(MsgTraceEvent.MBW_SKIPPED)) { + Optional customModel = writers.stream() + .filter(WriterModel::isCustom) + .filter(model -> model.isWriteable(c, t, as, mediaType)) + .findAny(); + if (customModel.isPresent()) { + selected = customModel.get().provider(); + tracingLogger.log(MsgTraceEvent.MBW_SELECTED, selected); + if (tracingLogger.isLogEnabled(MsgTraceEvent.MBW_SKIPPED)) { + writers.stream() + .filter(model -> model != customModel.get()) + .forEach(model -> tracingLogger.log(MsgTraceEvent.MBW_SKIPPED, model.provider())); + } + } else { + final Iterator iterator = writers.iterator(); while (iterator.hasNext()) { final WriterModel model = iterator.next(); - tracingLogger.log(MsgTraceEvent.MBW_SKIPPED, model.provider()); + if (model.isWriteable(c, t, as, mediaType)) { + selected = (MessageBodyWriter) model.provider(); + tracingLogger.log(MsgTraceEvent.MBW_SELECTED, selected); + break; + } + tracingLogger.log(MsgTraceEvent.MBW_NOT_WRITEABLE, model.provider()); + } + + if (tracingLogger.isLogEnabled(MsgTraceEvent.MBW_SKIPPED)) { + while (iterator.hasNext()) { + final WriterModel model = iterator.next(); + tracingLogger.log(MsgTraceEvent.MBW_SKIPPED, model.provider()); + } } } diff --git a/ext/microprofile-rest-client/pom.xml b/ext/microprofile-rest-client/pom.xml new file mode 100644 index 0000000000..84f1b8b8ee --- /dev/null +++ b/ext/microprofile-rest-client/pom.xml @@ -0,0 +1,81 @@ + + + + + 4.0.0 + + + org.glassfish.jersey.ext + project + 2.27 + + + jersey-microprofile-rest-client + jersey-ext-microprofile-rest-client + + Jersey extension module providing support for MicroProfile Rest Client + + + + + + org.apache.felix + maven-bundle-plugin + true + true + + + org.glassfish.jersey.microprofile.rest.client.*;version=${project.version} + + true + + + + + + + + org.eclipse.microprofile.rest.client + microprofile-rest-client-api + + + org.eclipse.microprofile.config + microprofile-config-api + + + org.glassfish.jersey.core + jersey-client + ${project.version} + + + org.glassfish.jersey.ext + jersey-proxy-client + ${project.version} + + + org.glassfish.jersey.core + jersey-common + ${project.version} + + + javax.enterprise + cdi-api + + + diff --git a/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/Constant.java b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/Constant.java new file mode 100644 index 0000000000..bf9041b31c --- /dev/null +++ b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/Constant.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2018 Payara Foundation 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 org.glassfish.jersey.microprofile.rest.client; + +public class Constant { + + public static final String DISABLE_DEFAULT_EXCEPTION_MAPPER = "microprofile.rest.client.disable.default.mapper"; + + public static final String REST_URL_FORMAT = "%s/mp-rest/url"; + + public static final String REST_URI_FORMAT = "%s/mp-rest/uri"; + + public static final String REST_SCOPE_FORMAT = "%s/mp-rest/scope"; + +} diff --git a/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientBuilderImpl.java b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientBuilderImpl.java new file mode 100644 index 0000000000..13187ea6c1 --- /dev/null +++ b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientBuilderImpl.java @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2018 Payara Foundation 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 org.glassfish.jersey.microprofile.rest.client; + +import org.glassfish.jersey.microprofile.rest.client.ext.DefaultResponseExceptionMapper; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Map; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.Configuration; +import org.eclipse.microprofile.rest.client.RestClientBuilder; +import org.eclipse.microprofile.rest.client.RestClientDefinitionException; +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.glassfish.jersey.client.proxy.WebResourceFactory; +import static org.glassfish.jersey.microprofile.rest.client.Constant.DISABLE_DEFAULT_EXCEPTION_MAPPER; +import org.glassfish.jersey.microprofile.rest.client.config.ConfigController; +import static java.lang.Boolean.FALSE; +import java.net.URI; +import java.util.concurrent.ExecutorService; +import org.glassfish.jersey.client.JerseyClient; + +public class RestClientBuilderImpl implements RestClientBuilder { + + private URI baseUri; + + private final ClientBuilder clientBuilder; + + public RestClientBuilderImpl() { + clientBuilder = ClientBuilder.newBuilder(); + } + + @Override + public RestClientBuilder baseUrl(URL url) { + try { + this.baseUri = url.toURI(); + } catch (URISyntaxException ex) { + throw new IllegalArgumentException( + String.format("Rest Client url is invalid [%s] ", url), ex + ); + } + return this; + } + + @Override + public RestClientBuilder baseUri(URI uri) { + this.baseUri = uri; + return this; + } + + @Override + public RestClientBuilder executorService(ExecutorService executor) { + if (executor == null) { + throw new IllegalArgumentException("ExecutorService is null"); + } + clientBuilder.executorService(executor); + return this; + } + + @Override + public T build(Class restClient) throws IllegalStateException, RestClientDefinitionException { + + // interface validity + RestClientValidator.getInstance().validate(restClient); + + registerDefaultExceptionMapper(); + + registerProviders(restClient); + + if (baseUri == null) { + throw new IllegalStateException("Base URI or URL can't be null"); + } + + Client client = clientBuilder.build(); + if (client instanceof JerseyClient) { + ((JerseyClient) client).preInitialize(); + } + WebTarget webTarget = client.target(baseUri); + + return WebResourceFactory.newResource(restClient, webTarget); + } + + private void registerDefaultExceptionMapper() { + // Default exception mapper check per client basis + Object disableDefaultExceptionMapperProp = getConfiguration() + .getProperty(DISABLE_DEFAULT_EXCEPTION_MAPPER); + if (disableDefaultExceptionMapperProp == null) { + //check MicroProfile Config + boolean disableDefaultExceptionMapper = ConfigController + .getOptionalValue(DISABLE_DEFAULT_EXCEPTION_MAPPER, Boolean.class) + .orElse(FALSE); + if (!disableDefaultExceptionMapper) { + register(DefaultResponseExceptionMapper.class); + } + } else if (FALSE.equals(disableDefaultExceptionMapperProp)) { + register(DefaultResponseExceptionMapper.class); + } + } + + private void registerProviders(Class restClient) { + RegisterProvider[] providers = restClient.getAnnotationsByType(RegisterProvider.class); + for (RegisterProvider provider : providers) { + register(provider.value(), provider.priority()); + } + } + + @Override + public Configuration getConfiguration() { + return clientBuilder.getConfiguration(); + } + + @Override + public RestClientBuilder property(String name, Object value) { + clientBuilder.property(name, value); + return this; + } + + @Override + public RestClientBuilder register(Class componentClass) { + clientBuilder.register(componentClass); + return this; + } + + @Override + public RestClientBuilder register(Class type, int priority) { + clientBuilder.register(type, priority); + return this; + } + + @Override + public RestClientBuilder register(Class type, Class... contracts) { + clientBuilder.register(type, contracts); + return this; + } + + @Override + public RestClientBuilder register(Class type, Map, Integer> contracts) { + clientBuilder.register(type, contracts); + return this; + } + + @Override + public RestClientBuilder register(Object component) { + clientBuilder.register(component); + return this; + } + + @Override + public RestClientBuilder register(Object component, int priority) { + clientBuilder.register(component, priority); + return this; + } + + @Override + public RestClientBuilder register(Object component, Class... contracts) { + clientBuilder.register(component, contracts); + return this; + } + + @Override + public RestClientBuilder register(Object component, Map, Integer> contracts) { + clientBuilder.register(component, contracts); + return this; + } + +} \ No newline at end of file diff --git a/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientBuilderResolverImpl.java b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientBuilderResolverImpl.java new file mode 100644 index 0000000000..f554ec4b95 --- /dev/null +++ b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientBuilderResolverImpl.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2018 Payara Foundation 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 org.glassfish.jersey.microprofile.rest.client; + +import javax.enterprise.inject.Vetoed; +import org.eclipse.microprofile.rest.client.RestClientBuilder; +import org.eclipse.microprofile.rest.client.spi.RestClientBuilderResolver; + +@Vetoed +public class RestClientBuilderResolverImpl extends RestClientBuilderResolver { + + @Override + public RestClientBuilder newBuilder() { + return new RestClientBuilderImpl(); + } +} diff --git a/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientValidator.java b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientValidator.java new file mode 100644 index 0000000000..c6da18ce9e --- /dev/null +++ b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientValidator.java @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2018 Payara Foundation 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 org.glassfish.jersey.microprofile.rest.client; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Method; +import java.lang.reflect.Parameter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.ws.rs.HttpMethod; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.core.UriBuilder; +import org.eclipse.microprofile.rest.client.RestClientDefinitionException; + +public class RestClientValidator { + + private static volatile RestClientValidator instance; + + private RestClientValidator() { + } + + public static RestClientValidator getInstance() { + if (instance == null) { + synchronized (RestClientValidator.class) { + if (instance == null) { + instance = new RestClientValidator(); + } + } + } + return instance; + } + + /** + * Invalid client interfaces will result in a RestClientDefinitionException + * + * @param restClient + */ + public void validate(Class restClient) { + if (!restClient.isInterface()) { + throw new IllegalArgumentException( + String.format("Rest Client [%s] must be interface", restClient) + ); + } + Method[] methods = restClient.getMethods(); + checkMethodsForMultipleHTTPMethodAnnotations(restClient, methods); + checkMethodsForInvalidURITemplates(restClient, methods); + } + + private void checkMethodsForMultipleHTTPMethodAnnotations(Class restClient, Method[] methods) + throws RestClientDefinitionException { + // using multiple HTTP method annotations on the same method + for (Method method : methods) { + List httpMethods = new ArrayList<>(); + for (Annotation annotation : method.getAnnotations()) { + if (annotation.annotationType() + .getAnnotation(HttpMethod.class) != null) { + httpMethods.add(annotation.annotationType().getSimpleName()); + } + if (httpMethods.size() > 1) { + throw new RestClientDefinitionException( + String.format( + "Rest Client [%s] method [%s] contains multiple HTTP method annotations %s", + restClient, + method.getName(), + httpMethods + ) + ); + } + + } + } + } + + private void checkMethodsForInvalidURITemplates(Class restClient, Method[] methods) + throws RestClientDefinitionException { + + // invalid parameter + Path classLevelPath = restClient.getAnnotation(Path.class); + + final Set classLevelVariables = new HashSet<>(); + UriBuilder classBuilder = null; + if (classLevelPath != null) { + classBuilder = UriBuilder.fromUri(classLevelPath.value()); + classLevelVariables.addAll(getPathParams(classLevelPath)); + } + + // invalid URI templates + for (Method method : methods) { + UriBuilder builder; + + Set pathParam = new HashSet<>(classLevelVariables); + Path methodLevelPath = method.getAnnotation(Path.class); + if (classLevelPath == null && methodLevelPath == null) { + continue; + } else if (methodLevelPath != null) { + builder = UriBuilder.fromUri(classLevelPath == null + ? methodLevelPath.value() : classLevelPath.value() + "/" + methodLevelPath.value() + ); + pathParam.addAll(getPathParams(methodLevelPath)); + } else { + builder = classBuilder; + } + + Map variableParam = getVariableParam(method); + if (pathParam.size() != variableParam.size()) { + throw new RestClientDefinitionException( + String.format( + "Rest Client [%s] method [%s] parameters %s are not matched with path variables %s", + restClient, method.getName(), variableParam.keySet(), pathParam + ) + ); + } + try { + builder.resolveTemplates(variableParam, false).build(); + } catch (IllegalArgumentException ex) { + throw new RestClientDefinitionException( + String.format( + "Rest Client [%s] method [%s] parameters %s are not matched with path variables %s", + restClient, method.getName(), variableParam.keySet(), pathParam + ), ex + ); + } + + } + } + + private Map getVariableParam(Method method) { + Map params = new HashMap<>(); + for (Parameter p : method.getParameters()) { + PathParam pathParam = p.getAnnotation(PathParam.class); + if (pathParam != null) { + params.put(pathParam.value(), ""); + } + } + return params; + } + + private List getPathParams(Path path) { + List params = new ArrayList<>(); + Pattern p = Pattern.compile("\\{(.*?)\\}"); + Matcher m = p.matcher(path.value()); + + while (m.find()) { + params.add(m.group(1)); + } + return params; + } + +} diff --git a/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/cdi/AbstractBeanProducer.java b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/cdi/AbstractBeanProducer.java new file mode 100644 index 0000000000..5f014dcb02 --- /dev/null +++ b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/cdi/AbstractBeanProducer.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2018 Payara Foundation 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 org.glassfish.jersey.microprofile.rest.client.cdi; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; +import java.util.Collections; +import static java.util.Collections.emptySet; +import java.util.Set; +import javax.enterprise.inject.spi.Bean; +import javax.enterprise.inject.spi.BeanManager; +import javax.enterprise.inject.spi.InjectionPoint; +import javax.enterprise.inject.spi.PassivationCapable; + +public abstract class AbstractBeanProducer implements Bean, PassivationCapable { + + protected final Class beanClass; + + protected final BeanManager beanManager; + + public AbstractBeanProducer(Class typeDef, BeanManager beanManager) { + this.beanClass = typeDef; + this.beanManager = beanManager; + } + + @Override + public String getId() { + return beanClass.getName(); + } + + @Override + public String getName() { + return beanClass.getName(); + } + + @Override + public Class getBeanClass() { + return beanClass; + } + + @Override + public Set getTypes() { + return Collections.singleton(beanClass); + } + + @Override + public Set> getStereotypes() { + return emptySet(); + } + + @Override + public Set getInjectionPoints() { + return emptySet(); + } + + @Override + public boolean isAlternative() { + return false; + } + + @Override + public boolean isNullable() { + return false; + } + +} diff --git a/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/cdi/RestClientCDIExtension.java b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/cdi/RestClientCDIExtension.java new file mode 100644 index 0000000000..d03fa92d90 --- /dev/null +++ b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/cdi/RestClientCDIExtension.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2018 Payara Foundation 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 org.glassfish.jersey.microprofile.rest.client.cdi; + +import java.util.LinkedHashSet; +import java.util.Set; +import javax.enterprise.event.Observes; +import javax.enterprise.inject.spi.AfterBeanDiscovery; +import javax.enterprise.inject.spi.AfterDeploymentValidation; +import javax.enterprise.inject.spi.BeanManager; +import javax.enterprise.inject.spi.Extension; +import javax.enterprise.inject.spi.ProcessAnnotatedType; +import javax.enterprise.inject.spi.WithAnnotations; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +public class RestClientCDIExtension implements Extension { + + private final Set> validRestClientClasses = new LinkedHashSet<>(); + + private final Set> invalidRestClientClasses = new LinkedHashSet<>(); + + public void registerClient( + @Observes + @WithAnnotations(RegisterRestClient.class) + ProcessAnnotatedType processAnnotatedType) { + Class restClient = processAnnotatedType.getAnnotatedType().getJavaClass(); + if (restClient.isInterface()) { + validRestClientClasses.add(restClient); + processAnnotatedType.veto(); + } else { + invalidRestClientClasses.add(restClient); + } + } + + public void createProxy(@Observes AfterBeanDiscovery afterBeanDiscovery, BeanManager beanManager) { + validRestClientClasses.stream() + .map(restClient -> new RestClientProducer(restClient, beanManager)) + .forEach(afterBeanDiscovery::addBean); + } + + public void reportErrors(@Observes AfterDeploymentValidation afterDeploymentValidation) { + invalidRestClientClasses.stream() + .map(restClient -> new IllegalArgumentException( + String.format("Rest Client [%s] must be interface", restClient) + )) + .forEach(afterDeploymentValidation::addDeploymentProblem); + } +} diff --git a/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/cdi/RestClientProducer.java b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/cdi/RestClientProducer.java new file mode 100644 index 0000000000..b1c870cbfa --- /dev/null +++ b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/cdi/RestClientProducer.java @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2018 Payara Foundation 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 org.glassfish.jersey.microprofile.rest.client.cdi; + +import static org.glassfish.jersey.microprofile.rest.client.Constant.REST_SCOPE_FORMAT; +import static org.glassfish.jersey.microprofile.rest.client.Constant.REST_URL_FORMAT; +import org.glassfish.jersey.microprofile.rest.client.config.ConfigController; +import java.lang.annotation.Annotation; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import javax.enterprise.context.Dependent; +import javax.enterprise.context.spi.CreationalContext; +import javax.enterprise.inject.Any; +import javax.enterprise.inject.Default; +import javax.enterprise.inject.spi.BeanManager; +import javax.enterprise.util.AnnotationLiteral; +import org.eclipse.microprofile.rest.client.RestClientBuilder; +import org.eclipse.microprofile.rest.client.inject.RestClient; +import static org.glassfish.jersey.microprofile.rest.client.Constant.REST_URI_FORMAT; + +public class RestClientProducer extends AbstractBeanProducer { + + private final Class scope; + + public RestClientProducer(Class restClient, BeanManager beanManager) { + super(restClient, beanManager); + this.scope = findScope(); + } + + @Override + public Class getScope() { + return scope; + } + + @Override + public Set getQualifiers() { + Set qualifiers = new HashSet(); + qualifiers.add(new AnnotationLiteral() { + }); + qualifiers.add(new AnnotationLiteral() { + }); + qualifiers.add(RestClient.LITERAL); + return qualifiers; + } + + @Override + public Object create(CreationalContext creationalContext) { + return RestClientBuilder + .newBuilder() + .baseUri(getBaseUri()) + .build(beanClass); + } + + @Override + public void destroy(Object instance, CreationalContext creationalContext) { + } + + private URI getBaseUri() { + String uriProperty = String.format(REST_URI_FORMAT, getName()); + Optional baseUri = ConfigController.getOptionalValue(uriProperty); + if (!baseUri.isPresent()) { + String urlProperty = String.format(REST_URL_FORMAT, getName()); + Optional baseUrl = ConfigController.getOptionalValue(urlProperty); + if (!baseUrl.isPresent()) { + throw new IllegalArgumentException( + String.format("Rest Client [%s] url not found in configuration", beanClass) + ); + } else { + try { + return new URL(baseUrl.get()).toURI(); + } catch (MalformedURLException | URISyntaxException ex) { + throw new IllegalArgumentException( + String.format("Rest Client [%s] url is invalid [%s] ", beanClass, baseUri), ex + ); + } + } + } else { + try { + return new URI(baseUri.get()); + } catch (URISyntaxException ex) { + throw new IllegalArgumentException( + String.format("Rest Client [%s] uri is invalid [%s] ", beanClass, baseUri), ex + ); + } + } + } + + private Class findScope() { + + String scopeProperty = String.format(REST_SCOPE_FORMAT, getName()); + Optional configuredScope = ConfigController.getOptionalValue(scopeProperty); + if (configuredScope.isPresent()) { + try { + PrivilegedAction action = () -> Thread.currentThread().getContextClassLoader(); + ClassLoader classLoader = AccessController.doPrivileged(action); + if (classLoader == null) { + action = () -> this.getClass().getClassLoader(); + classLoader = AccessController.doPrivileged(action); + } + return (Class) Class.forName(configuredScope.get(), true, classLoader); + } catch (ClassNotFoundException ex) { + throw new IllegalArgumentException( + String.format("Rest Client [%s] scope is invalid [%s] ", beanClass, configuredScope.get()), ex + ); + } + } + + List definedScopes = new ArrayList<>(); + Annotation[] annotations = beanClass.getDeclaredAnnotations(); + for (Annotation annotation : annotations) { + if (beanManager.isScope(annotation.annotationType())) { + definedScopes.add(annotation); + } + } + if (definedScopes.isEmpty()) { + return Dependent.class; + } else if (definedScopes.size() == 1) { + return definedScopes.get(0).annotationType(); + } else { + throw new IllegalArgumentException( + String.format("Multiple scope definition [%s] found on the Rest Client [%s]", definedScopes, beanClass) + ); + } + } +} diff --git a/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/config/ConfigController.java b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/config/ConfigController.java new file mode 100644 index 0000000000..56a871cf31 --- /dev/null +++ b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/config/ConfigController.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2018 Payara Foundation 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 org.glassfish.jersey.microprofile.rest.client.config; + +import java.util.Optional; +import org.eclipse.microprofile.config.Config; +import org.eclipse.microprofile.config.ConfigProvider; + +public final class ConfigController { + + private ConfigController() { + } + + private static Config getConfig() { + Config config; + try { + config = ConfigProvider.getConfig(); + } catch (ExceptionInInitializerError | IllegalStateException | NoClassDefFoundError ex) { + // if MicroProfile Config module not found + config = null; + } + return config; + } + + public static Optional getOptionalValue(String propertyName) { + return getOptionalValue(propertyName, String.class); + } + + public static Optional getOptionalValue(String propertyName, Class clazz) { + Config config = getConfig(); + return config != null ? config.getOptionalValue(propertyName, clazz) : Optional.empty(); + } + + public static String getValue(String propertyName) { + return getValue(propertyName, String.class); + } + + public static T getValue(String propertyName, Class clazz) { + Config config = getConfig(); + return config != null ? config.getValue(propertyName, clazz) : null; + } + +} diff --git a/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/ext/DefaultResponseExceptionMapper.java b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/ext/DefaultResponseExceptionMapper.java new file mode 100644 index 0000000000..9ec198f1e5 --- /dev/null +++ b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/ext/DefaultResponseExceptionMapper.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018 Payara Foundation 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 org.glassfish.jersey.microprofile.rest.client.ext; + +import javax.enterprise.inject.Vetoed; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.Response; +import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper; + +@Vetoed +public class DefaultResponseExceptionMapper implements ResponseExceptionMapper { + + @Override + public Throwable toThrowable(Response response) { + return new WebApplicationException(response); + } + + @Override + public int getPriority() { + return Integer.MAX_VALUE; + } +} diff --git a/ext/microprofile-rest-client/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension b/ext/microprofile-rest-client/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension new file mode 100644 index 0000000000..5b722d6f8e --- /dev/null +++ b/ext/microprofile-rest-client/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension @@ -0,0 +1 @@ +org.glassfish.jersey.microprofile.rest.client.cdi.RestClientCDIExtension \ No newline at end of file diff --git a/ext/microprofile-rest-client/src/main/resources/META-INF/services/org.eclipse.microprofile.rest.client.spi.RestClientBuilderResolver b/ext/microprofile-rest-client/src/main/resources/META-INF/services/org.eclipse.microprofile.rest.client.spi.RestClientBuilderResolver new file mode 100644 index 0000000000..863696ed04 --- /dev/null +++ b/ext/microprofile-rest-client/src/main/resources/META-INF/services/org.eclipse.microprofile.rest.client.spi.RestClientBuilderResolver @@ -0,0 +1 @@ +org.glassfish.jersey.microprofile.rest.client.RestClientBuilderResolverImpl \ No newline at end of file diff --git a/ext/pom.xml b/ext/pom.xml index 0e56abfa33..a81cbf38d0 100644 --- a/ext/pom.xml +++ b/ext/pom.xml @@ -16,6 +16,7 @@ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 --> + 4.0.0 @@ -50,6 +51,7 @@ mvc-jsp mvc-mustache proxy-client + microprofile-rest-client rx servlet-portability spring4 diff --git a/ext/proxy-client/pom.xml b/ext/proxy-client/pom.xml index 4477b0f7b0..fa268a4eca 100644 --- a/ext/proxy-client/pom.xml +++ b/ext/proxy-client/pom.xml @@ -16,6 +16,7 @@ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 --> + 4.0.0 @@ -62,5 +63,9 @@ pom test + + javax.json + javax.json-api + diff --git a/ext/proxy-client/src/main/java/org/glassfish/jersey/client/proxy/WebResourceFactory.java b/ext/proxy-client/src/main/java/org/glassfish/jersey/client/proxy/WebResourceFactory.java index d457c0b26d..e0f3f4793e 100644 --- a/ext/proxy-client/src/main/java/org/glassfish/jersey/client/proxy/WebResourceFactory.java +++ b/ext/proxy-client/src/main/java/org/glassfish/jersey/client/proxy/WebResourceFactory.java @@ -13,25 +13,31 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client.proxy; import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; +import java.lang.reflect.Field; import java.lang.reflect.InvocationHandler; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Proxy; import java.lang.reflect.Type; import java.security.AccessController; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; - +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.ws.rs.BeanParam; import javax.ws.rs.Consumes; import javax.ws.rs.CookieParam; import javax.ws.rs.DefaultValue; @@ -75,8 +81,8 @@ public final class WebResourceFactory implements InvocationHandler { private static final MultivaluedMap EMPTY_HEADERS = new MultivaluedHashMap<>(); private static final Form EMPTY_FORM = new Form(); - private static final List PARAM_ANNOTATION_CLASSES = Arrays.asList(PathParam.class, QueryParam.class, - HeaderParam.class, CookieParam.class, MatrixParam.class, FormParam.class); + private static final Set PARAM_ANNOTATION_CLASSES = createParamAnnotationSet(); + private static final Logger LOG = Logger.getLogger(WebResourceFactory.class.getName()); /** * Creates a new client-side representation of a resource described by @@ -194,75 +200,13 @@ public Object invoke(final Object proxy, final Method method, final Object[] arg for (final Annotation ann : paramAnns[i]) { anns.put(ann.annotationType(), ann); } - Annotation ann; + Object value = args[i]; if (!hasAnyParamAnnotation(anns)) { entityType = method.getGenericParameterTypes()[i]; entity = value; } else { - if (value == null && (ann = anns.get(DefaultValue.class)) != null) { - value = ((DefaultValue) ann).value(); - } - - if (value != null) { - if ((ann = anns.get(PathParam.class)) != null) { - newTarget = newTarget.resolveTemplate(((PathParam) ann).value(), value); - } else if ((ann = anns.get((QueryParam.class))) != null) { - if (value instanceof Collection) { - newTarget = newTarget.queryParam(((QueryParam) ann).value(), convert((Collection) value)); - } else { - newTarget = newTarget.queryParam(((QueryParam) ann).value(), value); - } - } else if ((ann = anns.get((HeaderParam.class))) != null) { - if (value instanceof Collection) { - headers.addAll(((HeaderParam) ann).value(), convert((Collection) value)); - } else { - headers.addAll(((HeaderParam) ann).value(), value); - } - - } else if ((ann = anns.get((CookieParam.class))) != null) { - final String name = ((CookieParam) ann).value(); - Cookie c; - if (value instanceof Collection) { - for (final Object v : ((Collection) value)) { - if (!(v instanceof Cookie)) { - c = new Cookie(name, v.toString()); - } else { - c = (Cookie) v; - if (!name.equals(((Cookie) v).getName())) { - // is this the right thing to do? or should I fail? or ignore the difference? - c = new Cookie(name, c.getValue(), c.getPath(), c.getDomain(), c.getVersion()); - } - } - cookies.add(c); - } - } else { - if (!(value instanceof Cookie)) { - cookies.add(new Cookie(name, value.toString())); - } else { - c = (Cookie) value; - if (!name.equals(((Cookie) value).getName())) { - // is this the right thing to do? or should I fail? or ignore the difference? - cookies.add(new Cookie(name, c.getValue(), c.getPath(), c.getDomain(), c.getVersion())); - } - } - } - } else if ((ann = anns.get((MatrixParam.class))) != null) { - if (value instanceof Collection) { - newTarget = newTarget.matrixParam(((MatrixParam) ann).value(), convert((Collection) value)); - } else { - newTarget = newTarget.matrixParam(((MatrixParam) ann).value(), value); - } - } else if ((ann = anns.get((FormParam.class))) != null) { - if (value instanceof Collection) { - for (final Object v : ((Collection) value)) { - form.param(((FormParam) ann).value(), v.toString()); - } - } else { - form.param(((FormParam) ann).value(), value.toString()); - } - } - } + newTarget = parseParamMetadata(newTarget, headers, cookies, form, anns, value); } } @@ -271,17 +215,10 @@ public Object invoke(final Object proxy, final Method method, final Object[] arg return WebResourceFactory.newResource(responseType, newTarget, true, headers, cookies, form); } - // accepted media types - Produces produces = method.getAnnotation(Produces.class); - if (produces == null) { - produces = proxyIfc.getAnnotation(Produces.class); - } - final String[] accepts = (produces == null) ? EMPTY : produces.value(); - // determine content type String contentType = null; + final List contentTypeEntries = headers.get(HttpHeaders.CONTENT_TYPE); if (entity != null) { - final List contentTypeEntries = headers.get(HttpHeaders.CONTENT_TYPE); if ((contentTypeEntries != null) && (!contentTypeEntries.isEmpty())) { contentType = contentTypeEntries.get(0).toString(); } else { @@ -292,15 +229,8 @@ public Object invoke(final Object proxy, final Method method, final Object[] arg if (consumes != null && consumes.value().length > 0) { contentType = consumes.value()[0]; } - } - } - - Invocation.Builder builder = newTarget.request() - .headers(headers) // this resets all headers so do this first - .accept(accepts); // if @Produces is defined, propagate values into Accept header; empty array is NO-OP - for (final Cookie c : cookies) { - builder = builder.cookie(c); + } } final Object result; @@ -310,7 +240,11 @@ public Object invoke(final Object proxy, final Method method, final Object[] arg contentType = MediaType.APPLICATION_FORM_URLENCODED; } else { if (contentType == null) { - contentType = MediaType.APPLICATION_OCTET_STREAM; + if (entity instanceof javax.json.JsonValue) { + contentType = MediaType.APPLICATION_JSON; + } else { + contentType = MediaType.TEXT_PLAIN; + } } if (!form.asMap().isEmpty()) { if (entity instanceof Form) { @@ -321,26 +255,169 @@ public Object invoke(final Object proxy, final Method method, final Object[] arg } } + // accepted media types + Produces produces = method.getAnnotation(Produces.class); + if (produces == null) { + produces = proxyIfc.getAnnotation(Produces.class); + } + final String[] accepts = (produces == null) ? EMPTY : produces.value(); + + Invocation.Builder builder = newTarget.request() + .headers(headers) // this resets all headers so do this first + .accept(accepts); // if @Produces is defined, propagate values into Accept header; empty array is NO-OP + + for (final Cookie c : cookies) { + builder = builder.cookie(c); + } + final GenericType responseGenericType = new GenericType(method.getGenericReturnType()); + + GenericType responseParameterizedType = responseGenericType; + if (method.getGenericReturnType() instanceof ParameterizedType) { + ParameterizedType parameterizedType = (ParameterizedType) method.getGenericReturnType(); + Type[] typeArguments = parameterizedType.getActualTypeArguments(); + responseParameterizedType = new GenericType(typeArguments[0]); + } + if (entity != null) { if (entityType instanceof ParameterizedType) { entity = new GenericEntity(entity, entityType); } - result = builder.method(httpMethod, Entity.entity(entity, contentType), responseGenericType); + if (responseType.isAssignableFrom(java.util.concurrent.CompletionStage.class)) { + result = builder.rx().method(httpMethod, Entity.entity(entity, contentType), responseParameterizedType); + } else if (responseType.isAssignableFrom(java.util.concurrent.Future.class)) { + result = builder.async().method(httpMethod, Entity.entity(entity, contentType), responseParameterizedType); + } else { + result = builder.method(httpMethod, Entity.entity(entity, contentType), responseGenericType); + } } else { - result = builder.method(httpMethod, responseGenericType); + if (responseType.isAssignableFrom(java.util.concurrent.CompletionStage.class)) { + result = builder.rx().method(httpMethod, responseParameterizedType); + } else if (responseType.isAssignableFrom(java.util.concurrent.Future.class)) { + result = builder.async().method(httpMethod, responseParameterizedType); + } else { + result = builder.method(httpMethod, responseGenericType); + } } return result; } - private boolean hasAnyParamAnnotation(final Map anns) { - for (final Class paramAnnotationClass : PARAM_ANNOTATION_CLASSES) { - if (anns.containsKey(paramAnnotationClass)) { - return true; + private WebTarget parseParamMetadata( + WebTarget newTarget, + MultivaluedHashMap headers, + LinkedList cookies, + Form form, + Map anns, + Object value) { + + Annotation ann; + if (value == null && (ann = anns.get(DefaultValue.class)) != null) { + value = ((DefaultValue) ann).value(); + } + + if (value != null) { + if ((ann = anns.get(PathParam.class)) != null) { + newTarget = newTarget.resolveTemplate(((PathParam) ann).value(), value); + } else if ((ann = anns.get((QueryParam.class))) != null) { + if (value instanceof Collection) { + newTarget = newTarget.queryParam(((QueryParam) ann).value(), convert((Collection) value)); + } else { + newTarget = newTarget.queryParam(((QueryParam) ann).value(), value); + } + } else if (anns.get(BeanParam.class) != null) { + Class beanParamType = value.getClass(); + Field[] fields = beanParamType.getDeclaredFields(); + for (Field field : fields) { + final Map annsIn = new HashMap<>(); + for (final Annotation annIn : field.getAnnotations()) { + annsIn.put(annIn.annotationType(), annIn); + } + if (hasAnyParamAnnotation(annsIn)) { + try { + if (!field.isAccessible()) { + field.setAccessible(true); + } + newTarget = parseParamMetadata(newTarget, headers, cookies, form, annsIn, field.get(value)); + } catch (IllegalArgumentException | IllegalAccessException ex) { + LOG.log(Level.SEVERE, null, ex); + } + } + } + Method[] methods = beanParamType.getDeclaredMethods(); + for (Method method : methods) { + final Map annsIn = new HashMap<>(); + for (final Annotation annIn : method.getAnnotations()) { + annsIn.put(annIn.annotationType(), annIn); + } + if (hasAnyParamAnnotation(annsIn)) { + try { + if (!method.isAccessible()) { + method.setAccessible(true); + } + newTarget = parseParamMetadata(newTarget, headers, cookies, form, annsIn, method.invoke(value)); + } catch (InvocationTargetException | IllegalAccessException | IllegalArgumentException ex) { + LOG.log(Level.SEVERE, null, ex); + } + } + } + } else if ((ann = anns.get((HeaderParam.class))) != null) { + if (value instanceof Collection) { + headers.addAll(((HeaderParam) ann).value(), convert((Collection) value)); + } else { + headers.addAll(((HeaderParam) ann).value(), value); + } + + } else if ((ann = anns.get((CookieParam.class))) != null) { + final String name = ((CookieParam) ann).value(); + Cookie c; + if (value instanceof Collection) { + for (final Object v : ((Collection) value)) { + if (!(v instanceof Cookie)) { + c = new Cookie(name, v.toString()); + } else { + c = (Cookie) v; + if (!name.equals(((Cookie) v).getName())) { + // is this the right thing to do? or should I fail? or ignore the difference? + c = new Cookie(name, c.getValue(), c.getPath(), c.getDomain(), c.getVersion()); + } + } + cookies.add(c); + } + } else { + if (!(value instanceof Cookie)) { + cookies.add(new Cookie(name, value.toString())); + } else { + c = (Cookie) value; + if (!name.equals(((Cookie) value).getName())) { + // is this the right thing to do? or should I fail? or ignore the difference? + cookies.add(new Cookie(name, c.getValue(), c.getPath(), c.getDomain(), c.getVersion())); + } + } + } + } else if ((ann = anns.get((MatrixParam.class))) != null) { + if (value instanceof Collection) { + newTarget = newTarget.matrixParam(((MatrixParam) ann).value(), convert((Collection) value)); + } else { + newTarget = newTarget.matrixParam(((MatrixParam) ann).value(), value); + } + } else if ((ann = anns.get((FormParam.class))) != null) { + if (value instanceof Collection) { + for (final Object v : ((Collection) value)) { + form.param(((FormParam) ann).value(), v.toString()); + } + } else { + form.param(((FormParam) ann).value(), value.toString()); + } } } - return false; + return newTarget; + } + + private boolean hasAnyParamAnnotation(final Map anns) { + return anns.keySet() + .stream() + .anyMatch(PARAM_ANNOTATION_CLASSES::contains); } private Object[] convert(final Collection value) { @@ -348,13 +425,25 @@ private Object[] convert(final Collection value) { } private static WebTarget addPathFromAnnotation(final AnnotatedElement ae, WebTarget target) { - final Path p = ae.getAnnotation(Path.class); - if (p != null) { - target = target.path(p.value()); + final Path path = ae.getAnnotation(Path.class); + if (path != null && !"/".equals(path.value())) { + target = target.path(path.value()); } return target; } + private static Set createParamAnnotationSet() { + Set set = new HashSet<>(7); + set.add(HeaderParam.class); + set.add(CookieParam.class); + set.add(MatrixParam.class); + set.add(QueryParam.class); + set.add(PathParam.class); + set.add(FormParam.class); + set.add(BeanParam.class); + return Collections.unmodifiableSet(set); + } + @Override public String toString() { return target.toString(); diff --git a/pom.xml b/pom.xml index f438c654d2..781a460802 100644 --- a/pom.xml +++ b/pom.xml @@ -16,6 +16,7 @@ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 --> + 4.0.0 @@ -1369,6 +1370,24 @@ ${jta.api.version} + + javax.json + javax.json-api + ${jsonp.api.version} + + + + org.eclipse.microprofile.rest.client + microprofile-rest-client-api + ${microprofile.rest.client.api.version} + + + + org.eclipse.microprofile.config + microprofile-config-api + ${microprofile.config.api.version} + + com.google.guava guava @@ -1884,6 +1903,21 @@ + + + eclipse.microprofile + Eclipse MicroProfile Repository + https://repo.eclipse.org/content/groups/microprofile/ + + true + + + true + + + + + 2.4 @@ -1952,6 +1986,8 @@ 1.0 2.1 2.1 + 1.1-payara-p1 + 1.1 3.3.0.Final 1.19.3 ${jersey1.version} @@ -1961,6 +1997,7 @@ 6.1.14 1.10.2 1.18 + 1.1 1.1 1.1.1 2.0 From 98acc3e01668696b3580ae533d70a08d72f56645 Mon Sep 17 00:00:00 2001 From: jGauravGupta Date: Tue, 15 May 2018 19:18:59 +0530 Subject: [PATCH 02/17] Move Parameter API to jersey-core-common module Signed-off-by: jGauravGupta --- .../glassfish/jersey/apache/connector/ManagedClientTest.java | 2 +- .../glassfish/jersey/jetty/connector/ManagedClientTest.java | 2 +- .../src/main/java/org/glassfish/jersey}/Uri.java | 3 ++- .../java/org/glassfish/jersey}/model/AnnotatedMethod.java | 5 +++-- .../java/org/glassfish/jersey}/model/ParamQualifier.java | 3 ++- .../src/main/java/org/glassfish/jersey}/model/Parameter.java | 5 +++-- .../test/java/org/glassfish/jersey}/model/ParameterTest.java | 5 ++--- .../jersey}/model/ParameterWithMultipleAnnotationsTest.java | 5 ++--- .../jersey/server/filter/RolesAllowedDynamicFeature.java | 3 ++- .../server/internal/inject/AbstractValueParamProvider.java | 3 ++- .../internal/inject/AsyncResponseValueParamProvider.java | 3 ++- .../server/internal/inject/BeanParamValueParamProvider.java | 3 ++- .../internal/inject/CookieParamValueParamProvider.java | 3 ++- .../inject/DelegatedInjectionValueParamProvider.java | 5 +++-- .../internal/inject/EntityParamValueParamProvider.java | 3 ++- .../server/internal/inject/FormParamValueParamProvider.java | 3 ++- .../internal/inject/HeaderParamValueParamProvider.java | 3 ++- .../internal/inject/MatrixParamValueParamProvider.java | 3 ++- .../inject/MultivaluedParameterExtractorFactory.java | 3 ++- .../inject/MultivaluedParameterExtractorProvider.java | 3 ++- .../server/internal/inject/ParamInjectionResolver.java | 3 ++- .../server/internal/inject/PathParamValueParamProvider.java | 3 ++- .../server/internal/inject/QueryParamValueParamProvider.java | 3 ++- .../internal/inject/ValueParamProviderConfigurator.java | 3 ++- .../server/internal/inject/WebTargetValueParamProvider.java | 5 +++-- .../server/internal/routing/MethodSelectingRouter.java | 3 ++- .../glassfish/jersey/server/model/HandlerConstructor.java | 2 ++ .../glassfish/jersey/server/model/IntrospectionModeller.java | 3 +++ .../java/org/glassfish/jersey/server/model/Invocable.java | 2 ++ .../glassfish/jersey/server/model/InvocableValidator.java | 2 ++ .../org/glassfish/jersey/server/model/MethodHandler.java | 2 ++ .../java/org/glassfish/jersey/server/model/MethodList.java | 2 ++ .../org/glassfish/jersey/server/model/Parameterized.java | 2 ++ .../org/glassfish/jersey/server/model/ResourceMethod.java | 2 ++ .../jersey/server/model/ResourceMethodValidator.java | 2 ++ .../jersey/server/model/RuntimeResourceModelValidator.java | 2 ++ .../model/internal/JavaResourceMethodDispatcherProvider.java | 2 +- .../server/spi/internal/ParamValueFactoryWithSource.java | 3 ++- .../jersey/server/spi/internal/ParameterValueHelper.java | 3 ++- .../jersey/server/spi/internal/ValueParamProvider.java | 3 ++- .../java/org/glassfish/jersey/server/wadl/WadlGenerator.java | 3 ++- .../glassfish/jersey/server/wadl/internal/WadlBuilder.java | 3 ++- .../jersey/server/wadl/internal/WadlGeneratorImpl.java | 3 ++- .../internal/generators/WadlGeneratorApplicationDoc.java | 3 ++- .../internal/generators/WadlGeneratorGrammarsSupport.java | 3 ++- .../generators/WadlGeneratorJAXBGrammarGenerator.java | 3 ++- .../internal/generators/resourcedoc/ResourceDocAccessor.java | 3 ++- .../resourcedoc/WadlGeneratorResourceDocSupport.java | 3 ++- .../org/glassfish/jersey/server/internal/inject/UriTest.java | 3 ++- .../glassfish/jersey/server/model/GenericMethodListTest.java | 2 ++ .../org/glassfish/jersey/server/model/MethodListTest.java | 2 ++ .../modelapi/annotation/IntrospectionModellerTest.java | 3 ++- .../jersey/server/wadl/config/WadlGeneratorConfigTest.java | 3 ++- .../wadl/config/WadlGeneratorConfigurationLoaderTest.java | 3 ++- .../jersey/server/wadl/config/WadlGeneratorLoaderTest.java | 3 ++- .../jersey/ext/cdi1x/internal/CdiComponentProvider.java | 3 ++- .../glassfish/jersey/linking/InjectLinkFieldDescriptor.java | 3 ++- .../org/glassfish/jersey/linking/ProvideLinkDescriptor.java | 3 ++- .../org/glassfish/jersey/media/multipart/FormDataParam.java | 4 ++-- .../multipart/internal/FormDataParamValueParamProvider.java | 3 ++- .../media/sse/internal/SseEventSinkValueParamProvider.java | 3 ++- 61 files changed, 124 insertions(+), 58 deletions(-) rename {core-server/src/main/java/org/glassfish/jersey/server => core-common/src/main/java/org/glassfish/jersey}/Uri.java (97%) rename {core-server/src/main/java/org/glassfish/jersey/server => core-common/src/main/java/org/glassfish/jersey}/model/AnnotatedMethod.java (98%) rename {core-server/src/main/java/org/glassfish/jersey/server => core-common/src/main/java/org/glassfish/jersey}/model/ParamQualifier.java (91%) rename {core-server/src/main/java/org/glassfish/jersey/server => core-common/src/main/java/org/glassfish/jersey}/model/Parameter.java (99%) rename {core-server/src/test/java/org/glassfish/jersey/server => core-common/src/test/java/org/glassfish/jersey}/model/ParameterTest.java (97%) rename {core-server/src/test/java/org/glassfish/jersey/server => core-common/src/test/java/org/glassfish/jersey}/model/ParameterWithMultipleAnnotationsTest.java (96%) diff --git a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/ManagedClientTest.java b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/ManagedClientTest.java index 2f1f1c389a..30800ef9e4 100644 --- a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/ManagedClientTest.java +++ b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/ManagedClientTest.java @@ -43,7 +43,7 @@ import org.glassfish.jersey.logging.LoggingFeature; import org.glassfish.jersey.server.ClientBinding; import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; import org.glassfish.jersey.test.JerseyTest; import org.junit.Test; diff --git a/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/ManagedClientTest.java b/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/ManagedClientTest.java index fb1ce624c6..db55a1ca24 100644 --- a/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/ManagedClientTest.java +++ b/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/ManagedClientTest.java @@ -43,7 +43,7 @@ import org.glassfish.jersey.logging.LoggingFeature; import org.glassfish.jersey.server.ClientBinding; import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; import org.glassfish.jersey.test.JerseyTest; import org.junit.Test; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/Uri.java b/core-common/src/main/java/org/glassfish/jersey/Uri.java similarity index 97% rename from core-server/src/main/java/org/glassfish/jersey/server/Uri.java rename to core-common/src/main/java/org/glassfish/jersey/Uri.java index 3b7db08874..fdfb7bb9be 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/Uri.java +++ b/core-common/src/main/java/org/glassfish/jersey/Uri.java @@ -13,8 +13,9 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] -package org.glassfish.jersey.server; +package org.glassfish.jersey; import java.lang.annotation.Documented; import java.lang.annotation.Retention; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/AnnotatedMethod.java b/core-common/src/main/java/org/glassfish/jersey/model/AnnotatedMethod.java similarity index 98% rename from core-server/src/main/java/org/glassfish/jersey/server/model/AnnotatedMethod.java rename to core-common/src/main/java/org/glassfish/jersey/model/AnnotatedMethod.java index db91b507c8..b038a42180 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/AnnotatedMethod.java +++ b/core-common/src/main/java/org/glassfish/jersey/model/AnnotatedMethod.java @@ -13,8 +13,9 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] -package org.glassfish.jersey.server.model; +package org.glassfish.jersey.model; import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; @@ -115,7 +116,7 @@ public Method getMethod() { * * @return the underlying declared Java method. */ - Method getDeclaredMethod() { + public Method getDeclaredMethod() { return m; } diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/ParamQualifier.java b/core-common/src/main/java/org/glassfish/jersey/model/ParamQualifier.java similarity index 91% rename from core-server/src/main/java/org/glassfish/jersey/server/model/ParamQualifier.java rename to core-common/src/main/java/org/glassfish/jersey/model/ParamQualifier.java index b0ca557bf8..838e914020 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/ParamQualifier.java +++ b/core-common/src/main/java/org/glassfish/jersey/model/ParamQualifier.java @@ -13,8 +13,9 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] -package org.glassfish.jersey.server.model; +package org.glassfish.jersey.model; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/Parameter.java b/core-common/src/main/java/org/glassfish/jersey/model/Parameter.java similarity index 99% rename from core-server/src/main/java/org/glassfish/jersey/server/model/Parameter.java rename to core-common/src/main/java/org/glassfish/jersey/model/Parameter.java index 9467ea828e..3e0780a7ac 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/Parameter.java +++ b/core-common/src/main/java/org/glassfish/jersey/model/Parameter.java @@ -13,8 +13,9 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] -package org.glassfish.jersey.server.model; +package org.glassfish.jersey.model; import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; @@ -48,7 +49,7 @@ import org.glassfish.jersey.internal.util.ReflectionHelper; import org.glassfish.jersey.internal.util.collection.ClassTypePair; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; /** * Method parameter model. diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/ParameterTest.java b/core-common/src/test/java/org/glassfish/jersey/model/ParameterTest.java similarity index 97% rename from core-server/src/test/java/org/glassfish/jersey/server/model/ParameterTest.java rename to core-common/src/test/java/org/glassfish/jersey/model/ParameterTest.java index 00e51ad0f1..68e804d42b 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/model/ParameterTest.java +++ b/core-common/src/test/java/org/glassfish/jersey/model/ParameterTest.java @@ -13,17 +13,16 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] -package org.glassfish.jersey.server.model; +package org.glassfish.jersey.model; import javax.inject.Inject; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.List; - import org.junit.Test; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/ParameterWithMultipleAnnotationsTest.java b/core-common/src/test/java/org/glassfish/jersey/model/ParameterWithMultipleAnnotationsTest.java similarity index 96% rename from core-server/src/test/java/org/glassfish/jersey/server/model/ParameterWithMultipleAnnotationsTest.java rename to core-common/src/test/java/org/glassfish/jersey/model/ParameterWithMultipleAnnotationsTest.java index a8b1adf3f0..911a081589 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/model/ParameterWithMultipleAnnotationsTest.java +++ b/core-common/src/test/java/org/glassfish/jersey/model/ParameterWithMultipleAnnotationsTest.java @@ -13,16 +13,15 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] -package org.glassfish.jersey.server.model; +package org.glassfish.jersey.model; import java.lang.annotation.Retention; import java.lang.annotation.Target; import java.lang.reflect.Method; import java.util.List; - import javax.ws.rs.PathParam; - import org.junit.Test; import static org.junit.Assert.assertEquals; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/filter/RolesAllowedDynamicFeature.java b/core-server/src/main/java/org/glassfish/jersey/server/filter/RolesAllowedDynamicFeature.java index fb1a8bf627..c801a09360 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/filter/RolesAllowedDynamicFeature.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/filter/RolesAllowedDynamicFeature.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.filter; @@ -33,7 +34,7 @@ import javax.annotation.security.RolesAllowed; import org.glassfish.jersey.server.internal.LocalizationMessages; -import org.glassfish.jersey.server.model.AnnotatedMethod; +import org.glassfish.jersey.model.AnnotatedMethod; /** * A {@link DynamicFeature} supporting the {@code javax.annotation.security.RolesAllowed}, diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AbstractValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AbstractValueParamProvider.java index a5395ee025..d9ededc883 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AbstractValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AbstractValueParamProvider.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; @@ -24,7 +25,7 @@ import javax.inject.Provider; import org.glassfish.jersey.server.ContainerRequest; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.spi.internal.ValueParamProvider; /** diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AsyncResponseValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AsyncResponseValueParamProvider.java index 4fb834d315..76b36cb032 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AsyncResponseValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AsyncResponseValueParamProvider.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; @@ -24,7 +25,7 @@ import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.AsyncContext; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.spi.internal.ValueParamProvider; /** diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/BeanParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/BeanParamValueParamProvider.java index 8bd0a7a1e4..be0ee936ea 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/BeanParamValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/BeanParamValueParamProvider.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; @@ -29,7 +30,7 @@ import org.glassfish.jersey.internal.util.collection.Cache; import org.glassfish.jersey.process.internal.RequestScoped; import org.glassfish.jersey.server.ContainerRequest; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; /** * Value factory provider for {@link BeanParam bean parameters}. diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/CookieParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/CookieParamValueParamProvider.java index 24d5629d77..7c32ce53b5 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/CookieParamValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/CookieParamValueParamProvider.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; @@ -30,7 +31,7 @@ import org.glassfish.jersey.internal.util.collection.MultivaluedStringMap; import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.ParamException; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; /** * Value factory provider supporting the {@link CookieParam} injection annotation. diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/DelegatedInjectionValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/DelegatedInjectionValueParamProvider.java index 4b2001a4fe..06e02388e1 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/DelegatedInjectionValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/DelegatedInjectionValueParamProvider.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; @@ -31,8 +32,8 @@ import org.glassfish.jersey.internal.util.collection.LazyValue; import org.glassfish.jersey.process.internal.RequestScoped; import org.glassfish.jersey.server.ContainerRequest; -import org.glassfish.jersey.server.model.Parameter; -import org.glassfish.jersey.server.model.Parameter.Source; +import org.glassfish.jersey.model.Parameter; +import org.glassfish.jersey.model.Parameter.Source; import org.glassfish.jersey.server.spi.internal.ValueParamProvider; /** diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/EntityParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/EntityParamValueParamProvider.java index 55d379d0f5..c854f3aad4 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/EntityParamValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/EntityParamValueParamProvider.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; @@ -28,7 +29,7 @@ import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.internal.LocalizationMessages; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; /** * Provides injection of {@link Request} entity value or {@link Request} instance diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/FormParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/FormParamValueParamProvider.java index df47771640..9e9ecd6bdf 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/FormParamValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/FormParamValueParamProvider.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; @@ -44,7 +45,7 @@ import org.glassfish.jersey.server.ParamException; import org.glassfish.jersey.server.internal.InternalServerProperties; import org.glassfish.jersey.server.internal.LocalizationMessages; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; /** * Value factory provider supporting the {@link FormParam} injection annotation. diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/HeaderParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/HeaderParamValueParamProvider.java index fa92d1ca4f..639239120e 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/HeaderParamValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/HeaderParamValueParamProvider.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; @@ -26,7 +27,7 @@ import org.glassfish.jersey.internal.inject.ExtractorException; import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.ParamException; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; /** * Value supplier provider supporting the {@link HeaderParam @HeaderParam} injection annotation. diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MatrixParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MatrixParamValueParamProvider.java index 1692256ff2..cdcd0af999 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MatrixParamValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MatrixParamValueParamProvider.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; @@ -28,7 +29,7 @@ import org.glassfish.jersey.internal.inject.ExtractorException; import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.ParamException; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; /** * Value supplier provider supporting the {@link MatrixParam @MatrixParam} injection annotation. diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorFactory.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorFactory.java index 4239036c9b..97492ccef2 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorFactory.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorFactory.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; @@ -34,7 +35,7 @@ import org.glassfish.jersey.internal.util.collection.ClassTypePair; import org.glassfish.jersey.internal.util.collection.LazyValue; import org.glassfish.jersey.server.internal.LocalizationMessages; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; /** * Implementation of {@link MultivaluedParameterExtractorProvider}. For each diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorProvider.java index cf8b7afaf3..4cafe7634b 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorProvider.java @@ -13,10 +13,11 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; /** * Provider of multivalued parameter extractors. diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamInjectionResolver.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamInjectionResolver.java index a4db0887bb..e0fcf8a6b2 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamInjectionResolver.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamInjectionResolver.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; @@ -32,7 +33,7 @@ import org.glassfish.jersey.internal.inject.InjectionResolver; import org.glassfish.jersey.internal.util.ReflectionHelper; import org.glassfish.jersey.server.ContainerRequest; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.spi.internal.ValueParamProvider; /** diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PathParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PathParamValueParamProvider.java index d89725e9ae..38644db750 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PathParamValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PathParamValueParamProvider.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; @@ -30,7 +31,7 @@ import org.glassfish.jersey.internal.inject.ExtractorException; import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.ParamException.PathParamException; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; /** * {@link PathParam @PathParam} injection value provider. diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/QueryParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/QueryParamValueParamProvider.java index 1b3c7d6f03..3611482105 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/QueryParamValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/QueryParamValueParamProvider.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; @@ -26,7 +27,7 @@ import org.glassfish.jersey.internal.inject.ExtractorException; import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.ParamException; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; /** * Value supplier provider supporting the {@link QueryParam @QueryParam} injection annotation. diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ValueParamProviderConfigurator.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ValueParamProviderConfigurator.java index f2a6979fd6..291c3ca8c7 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ValueParamProviderConfigurator.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ValueParamProviderConfigurator.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; @@ -46,7 +47,7 @@ import org.glassfish.jersey.internal.util.collection.Values; import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.ServerBootstrapBag; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; import org.glassfish.jersey.server.AsyncContext; import org.glassfish.jersey.server.internal.process.RequestProcessingContextReference; import org.glassfish.jersey.server.spi.internal.ValueParamProvider; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/WebTargetValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/WebTargetValueParamProvider.java index 69aba9bc1c..92762bc0e7 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/WebTargetValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/WebTargetValueParamProvider.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; @@ -45,9 +46,9 @@ import org.glassfish.jersey.server.ClientBinding; import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.ExtendedUriInfo; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; import org.glassfish.jersey.server.internal.LocalizationMessages; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.uri.internal.JerseyUriBuilder; /** diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MethodSelectingRouter.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MethodSelectingRouter.java index 0a7fa44ba9..94d4b3e043 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MethodSelectingRouter.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MethodSelectingRouter.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.routing; @@ -53,7 +54,7 @@ import org.glassfish.jersey.server.internal.LocalizationMessages; import org.glassfish.jersey.server.internal.process.RequestProcessingContext; import org.glassfish.jersey.server.model.Invocable; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.model.ResourceMethod; /** diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/HandlerConstructor.java b/core-server/src/main/java/org/glassfish/jersey/server/model/HandlerConstructor.java index 094afa034c..08f9822060 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/HandlerConstructor.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/HandlerConstructor.java @@ -13,9 +13,11 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; +import org.glassfish.jersey.model.Parameter; import java.lang.reflect.Constructor; import java.util.List; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/IntrospectionModeller.java b/core-server/src/main/java/org/glassfish/jersey/server/model/IntrospectionModeller.java index 239ab9e759..418b58e829 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/IntrospectionModeller.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/IntrospectionModeller.java @@ -13,9 +13,12 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; +import org.glassfish.jersey.model.AnnotatedMethod; +import org.glassfish.jersey.model.Parameter; import java.lang.annotation.Annotation; import java.lang.reflect.Field; import java.lang.reflect.Method; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/Invocable.java b/core-server/src/main/java/org/glassfish/jersey/server/model/Invocable.java index dca0322e39..14d2edab9d 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/Invocable.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/Invocable.java @@ -13,9 +13,11 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; +import org.glassfish.jersey.model.Parameter; import java.lang.reflect.Method; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/InvocableValidator.java b/core-server/src/main/java/org/glassfish/jersey/server/model/InvocableValidator.java index 7279bf2488..6fd0ed2d18 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/InvocableValidator.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/InvocableValidator.java @@ -13,9 +13,11 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; +import org.glassfish.jersey.model.Parameter; import java.lang.annotation.Annotation; import java.util.HashSet; import java.util.Set; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/MethodHandler.java b/core-server/src/main/java/org/glassfish/jersey/server/model/MethodHandler.java index f8aea1b3f6..d2bfde1491 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/MethodHandler.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/MethodHandler.java @@ -13,9 +13,11 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; +import org.glassfish.jersey.model.Parameter; import java.lang.reflect.Constructor; import java.util.ArrayList; import java.util.Collection; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/MethodList.java b/core-server/src/main/java/org/glassfish/jersey/server/model/MethodList.java index 6d8fc06189..647796bce5 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/MethodList.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/MethodList.java @@ -13,9 +13,11 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; +import org.glassfish.jersey.model.AnnotatedMethod; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.lang.reflect.Modifier; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/Parameterized.java b/core-server/src/main/java/org/glassfish/jersey/server/model/Parameterized.java index 62896a7807..3b9301fb23 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/Parameterized.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/Parameterized.java @@ -13,9 +13,11 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; +import org.glassfish.jersey.model.Parameter; import java.util.List; /** diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethod.java b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethod.java index ebf8f757d4..7a75398f43 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethod.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethod.java @@ -13,9 +13,11 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; +import org.glassfish.jersey.model.Parameter; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.lang.reflect.Type; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodValidator.java b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodValidator.java index 583982f3d5..d84d37228b 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodValidator.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodValidator.java @@ -13,9 +13,11 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; +import org.glassfish.jersey.model.Parameter; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.lang.reflect.ParameterizedType; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/RuntimeResourceModelValidator.java b/core-server/src/main/java/org/glassfish/jersey/server/model/RuntimeResourceModelValidator.java index fc935b09e3..72c1763078 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/RuntimeResourceModelValidator.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/RuntimeResourceModelValidator.java @@ -13,9 +13,11 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; +import org.glassfish.jersey.model.Parameter; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedList; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/internal/JavaResourceMethodDispatcherProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/model/internal/JavaResourceMethodDispatcherProvider.java index fe8ff6ae1e..32ccc30c90 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/internal/JavaResourceMethodDispatcherProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/internal/JavaResourceMethodDispatcherProvider.java @@ -31,7 +31,7 @@ import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.internal.inject.ConfiguredValidator; import org.glassfish.jersey.server.model.Invocable; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.spi.internal.ParamValueFactoryWithSource; import org.glassfish.jersey.server.spi.internal.ParameterValueHelper; import org.glassfish.jersey.server.spi.internal.ResourceMethodDispatcher; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParamValueFactoryWithSource.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParamValueFactoryWithSource.java index 1f3e61fa95..89ab3c8ffc 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParamValueFactoryWithSource.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParamValueFactoryWithSource.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.spi.internal; @@ -20,7 +21,7 @@ import java.util.function.Supplier; import org.glassfish.jersey.server.ContainerRequest; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; /** * Extends {@link Supplier} interface with diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParameterValueHelper.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParameterValueHelper.java index b752a54df0..9e653330dd 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParameterValueHelper.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParameterValueHelper.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.spi.internal; @@ -31,7 +32,7 @@ import org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException; import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.internal.process.MappableException; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.model.Parameterized; /** diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ValueParamProvider.java index c69e674b2a..c1bdd6c958 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ValueParamProvider.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.spi.internal; @@ -22,7 +23,7 @@ import javax.ws.rs.RuntimeType; import org.glassfish.jersey.server.ContainerRequest; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.spi.Contract; /** diff --git a/core-server/src/main/java/org/glassfish/jersey/server/wadl/WadlGenerator.java b/core-server/src/main/java/org/glassfish/jersey/server/wadl/WadlGenerator.java index f3fe533da4..e85bcb264c 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/wadl/WadlGenerator.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/wadl/WadlGenerator.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.wadl; @@ -27,7 +28,7 @@ import javax.xml.bind.annotation.XmlRegistry; import javax.xml.namespace.QName; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.wadl.internal.ApplicationDescription; import com.sun.research.ws.wadl.Application; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/WadlBuilder.java b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/WadlBuilder.java index cdf6caf005..859a8fc41c 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/WadlBuilder.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/WadlBuilder.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.wadl.internal; @@ -35,7 +36,7 @@ import org.glassfish.jersey.internal.Version; import org.glassfish.jersey.server.internal.LocalizationMessages; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.model.ResourceMethod; import org.glassfish.jersey.server.wadl.WadlGenerator; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/WadlGeneratorImpl.java b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/WadlGeneratorImpl.java index 2a703e443a..bc80f4318e 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/WadlGeneratorImpl.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/WadlGeneratorImpl.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.wadl.internal; @@ -23,7 +24,7 @@ import javax.xml.namespace.QName; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.model.ResourceMethod; import org.glassfish.jersey.server.wadl.WadlGenerator; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorApplicationDoc.java b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorApplicationDoc.java index cfa08de989..dd1bfe8a9f 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorApplicationDoc.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorApplicationDoc.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.wadl.internal.generators; @@ -27,7 +28,7 @@ import javax.inject.Provider; import javax.xml.parsers.SAXParserFactory; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.wadl.WadlGenerator; import org.glassfish.jersey.server.wadl.internal.ApplicationDescription; import org.glassfish.jersey.server.wadl.internal.WadlUtils; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorGrammarsSupport.java b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorGrammarsSupport.java index 8e2a31e13b..bc0ccd7566 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorGrammarsSupport.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorGrammarsSupport.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.wadl.internal.generators; @@ -28,7 +29,7 @@ import javax.inject.Provider; import javax.xml.parsers.SAXParserFactory; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.wadl.WadlGenerator; import org.glassfish.jersey.server.wadl.internal.ApplicationDescription; import org.glassfish.jersey.server.wadl.internal.WadlUtils; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorJAXBGrammarGenerator.java b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorJAXBGrammarGenerator.java index 2f303e86aa..446d49fff3 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorJAXBGrammarGenerator.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorJAXBGrammarGenerator.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.wadl.internal.generators; @@ -48,7 +49,7 @@ import javax.xml.transform.Result; import javax.xml.transform.stream.StreamResult; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.wadl.WadlGenerator; import org.glassfish.jersey.server.wadl.internal.ApplicationDescription; import org.glassfish.jersey.server.wadl.internal.WadlGeneratorImpl; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/resourcedoc/ResourceDocAccessor.java b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/resourcedoc/ResourceDocAccessor.java index 8631c5b5d5..2e92ae0e70 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/resourcedoc/ResourceDocAccessor.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/resourcedoc/ResourceDocAccessor.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.wadl.internal.generators.resourcedoc; @@ -22,7 +23,7 @@ import java.util.logging.Logger; import org.glassfish.jersey.server.internal.LocalizationMessages; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.model.AnnotationDocType; import org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.model.ClassDocType; import org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.model.MethodDocType; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/resourcedoc/WadlGeneratorResourceDocSupport.java b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/resourcedoc/WadlGeneratorResourceDocSupport.java index 421bb9f021..f512c4db9c 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/resourcedoc/WadlGeneratorResourceDocSupport.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/resourcedoc/WadlGeneratorResourceDocSupport.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.wadl.internal.generators.resourcedoc; @@ -28,7 +29,7 @@ import javax.inject.Provider; import javax.xml.parsers.SAXParserFactory; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.model.ResourceMethod; import org.glassfish.jersey.server.wadl.WadlGenerator; import org.glassfish.jersey.server.wadl.internal.ApplicationDescription; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/UriTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/UriTest.java index 9690d864ac..9f54270cde 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/UriTest.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/UriTest.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; @@ -30,7 +31,7 @@ import org.glassfish.jersey.server.ContainerResponse; import org.glassfish.jersey.server.RequestContextBuilder; import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; import org.junit.Test; import static org.hamcrest.CoreMatchers.equalTo; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/GenericMethodListTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/GenericMethodListTest.java index 9a23891b3f..3482248c24 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/model/GenericMethodListTest.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/model/GenericMethodListTest.java @@ -13,9 +13,11 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; +import org.glassfish.jersey.model.AnnotatedMethod; import java.lang.reflect.Method; import java.lang.reflect.Type; import java.lang.reflect.TypeVariable; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/MethodListTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/MethodListTest.java index c78d435a58..afc553a856 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/model/MethodListTest.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/model/MethodListTest.java @@ -13,9 +13,11 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; +import org.glassfish.jersey.model.AnnotatedMethod; import org.junit.Test; import java.util.HashSet; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/modelapi/annotation/IntrospectionModellerTest.java b/core-server/src/test/java/org/glassfish/jersey/server/modelapi/annotation/IntrospectionModellerTest.java index a74ec77389..4e2d3cd011 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/modelapi/annotation/IntrospectionModellerTest.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/modelapi/annotation/IntrospectionModellerTest.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.modelapi.annotation; @@ -33,7 +34,7 @@ import javax.inject.Inject; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.model.Resource; import org.glassfish.jersey.server.model.ResourceMethod; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorConfigTest.java b/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorConfigTest.java index 5aa59e98c5..cf2960df44 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorConfigTest.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorConfigTest.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] /* * To change this template, choose Tools | Templates @@ -25,7 +26,7 @@ import javax.ws.rs.core.MediaType; import org.glassfish.jersey.server.TestInjectionManagerFactory; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.model.ResourceMethod; import org.glassfish.jersey.server.wadl.WadlGenerator; import org.glassfish.jersey.server.wadl.internal.ApplicationDescription; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorConfigurationLoaderTest.java b/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorConfigurationLoaderTest.java index 589dc89b0e..d5bbf8606f 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorConfigurationLoaderTest.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorConfigurationLoaderTest.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.wadl.config; @@ -24,7 +25,7 @@ import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.server.ServerProperties; import org.glassfish.jersey.server.TestInjectionManagerFactory; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.model.ResourceMethod; import org.glassfish.jersey.server.wadl.WadlGenerator; import org.glassfish.jersey.server.wadl.internal.ApplicationDescription; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorLoaderTest.java b/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorLoaderTest.java index 06670553e4..6a6b037f4b 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorLoaderTest.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorLoaderTest.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] /* * To change this template, choose Tools | Templates @@ -32,7 +33,7 @@ import javax.ws.rs.core.MediaType; import org.glassfish.jersey.server.TestInjectionManagerFactory; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.model.ResourceMethod; import org.glassfish.jersey.server.wadl.WadlGenerator; import org.glassfish.jersey.server.wadl.internal.ApplicationDescription; diff --git a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java index 80b212628e..3575795ee9 100644 --- a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java +++ b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.ext.cdi1x.internal; @@ -81,7 +82,7 @@ import org.glassfish.jersey.internal.inject.SupplierInstanceBinding; import org.glassfish.jersey.internal.util.collection.Cache; import org.glassfish.jersey.server.ContainerRequest; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.model.Resource; import org.glassfish.jersey.server.spi.ComponentProvider; import org.glassfish.jersey.server.spi.internal.ValueParamProvider; diff --git a/incubator/declarative-linking/src/main/java/org/glassfish/jersey/linking/InjectLinkFieldDescriptor.java b/incubator/declarative-linking/src/main/java/org/glassfish/jersey/linking/InjectLinkFieldDescriptor.java index d6e36f66d6..05f273649c 100644 --- a/incubator/declarative-linking/src/main/java/org/glassfish/jersey/linking/InjectLinkFieldDescriptor.java +++ b/incubator/declarative-linking/src/main/java/org/glassfish/jersey/linking/InjectLinkFieldDescriptor.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.linking; @@ -32,7 +33,7 @@ import javax.ws.rs.core.Link; import org.glassfish.jersey.linking.mapping.ResourceMappingContext; -import org.glassfish.jersey.server.model.AnnotatedMethod; +import org.glassfish.jersey.model.AnnotatedMethod; import org.glassfish.jersey.server.model.MethodList; /** diff --git a/incubator/declarative-linking/src/main/java/org/glassfish/jersey/linking/ProvideLinkDescriptor.java b/incubator/declarative-linking/src/main/java/org/glassfish/jersey/linking/ProvideLinkDescriptor.java index a4b6356afc..c9a871a3d8 100644 --- a/incubator/declarative-linking/src/main/java/org/glassfish/jersey/linking/ProvideLinkDescriptor.java +++ b/incubator/declarative-linking/src/main/java/org/glassfish/jersey/linking/ProvideLinkDescriptor.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.linking; @@ -25,7 +26,7 @@ import javax.ws.rs.core.Link; import org.glassfish.jersey.linking.mapping.ResourceMappingContext; -import org.glassfish.jersey.server.model.AnnotatedMethod; +import org.glassfish.jersey.model.AnnotatedMethod; import org.glassfish.jersey.server.model.ResourceMethod; /** diff --git a/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataParam.java b/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataParam.java index 42806607bb..4bd3f71e89 100644 --- a/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataParam.java +++ b/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataParam.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.media.multipart; @@ -24,8 +25,7 @@ import javax.ws.rs.DefaultValue; import javax.ws.rs.FormParam; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.glassfish.jersey.server.model.ParamQualifier; +import org.glassfish.jersey.model.ParamQualifier; /** * Binds the named body part(s) of a "multipart/form-data" request diff --git a/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/internal/FormDataParamValueParamProvider.java b/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/internal/FormDataParamValueParamProvider.java index d2f33d8e95..3d131544c8 100644 --- a/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/internal/FormDataParamValueParamProvider.java +++ b/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/internal/FormDataParamValueParamProvider.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.media.multipart.internal; @@ -53,7 +54,7 @@ import org.glassfish.jersey.server.internal.inject.AbstractValueParamProvider; import org.glassfish.jersey.server.internal.inject.MultivaluedParameterExtractor; import org.glassfish.jersey.server.internal.inject.MultivaluedParameterExtractorProvider; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.jvnet.mimepull.MIMEParsingException; diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseEventSinkValueParamProvider.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseEventSinkValueParamProvider.java index d6e68e5e73..0e1fe54ac5 100644 --- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseEventSinkValueParamProvider.java +++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseEventSinkValueParamProvider.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.media.sse.internal; @@ -28,7 +29,7 @@ import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.internal.inject.AbstractValueParamProvider; import org.glassfish.jersey.server.internal.inject.MultivaluedParameterExtractorProvider; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.server.spi.internal.ValueParamProvider; /** From d9885bc61f5932f6f88d2f0c7cd2eef068cf81e3 Mon Sep 17 00:00:00 2001 From: jGauravGupta Date: Tue, 15 May 2018 21:08:39 +0530 Subject: [PATCH 03/17] Move ParamConverter API to jersey-core-common module Signed-off-by: jGauravGupta --- .../java/org/glassfish/jersey/client/ClientConfig.java | 3 +++ .../internal/inject/ParamConverterConfigurator.java | 6 ++---- .../jersey}/internal/inject/ParamConverterFactory.java | 6 ++++-- .../jersey}/internal/inject/ParamConverters.java | 8 ++++---- .../jersey}/internal/inject/PrimitiveMapper.java | 9 +++++---- .../glassfish/jersey/internal/localization.properties | 4 ++++ .../org/glassfish/jersey/server/ApplicationHandler.java | 3 ++- .../inject/MultivaluedParameterExtractorFactory.java | 2 ++ .../internal/inject/ParamExtractorConfigurator.java | 2 ++ .../jersey/server/TestInjectionManagerFactory.java | 3 ++- .../internal/inject/ParamConverterInternalTest.java | 2 ++ 11 files changed, 32 insertions(+), 16 deletions(-) rename {core-server/src/main/java/org/glassfish/jersey/server => core-common/src/main/java/org/glassfish/jersey}/internal/inject/ParamConverterConfigurator.java (86%) rename {core-server/src/main/java/org/glassfish/jersey/server => core-common/src/main/java/org/glassfish/jersey}/internal/inject/ParamConverterFactory.java (91%) rename {core-server/src/main/java/org/glassfish/jersey/server => core-common/src/main/java/org/glassfish/jersey}/internal/inject/ParamConverters.java (98%) rename {core-server/src/main/java/org/glassfish/jersey/server => core-common/src/main/java/org/glassfish/jersey}/internal/inject/PrimitiveMapper.java (89%) diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientConfig.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientConfig.java index fb2ea46364..77a7ba32d9 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/ClientConfig.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientConfig.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client; @@ -56,6 +57,7 @@ import org.glassfish.jersey.model.internal.ComponentBag; import org.glassfish.jersey.model.internal.ManagedObjectsFinalizer; import org.glassfish.jersey.process.internal.RequestScope; +import org.glassfish.jersey.internal.inject.ParamConverterConfigurator; /** * Jersey externalized implementation of client-side JAX-RS {@link javax.ws.rs.core.Configurable @@ -412,6 +414,7 @@ private ClientRuntime initRuntime() { bootstrapBag.setManagedObjectsFinalizer(new ManagedObjectsFinalizer(injectionManager)); List bootstrapConfigurators = Arrays.asList( new RequestScope.RequestScopeConfigurator(), + new ParamConverterConfigurator(), new RuntimeConfigConfigurator(runtimeCfgState), new ContextResolverFactory.ContextResolversConfigurator(), new MessageBodyFactory.MessageBodyWorkersConfigurator(), diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverterConfigurator.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterConfigurator.java similarity index 86% rename from core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverterConfigurator.java rename to core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterConfigurator.java index 29f97e4599..17666c2897 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverterConfigurator.java +++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterConfigurator.java @@ -13,16 +13,14 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] -package org.glassfish.jersey.server.internal.inject; +package org.glassfish.jersey.internal.inject; import javax.ws.rs.ext.ParamConverterProvider; import org.glassfish.jersey.internal.BootstrapBag; import org.glassfish.jersey.internal.BootstrapConfigurator; -import org.glassfish.jersey.internal.inject.Bindings; -import org.glassfish.jersey.internal.inject.InjectionManager; -import org.glassfish.jersey.internal.inject.InstanceBinding; /** * Configurator which initializes and register {@link ParamConverters.AggregatedProvider} instances into {@link InjectionManager}. diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverterFactory.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterFactory.java similarity index 91% rename from core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverterFactory.java rename to core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterFactory.java index ca542316f9..0ed57d8091 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverterFactory.java +++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterFactory.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.server.internal.inject; +package org.glassfish.jersey.internal.inject; import java.lang.annotation.Annotation; import java.lang.reflect.Type; @@ -42,12 +42,14 @@ * @author Marek Potociar (marek.potociar at oracle.com) * @author Miroslav Fuksa */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] + @Singleton public class ParamConverterFactory implements ParamConverterProvider { private final List converterProviders; - ParamConverterFactory(Set providers, Set customProviders) { + public ParamConverterFactory(Set providers, Set customProviders) { Set copyProviders = new HashSet<>(providers); converterProviders = new ArrayList<>(); diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverters.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverters.java similarity index 98% rename from core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverters.java rename to core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverters.java index f7ac1948ec..2ae600cb5f 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverters.java +++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverters.java @@ -13,8 +13,9 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] -package org.glassfish.jersey.server.internal.inject; +package org.glassfish.jersey.internal.inject; import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; @@ -32,10 +33,9 @@ import javax.inject.Singleton; -import org.glassfish.jersey.internal.inject.ExtractorException; import org.glassfish.jersey.internal.util.ReflectionHelper; import org.glassfish.jersey.message.internal.HttpDateFormat; -import org.glassfish.jersey.server.internal.LocalizationMessages; +import org.glassfish.jersey.internal.LocalizationMessages; /** * Container of several different {@link ParamConverterProvider param converter providers} @@ -46,7 +46,7 @@ * @author Marek Potociar (marek.potociar at oracle.com) */ @Singleton -class ParamConverters { +public class ParamConverters { private abstract static class AbstractStringReader implements ParamConverter { diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PrimitiveMapper.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/PrimitiveMapper.java similarity index 89% rename from core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PrimitiveMapper.java rename to core-common/src/main/java/org/glassfish/jersey/internal/inject/PrimitiveMapper.java index eb9ce14b6b..f111798c24 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PrimitiveMapper.java +++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/PrimitiveMapper.java @@ -13,8 +13,9 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] -package org.glassfish.jersey.server.internal.inject; +package org.glassfish.jersey.internal.inject; import java.util.Collections; import java.util.Map; @@ -27,11 +28,11 @@ * @author Paul Sandoz * @author Marek Potociar (marek.potociar at oracle.com) */ -final class PrimitiveMapper { +public final class PrimitiveMapper { - static final Map primitiveToClassMap = + public static final Map primitiveToClassMap = getPrimitiveToClassMap(); - static final Map primitiveToDefaultValueMap = + public static final Map primitiveToDefaultValueMap = getPrimitiveToDefaultValueMap(); private static Map getPrimitiveToClassMap() { diff --git a/core-common/src/main/resources/org/glassfish/jersey/internal/localization.properties b/core-common/src/main/resources/org/glassfish/jersey/internal/localization.properties index 791997da3f..2b9fceaafb 100644 --- a/core-common/src/main/resources/org/glassfish/jersey/internal/localization.properties +++ b/core-common/src/main/resources/org/glassfish/jersey/internal/localization.properties @@ -13,6 +13,8 @@ # # SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 # +# Portions Copyright [2018] [Payara Foundation and/or its affiliates] +# # {0} - full classname @@ -47,6 +49,7 @@ error.msg=WARNING: {0} error.newcookie.expires=NewCookie Expires header value ({0}) cannot be read. error.notfound.messagebodywriter=MessageBodyWriter not found for media type={0}, type={1}, genericType={2}. error.notfound.messagebodyreader=MessageBodyReader not found for media type={0}, type={1}, genericType={2}. +error.parameter.invalid.char.value=Value "{0}" is not a character. error.parsing.entity.tag=Error parsing entity tag: {0} error.provider.constrainedTo.wrong.package=A registered provider {0} is constrained (via @ConstrainedTo) to {1} runtime but does not implement any provider interface usable in the runtime. error.provider.constrainedTo.wrong.runtime=A provider {0} registered in {2} runtime is constrained (via @ConstrainedTo) to {1} runtime. @@ -107,6 +110,7 @@ message.content.buffering.failed=Failed to buffer the message content input stre message.content.input.stream.close.failed=Error closing message content input stream. message.content.buffer.reset.failed=Error resetting the buffered message content input stream. method.not.getter.nor.setter=Method is neither getter nor setter. +method.parameter.cannot.be.null=Method parameter "{0}" cannot be null. multiple.matching.constructors.found=Found {0} constructors with {1} parameters in {2} class. Selecting the first found constructor: {3} new.cookie.is.null=New cookie is null. no.container.available=No container available. diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ApplicationHandler.java b/core-server/src/main/java/org/glassfish/jersey/server/ApplicationHandler.java index 6e9449ab8b..dbeae922d6 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/ApplicationHandler.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/ApplicationHandler.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server; @@ -75,7 +76,7 @@ import org.glassfish.jersey.server.internal.JerseyRequestTimeoutHandler; import org.glassfish.jersey.server.internal.LocalizationMessages; import org.glassfish.jersey.server.internal.ProcessingProviders; -import org.glassfish.jersey.server.internal.inject.ParamConverterConfigurator; +import org.glassfish.jersey.internal.inject.ParamConverterConfigurator; import org.glassfish.jersey.server.internal.inject.ParamExtractorConfigurator; import org.glassfish.jersey.server.internal.inject.ValueParamProviderConfigurator; import org.glassfish.jersey.server.internal.monitoring.ApplicationEventImpl; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorFactory.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorFactory.java index 97492ccef2..47259faba6 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorFactory.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorFactory.java @@ -31,11 +31,13 @@ import javax.inject.Singleton; import org.glassfish.jersey.internal.inject.ExtractorException; +import org.glassfish.jersey.internal.inject.ParamConverterFactory; import org.glassfish.jersey.internal.util.ReflectionHelper; import org.glassfish.jersey.internal.util.collection.ClassTypePair; import org.glassfish.jersey.internal.util.collection.LazyValue; import org.glassfish.jersey.server.internal.LocalizationMessages; import org.glassfish.jersey.model.Parameter; +import org.glassfish.jersey.internal.inject.PrimitiveMapper; /** * Implementation of {@link MultivaluedParameterExtractorProvider}. For each diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamExtractorConfigurator.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamExtractorConfigurator.java index 7d56f88b5e..dd0cc2e716 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamExtractorConfigurator.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamExtractorConfigurator.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; @@ -22,6 +23,7 @@ import org.glassfish.jersey.internal.BootstrapConfigurator; import org.glassfish.jersey.internal.inject.Bindings; import org.glassfish.jersey.internal.inject.InjectionManager; +import org.glassfish.jersey.internal.inject.ParamConverterFactory; import org.glassfish.jersey.internal.inject.Providers; import org.glassfish.jersey.internal.util.collection.LazyValue; import org.glassfish.jersey.internal.util.collection.Value; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/TestInjectionManagerFactory.java b/core-server/src/test/java/org/glassfish/jersey/server/TestInjectionManagerFactory.java index fed2888ba4..95351332d5 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/TestInjectionManagerFactory.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/TestInjectionManagerFactory.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server; @@ -33,7 +34,7 @@ import org.glassfish.jersey.message.internal.MessagingBinders; import org.glassfish.jersey.model.internal.ManagedObjectsFinalizer; import org.glassfish.jersey.process.internal.RequestScope; -import org.glassfish.jersey.server.internal.inject.ParamConverterConfigurator; +import org.glassfish.jersey.internal.inject.ParamConverterConfigurator; import org.glassfish.jersey.server.internal.inject.ParamExtractorConfigurator; import org.glassfish.jersey.server.internal.inject.ValueParamProviderConfigurator; import org.glassfish.jersey.server.internal.process.RequestProcessingConfigurator; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamConverterInternalTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamConverterInternalTest.java index 9b4c393e3b..341259bbd9 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamConverterInternalTest.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamConverterInternalTest.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; @@ -39,6 +40,7 @@ import javax.ws.rs.ext.ParamConverterProvider; import org.glassfish.jersey.internal.inject.ExtractorException; +import org.glassfish.jersey.internal.inject.ParamConverters; import org.glassfish.jersey.internal.util.ReflectionHelper; import org.glassfish.jersey.internal.util.collection.ClassTypePair; import org.glassfish.jersey.server.ApplicationHandler; From f22bd866bf4b5d3920d24e87b8a7dcf70837341c Mon Sep 17 00:00:00 2001 From: jGauravGupta Date: Mon, 21 May 2018 18:40:32 +0530 Subject: [PATCH 04/17] Parameter API refactoring in tests & examples Signed-off-by: jGauravGupta --- .../examples/managedclientsimple/resources/ClientResource.java | 3 ++- .../jersey/examples/managedclient/PublicResource.java | 3 ++- .../jersey/examples/managedclient/PublicResource.java | 3 ++- .../glassfish/jersey/examples/opentracing/TracedResource.java | 3 ++- .../glassfish/jersey/examples/rx/agent/AsyncAgentResource.java | 3 ++- .../jersey/examples/rx/agent/CompletionStageAgentResource.java | 3 ++- .../jersey/examples/rx/agent/FlowableAgentResource.java | 3 ++- .../examples/rx/agent/ListenableFutureAgentResource.java | 3 ++- .../jersey/examples/rx/agent/ObservableAgentResource.java | 3 ++- .../glassfish/jersey/examples/rx/agent/SyncAgentResource.java | 3 ++- .../jersey/tests/e2e/server/ClientResponseOnServerTest.java | 3 ++- .../jersey/tests/e2e/server/ManagedClientExecutorTest.java | 3 ++- .../java/org/glassfish/jersey/tests/api/ResponseE2ETest.java | 3 ++- .../tests/integration/jersey2167/MyValueParamProvider.java | 3 ++- 14 files changed, 28 insertions(+), 14 deletions(-) diff --git a/examples/managed-client-simple-webapp/src/main/java/org/glassfish/jersey/examples/managedclientsimple/resources/ClientResource.java b/examples/managed-client-simple-webapp/src/main/java/org/glassfish/jersey/examples/managedclientsimple/resources/ClientResource.java index daa752d8bb..9600ce3dae 100644 --- a/examples/managed-client-simple-webapp/src/main/java/org/glassfish/jersey/examples/managedclientsimple/resources/ClientResource.java +++ b/examples/managed-client-simple-webapp/src/main/java/org/glassfish/jersey/examples/managedclientsimple/resources/ClientResource.java @@ -7,6 +7,7 @@ * * SPDX-License-Identifier: BSD-3-Clause */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.managedclientsimple.resources; @@ -19,7 +20,7 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; /** * A resource which use managed client injected by {@link org.glassfish.jersey.server.Uri @Uri annotation} to query diff --git a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java index 17454bcf89..6bf546e81a 100644 --- a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java +++ b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java @@ -7,6 +7,7 @@ * * SPDX-License-Identifier: BSD-3-Clause */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.managedclient; @@ -17,7 +18,7 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; /** * A resource that uses managed clients to retrieve values of internal diff --git a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java index 3340c16f65..c496f6da38 100644 --- a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java +++ b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java @@ -7,6 +7,7 @@ * * SPDX-License-Identifier: BSD-3-Clause */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.managedclient; @@ -17,7 +18,7 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; /** * A resource that uses managed clients to retrieve values of internal diff --git a/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/TracedResource.java b/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/TracedResource.java index ce8e83b919..5c197ae921 100644 --- a/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/TracedResource.java +++ b/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/TracedResource.java @@ -7,6 +7,7 @@ * * SPDX-License-Identifier: BSD-3-Clause */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.opentracing; @@ -26,7 +27,7 @@ import org.glassfish.jersey.opentracing.OpenTracingFeature; import org.glassfish.jersey.opentracing.OpenTracingUtils; import org.glassfish.jersey.server.ManagedAsync; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; import io.opentracing.Span; diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/AsyncAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/AsyncAgentResource.java index a7353a28a8..128645bb18 100644 --- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/AsyncAgentResource.java +++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/AsyncAgentResource.java @@ -7,6 +7,7 @@ * * SPDX-License-Identifier: BSD-3-Clause */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.rx.agent; @@ -41,7 +42,7 @@ import org.glassfish.jersey.internal.guava.ThreadFactoryBuilder; import org.glassfish.jersey.process.JerseyProcessingUncaughtExceptionHandler; import org.glassfish.jersey.server.ManagedAsync; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; /** * Obtain information about visited (destination) and recommended (destination, forecast, price) places for "Async" user. Uses diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/CompletionStageAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/CompletionStageAgentResource.java index fd9f410e9e..79f280f26b 100644 --- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/CompletionStageAgentResource.java +++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/CompletionStageAgentResource.java @@ -7,6 +7,7 @@ * * SPDX-License-Identifier: BSD-3-Clause */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.rx.agent; @@ -34,7 +35,7 @@ import org.glassfish.jersey.examples.rx.domain.Forecast; import org.glassfish.jersey.examples.rx.domain.Recommendation; import org.glassfish.jersey.internal.guava.ThreadFactoryBuilder; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; /** * Obtain information about visited (destination) and recommended (destination, forecast, price) places for diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/FlowableAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/FlowableAgentResource.java index d5ffaef07f..a6ca878dc0 100644 --- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/FlowableAgentResource.java +++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/FlowableAgentResource.java @@ -7,6 +7,7 @@ * * SPDX-License-Identifier: BSD-3-Clause */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.rx.agent; @@ -32,7 +33,7 @@ import org.glassfish.jersey.examples.rx.domain.Destination; import org.glassfish.jersey.examples.rx.domain.Forecast; import org.glassfish.jersey.examples.rx.domain.Recommendation; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; import io.reactivex.Flowable; import io.reactivex.schedulers.Schedulers; diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ListenableFutureAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ListenableFutureAgentResource.java index 9dc3d5f4d6..28b48fcd37 100644 --- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ListenableFutureAgentResource.java +++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ListenableFutureAgentResource.java @@ -7,6 +7,7 @@ * * SPDX-License-Identifier: BSD-3-Clause */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.rx.agent; @@ -29,7 +30,7 @@ import org.glassfish.jersey.examples.rx.domain.Forecast; import org.glassfish.jersey.examples.rx.domain.Recommendation; import org.glassfish.jersey.server.ManagedAsync; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; import com.google.common.collect.Lists; import com.google.common.util.concurrent.AsyncFunction; diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ObservableAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ObservableAgentResource.java index f23aa66b93..d1d785696a 100644 --- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ObservableAgentResource.java +++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ObservableAgentResource.java @@ -7,6 +7,7 @@ * * SPDX-License-Identifier: BSD-3-Clause */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.rx.agent; @@ -32,7 +33,7 @@ import org.glassfish.jersey.examples.rx.domain.Destination; import org.glassfish.jersey.examples.rx.domain.Forecast; import org.glassfish.jersey.examples.rx.domain.Recommendation; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; import rx.Observable; import rx.schedulers.Schedulers; diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/SyncAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/SyncAgentResource.java index 102d46550b..38440a3e3c 100644 --- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/SyncAgentResource.java +++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/SyncAgentResource.java @@ -7,6 +7,7 @@ * * SPDX-License-Identifier: BSD-3-Clause */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.rx.agent; @@ -29,7 +30,7 @@ import org.glassfish.jersey.examples.rx.domain.Destination; import org.glassfish.jersey.examples.rx.domain.Forecast; import org.glassfish.jersey.examples.rx.domain.Recommendation; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; /** * Obtain information about visited (destination) and recommended (destination, forecast, price) places for "Sync" user. Uses diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ClientResponseOnServerTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ClientResponseOnServerTest.java index 26428760e7..a2079eda4d 100644 --- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ClientResponseOnServerTest.java +++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ClientResponseOnServerTest.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.tests.e2e.server; @@ -25,7 +26,7 @@ import javax.ws.rs.core.Response; import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; import org.glassfish.jersey.test.JerseyTest; import org.junit.Test; diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ManagedClientExecutorTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ManagedClientExecutorTest.java index b0432277d7..7695be4e59 100644 --- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ManagedClientExecutorTest.java +++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ManagedClientExecutorTest.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.tests.e2e.server; @@ -48,7 +49,7 @@ import org.glassfish.jersey.internal.guava.ThreadFactoryBuilder; import org.glassfish.jersey.server.ClientBinding; import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; import org.glassfish.jersey.spi.ScheduledExecutorServiceProvider; import org.glassfish.jersey.test.JerseyTest; import org.glassfish.jersey.test.TestProperties; diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseE2ETest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseE2ETest.java index b206551609..7edc307596 100644 --- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseE2ETest.java +++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseE2ETest.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.tests.api; @@ -39,7 +40,7 @@ import javax.ws.rs.ext.RuntimeDelegate; import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.server.Uri; +import org.glassfish.jersey.Uri; import org.glassfish.jersey.test.JerseyTest; import org.junit.Test; diff --git a/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyValueParamProvider.java b/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyValueParamProvider.java index 5eae5ae217..8fba06450d 100644 --- a/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyValueParamProvider.java +++ b/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyValueParamProvider.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.tests.integration.jersey2167; @@ -25,7 +26,7 @@ import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.internal.inject.AbstractValueParamProvider; import org.glassfish.jersey.server.internal.inject.MultivaluedParameterExtractorProvider; -import org.glassfish.jersey.server.model.Parameter; +import org.glassfish.jersey.model.Parameter; /** * Custom annotation value supplier provider for JERSEY-2167 reproducer. From 280574934e5e696fe5d6e3bcf0d1ac09d3fd78d0 Mon Sep 17 00:00:00 2001 From: jGauravGupta Date: Mon, 21 May 2018 18:43:20 +0530 Subject: [PATCH 05/17] ParamConverter support in Jersey Proxy Client Signed-off-by: jGauravGupta --- .../jersey/client/ClientBootstrapBag.java | 41 +++++ .../glassfish/jersey/client/ClientConfig.java | 10 +- .../jersey/client/ClientRuntime.java | 5 +- .../client/inject/ParameterInserter.java | 79 ++++++++ .../inject/ParameterInserterProvider.java | 65 +++++++ .../inject/AbstractParamValueInserter.java | 167 +++++++++++++++++ .../internal/inject/CollectionInserter.java | 168 +++++++++++++++++ .../inject/ParameterInserterConfigurator.java | 82 +++++++++ .../inject/ParameterInserterFactory.java | 174 ++++++++++++++++++ .../inject/PrimitiveCharacterInserter.java | 84 +++++++++ .../inject/PrimitiveValueOfInserter.java | 96 ++++++++++ .../inject/SingleStringValueInserter.java | 96 ++++++++++ .../internal/inject/SingleValueInserter.java | 99 ++++++++++ .../client/internal/localization.properties | 2 + .../internal/inject/InserterException.java | 82 +++++++++ .../rest/client/RestClientBuilderImpl.java | 20 +- ext/proxy-client/pom.xml | 5 + .../client/proxy/WebResourceFactory.java | 77 +++++++- 18 files changed, 1326 insertions(+), 26 deletions(-) create mode 100644 core-client/src/main/java/org/glassfish/jersey/client/ClientBootstrapBag.java create mode 100644 core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterInserter.java create mode 100644 core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterInserterProvider.java create mode 100644 core-client/src/main/java/org/glassfish/jersey/client/internal/inject/AbstractParamValueInserter.java create mode 100644 core-client/src/main/java/org/glassfish/jersey/client/internal/inject/CollectionInserter.java create mode 100644 core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterInserterConfigurator.java create mode 100644 core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterInserterFactory.java create mode 100644 core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveCharacterInserter.java create mode 100644 core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveValueOfInserter.java create mode 100644 core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleStringValueInserter.java create mode 100644 core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleValueInserter.java create mode 100644 core-common/src/main/java/org/glassfish/jersey/internal/inject/InserterException.java diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientBootstrapBag.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientBootstrapBag.java new file mode 100644 index 0000000000..3c858557b0 --- /dev/null +++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientBootstrapBag.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018 Payara Foundation 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 org.glassfish.jersey.client; + + +import org.glassfish.jersey.internal.BootstrapBag; +import org.glassfish.jersey.client.inject.ParameterInserterProvider; + +/** + * {@inheritDoc} + *

+ * This bootstrap bag is specialized for client part of Jersey. + * + * @author Gaurav Gupta (gaurav.gupta@payara.fish) + */ +public class ClientBootstrapBag extends BootstrapBag { + + private ParameterInserterProvider parameterInserterProvider; + + public ParameterInserterProvider getParameterInserterProvider() { + requireNonNull(parameterInserterProvider, ParameterInserterProvider.class); + return parameterInserterProvider; + } + + public void setParameterInserterProvider(ParameterInserterProvider provider) { + this.parameterInserterProvider = provider; + } +} diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientConfig.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientConfig.java index 77a7ba32d9..39ddab5bd5 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/ClientConfig.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientConfig.java @@ -35,6 +35,7 @@ import org.glassfish.jersey.CommonProperties; import org.glassfish.jersey.ExtendedConfig; import org.glassfish.jersey.client.internal.LocalizationMessages; +import org.glassfish.jersey.client.internal.inject.ParameterInserterConfigurator; import org.glassfish.jersey.client.spi.Connector; import org.glassfish.jersey.client.spi.ConnectorProvider; import org.glassfish.jersey.internal.AutoDiscoverableConfigurator; @@ -66,6 +67,7 @@ * @author Marek Potociar (marek.potociar at oracle.com) * @author Martin Matula * @author Libor Kramolis (libor.kramolis at oracle.com) + * @author Gaurav Gupta (gaurav.gupta@payara.fish) */ public class ClientConfig implements Configurable, ExtendedConfig { /** @@ -410,11 +412,11 @@ private ClientRuntime initRuntime() { InjectionManager injectionManager = Injections.createInjectionManager(); injectionManager.register(new ClientBinder(runtimeCfgState.getProperties())); - BootstrapBag bootstrapBag = new BootstrapBag(); + BootstrapBag bootstrapBag = new ClientBootstrapBag(); bootstrapBag.setManagedObjectsFinalizer(new ManagedObjectsFinalizer(injectionManager)); - List bootstrapConfigurators = Arrays.asList( - new RequestScope.RequestScopeConfigurator(), + List bootstrapConfigurators = Arrays.asList(new RequestScope.RequestScopeConfigurator(), new ParamConverterConfigurator(), + new ParameterInserterConfigurator(), new RuntimeConfigConfigurator(runtimeCfgState), new ContextResolverFactory.ContextResolversConfigurator(), new MessageBodyFactory.MessageBodyWorkersConfigurator(), @@ -801,7 +803,7 @@ public ScheduledExecutorService getScheduledExecutorService() { * * @return configured runtime. */ - ClientRuntime getRuntime() { + public ClientRuntime getRuntime() { return state.runtime.get(); } diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientRuntime.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientRuntime.java index ab8bbad2cb..fb384e8a8a 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/ClientRuntime.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientRuntime.java @@ -58,8 +58,9 @@ * Client-side request processing runtime. * * @author Marek Potociar (marek.potociar at oracle.com) + * @author Gaurav Gupta (gaurav.gupta@payara.fish) */ -class ClientRuntime implements JerseyClient.ShutdownHook, ClientExecutor { +public class ClientRuntime implements JerseyClient.ShutdownHook, ClientExecutor { private static final Logger LOG = Logger.getLogger(ClientRuntime.class.getName()); @@ -355,7 +356,7 @@ public Connector getConnector() { * * @return injection manager. */ - InjectionManager getInjectionManager() { + public InjectionManager getInjectionManager() { return injectionManager; } } diff --git a/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterInserter.java b/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterInserter.java new file mode 100644 index 0000000000..8f961d10fe --- /dev/null +++ b/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterInserter.java @@ -0,0 +1,79 @@ +/* + * 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 + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or 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 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. + */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] + +package org.glassfish.jersey.client.inject; + +/** + * Provider that converts the an object of a custom Java type + * values to String / Collection<String>> type + * + * @param custom Java type + * @param String / Collection<String>> type + * + * @author Paul Sandoz + * @author Marek Potociar (marek.potociar at oracle.com) + * @author Gaurav Gupta (gaurav.gupta@payara.fish) + */ +public interface ParameterInserter { + + /** + * Name of the parameter to be inserted + * + * @return name of the inserted parameter. + */ + String getName(); + + /** + * Default value (string) that will be used in case input value is not available. + * + * @return default (back-up) value. + */ + String getDefaultValueString(); + + /** + * Insert the value using ParamConverter#toString (and using + * the configured {@link #getDefaultValueString() default value}) + * + * @param parameters custom Java type instance value. + * @return converted value. + */ + R insert(T parameters); +} diff --git a/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterInserterProvider.java b/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterInserterProvider.java new file mode 100644 index 0000000000..3974813de2 --- /dev/null +++ b/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterInserterProvider.java @@ -0,0 +1,65 @@ +/* + * 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 + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or 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 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. + */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] + +package org.glassfish.jersey.client.inject; + +import org.glassfish.jersey.model.Parameter; + +/** + * Provider of parameter inserter. + * + * @author Paul Sandoz + * @author Marek Potociar (marek.potociar at oracle.com) + * @author Gaurav Gupta (gaurav.gupta@payara.fish) + */ +public interface ParameterInserterProvider { + + /** + * Get the inserter configured to insert value of given {@link Parameter parameter}. + *

+ * If the default value has been set on the parameter, it will be configured + * in the inserter. + * + * @param parameter client model parameter. + * @return inserter for the method parameter. + */ + ParameterInserter get(Parameter parameter); +} diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/AbstractParamValueInserter.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/AbstractParamValueInserter.java new file mode 100644 index 0000000000..80005bdac7 --- /dev/null +++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/AbstractParamValueInserter.java @@ -0,0 +1,167 @@ +/* + * 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 + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or 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 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. + */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] + +package org.glassfish.jersey.client.internal.inject; + +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.ext.ParamConverter; + +import org.glassfish.jersey.internal.inject.InserterException; +import org.glassfish.jersey.internal.util.collection.UnsafeValue; +import org.glassfish.jersey.internal.util.collection.Values; + +/** + * Abstract base class for implementing parameter value inserter + * logic supplied using {@link ParamConverter parameter converters}. + * + * @author Paul Sandoz + * @author Marek Potociar (marek.potociar at oracle.com) + * @author Gaurav Gupta (gaurav.gupta@payara.fish) + */ +abstract class AbstractParamValueInserter { + + private final ParamConverter paramConverter; + private final String parameterName; + private final String defaultValue; + private final UnsafeValue convertedDefaultValue; + + /** + * Constructor that initializes parameter inserter. + * + * @param converter parameter converter. + * @param parameterName name of the parameter. + * @param defaultValueString default parameter value string. + */ + protected AbstractParamValueInserter(ParamConverter converter, String parameterName, final String defaultValue) { + this.paramConverter = converter; + this.parameterName = parameterName; + this.defaultValue = defaultValue; + + if (defaultValue != null) { + this.convertedDefaultValue = Values.lazy(new UnsafeValue() { + @Override + public String get() throws RuntimeException { + return defaultValue; + } + }); + + if (!converter.getClass().isAnnotationPresent(ParamConverter.Lazy.class)) { + // ignore return value - executed just for validation reasons + convertedDefaultValue.get(); + } + } else { + convertedDefaultValue = null; + } + } + + /** + * Get the name of the parameter this inserter belongs to. + * + * @return parameter name. + */ + public String getName() { + return parameterName; + } + + /** + * Get the default value of the parameter. + * + * @return default parameter value. + */ + public String getDefaultValueString() { + return defaultValue; + } + + /** + * Insert parameter value to string using the configured {@link ParamConverter parameter converter}. + * + * A {@link WebApplicationException} / {@link IllegalArgumentException} thrown + * from the converter is propagated unchanged. Any other exception throws by + * the converter is wrapped in a new {@link InserterException} before rethrowing. + * + * @param value parameter value to be converted/inserted. + * @return inserted value of a given Java type. + * @throws WebApplicationException in case the underlying parameter converter throws + * a {@code WebApplicationException}. The exception is rethrown without a change. + * @throws InserterException wrapping any other exception thrown by the parameter converter. + */ + protected final String toString(T value) { + String result = convert(value); + if (result == null) { + return defaultValue(); + } + return result; + } + + private String convert(T value) { + try { + return paramConverter.toString(value); + } catch (WebApplicationException | IllegalArgumentException ex) { + throw ex; + } catch (Exception ex) { + throw new InserterException(ex); + } + } + + /** + * Check if there is a default value registered for the parameter. + * + * @return {@code true} if there is a default parameter value registered, {@code false} otherwise. + */ + protected final boolean isDefaultValueRegistered() { + return defaultValue != null; + } + + /** + * Get converted default value. + * + * The conversion happens lazily during first call of the method. + * + * @return converted default value. + */ + protected final String defaultValue() { + if (!isDefaultValueRegistered()) { + return null; + } + + return convertedDefaultValue.get(); + } +} diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/CollectionInserter.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/CollectionInserter.java new file mode 100644 index 0000000000..97467c2cb1 --- /dev/null +++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/CollectionInserter.java @@ -0,0 +1,168 @@ +/* + * 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 + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or 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 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. + */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] + +package org.glassfish.jersey.client.internal.inject; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; +import static java.util.stream.Collectors.toList; +import javax.ws.rs.ProcessingException; +import javax.ws.rs.ext.ParamConverter; +import org.glassfish.jersey.client.internal.LocalizationMessages; +import org.glassfish.jersey.client.inject.ParameterInserter; + +/** + * Insert parameter value as a typed collection. + * + * @param parameter value type. + * @author Paul Sandoz + * @author Marek Potociar (marek.potociar at oracle.com) + * @author Gaurav Gupta (gaurav.gupta@payara.fish) + */ +abstract class CollectionInserter extends AbstractParamValueInserter + implements ParameterInserter, Collection> { + + /** + * Create new collection parameter inserter. + * + * @param converter parameter converter to be used to convert parameter from a custom Java type. + * @param parameterName parameter name. + * @param defaultValue default parameter String value. + */ + protected CollectionInserter(final ParamConverter converter, + final String parameterName, + final String defaultValue) { + super(converter, parameterName, defaultValue); + } + + @Override + @SuppressWarnings("unchecked") + public Collection insert(final Collection values) { + Collection results = Collections.EMPTY_LIST; + if (values != null) { + results = values + .stream() + .map(item -> toString(item)) + .collect(toList()); + } else if (isDefaultValueRegistered()) { + results = Collections.singletonList(getDefaultValueString()); + } + return results; + } + + /** + * Get a new collection instance that will be used to store the inserted parameters. + *

+ * The method is overridden by concrete implementations to return an instance + * of a proper collection sub-type. + * + * @return instance of a proper collection sub-type + */ + protected abstract Collection newCollection(); + + private static final class ListValueOf extends CollectionInserter { + + ListValueOf(final ParamConverter converter, final String parameter, final String defaultValue) { + super(converter, parameter, defaultValue); + } + + @Override + protected List newCollection() { + return new ArrayList<>(); + } + } + + private static final class SetValueOf extends CollectionInserter { + + SetValueOf(final ParamConverter converter, final String parameter, final String defaultValue) { + super(converter, parameter, defaultValue); + } + + @Override + protected Set newCollection() { + return new HashSet<>(); + } + } + + private static final class SortedSetValueOf extends CollectionInserter { + + SortedSetValueOf(final ParamConverter converter, final String parameter, final String defaultValue) { + super(converter, parameter, defaultValue); + } + + @Override + protected SortedSet newCollection() { + return new TreeSet<>(); + } + } + + /** + * Get a new {@code CollectionInserter} instance. + * + * @param collectionType raw collection type. + * @param converter parameter converter to be used to convert parameter Java type values into + * String values . + * @param parameterName parameter name. + * @param defaultValue default parameter string value. + * @param converted parameter Java type. + * @return new collection parameter inserter instance. + */ + public static CollectionInserter getInstance(final Class collectionType, + final ParamConverter converter, + final String parameterName, + final String defaultValue) { + if (List.class == collectionType) { + return new ListValueOf<>(converter, parameterName, defaultValue); + } else if (Set.class == collectionType) { + return new SetValueOf<>(converter, parameterName, defaultValue); + } else if (SortedSet.class == collectionType) { + return new SortedSetValueOf<>(converter, parameterName, defaultValue); + } else { + throw new ProcessingException(LocalizationMessages.COLLECTION_INSERTER_TYPE_UNSUPPORTED()); + } + } +} diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterInserterConfigurator.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterInserterConfigurator.java new file mode 100644 index 0000000000..ce207fe71a --- /dev/null +++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterInserterConfigurator.java @@ -0,0 +1,82 @@ +/* + * 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 + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or 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 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. + */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] + +package org.glassfish.jersey.client.internal.inject; + +import javax.ws.rs.ext.ParamConverterProvider; +import org.glassfish.jersey.client.ClientBootstrapBag; + +import org.glassfish.jersey.internal.BootstrapBag; +import org.glassfish.jersey.internal.BootstrapConfigurator; +import org.glassfish.jersey.internal.inject.Bindings; +import org.glassfish.jersey.internal.inject.InjectionManager; +import org.glassfish.jersey.internal.inject.ParamConverterFactory; +import org.glassfish.jersey.internal.inject.Providers; +import org.glassfish.jersey.internal.util.collection.LazyValue; +import org.glassfish.jersey.internal.util.collection.Value; +import org.glassfish.jersey.internal.util.collection.Values; +import org.glassfish.jersey.client.inject.ParameterInserterProvider; + +/** + * Configurator which initializes and register {@link ParameterInserterProvider} instance into + * {@link InjectionManager}. + * + * @author Petr Bouda + * @author Gaurav Gupta (gaurav.gupta@payara.fish) + */ +public class ParameterInserterConfigurator implements BootstrapConfigurator { + + @Override + public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) { + ClientBootstrapBag clientBag = (ClientBootstrapBag) bootstrapBag; + + // Param Converters must be initialized Lazy and created at the time of the call on inserter + LazyValue lazyParamConverterFactory = + Values.lazy((Value) () -> new ParamConverterFactory( + Providers.getProviders(injectionManager, ParamConverterProvider.class), + Providers.getCustomProviders(injectionManager, ParamConverterProvider.class))); + + ParameterInserterFactory parameterInserter = new ParameterInserterFactory(lazyParamConverterFactory); + clientBag.setParameterInserterProvider(parameterInserter); + injectionManager.register(Bindings.service(parameterInserter) + .to(ParameterInserterProvider.class)); + } +} diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterInserterFactory.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterInserterFactory.java new file mode 100644 index 0000000000..3861dea077 --- /dev/null +++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterInserterFactory.java @@ -0,0 +1,174 @@ +/* + * 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 + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or 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 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. + */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] + +package org.glassfish.jersey.client.internal.inject; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; +import java.util.List; +import java.util.Set; +import java.util.SortedSet; +import javax.ws.rs.ProcessingException; +import javax.ws.rs.ext.ParamConverter; +import javax.inject.Singleton; +import org.glassfish.jersey.internal.inject.InserterException; +import org.glassfish.jersey.internal.inject.ParamConverterFactory; +import org.glassfish.jersey.internal.util.ReflectionHelper; +import org.glassfish.jersey.internal.util.collection.ClassTypePair; +import org.glassfish.jersey.internal.util.collection.LazyValue; +import org.glassfish.jersey.client.internal.LocalizationMessages; +import org.glassfish.jersey.model.Parameter; +import org.glassfish.jersey.internal.inject.PrimitiveMapper; +import org.glassfish.jersey.client.inject.ParameterInserter; +import org.glassfish.jersey.client.inject.ParameterInserterProvider; + +/** + * Implementation of {@link ParameterInserterProvider}. For each + * parameter, the implementation obtains a + * {@link ParamConverter param converter} instance via + * {@link ParamConverterFactory} and creates the proper + * {@link ParameterInserter parameter inserter}. + * + * @author Paul Sandoz + * @author Marek Potociar (marek.potociar at oracle.com) + * @author Gaurav Gupta (gaurav.gupta@payara.fish) + */ +@Singleton +final class ParameterInserterFactory implements ParameterInserterProvider { + + private final LazyValue paramConverterFactory; + + /** + * Create new parameter inserter factory. + * + * @param paramConverterFactory string readers factory. + */ + public ParameterInserterFactory(LazyValue paramConverterFactory) { + this.paramConverterFactory = paramConverterFactory; + } + + @Override + public ParameterInserter get(final Parameter p) { + return process( + paramConverterFactory.get(), + p.getDefaultValue(), + p.getRawType(), + p.getType(), + p.getAnnotations(), + p.getSourceName()); + } + + @SuppressWarnings("unchecked") + private ParameterInserter process( + final ParamConverterFactory paramConverterFactory, + final String defaultValue, + final Class rawType, + final Type type, + final Annotation[] annotations, + final String parameterName) { + + // Try to find a converter that support rawType and type at first. + // E.g. if someone writes a converter that support List this approach should precede the next one. + ParamConverter converter = paramConverterFactory.getConverter(rawType, type, annotations); + if (converter != null) { + try { + return new SingleValueInserter(converter, parameterName, defaultValue); + } catch (final InserterException e) { + throw e; + } catch (final Exception e) { + throw new ProcessingException(LocalizationMessages.ERROR_PARAMETER_TYPE_PROCESSING(rawType), e); + } + } + + // Check whether the rawType is the type of the collection supported. + if (rawType == List.class || rawType == Set.class || rawType == SortedSet.class) { + // Get the generic type of the list. If none is found default to String. + final List typePairs = ReflectionHelper.getTypeArgumentAndClass(type); + final ClassTypePair typePair = (typePairs.size() == 1) ? typePairs.get(0) : null; + + if (typePair != null) { + converter = paramConverterFactory.getConverter( + typePair.rawClass(), + typePair.type(), + annotations + ); + } + if (converter != null) { + try { + return CollectionInserter.getInstance(rawType, converter, parameterName, defaultValue); + } catch (final InserterException e) { + throw e; + } catch (final Exception e) { + throw new ProcessingException(LocalizationMessages.ERROR_PARAMETER_TYPE_PROCESSING(rawType), e); + } + } + } + + // Check primitive types. + if (rawType == String.class) { + return new SingleStringValueInserter(parameterName, defaultValue); + } else if (rawType == Character.class) { + return new PrimitiveCharacterInserter(parameterName, + defaultValue, + PrimitiveMapper.primitiveToDefaultValueMap.get(rawType)); + } else if (rawType.isPrimitive()) { + // Convert primitive to wrapper class + final Class wrappedRaw = PrimitiveMapper.primitiveToClassMap.get(rawType); + if (wrappedRaw == null) { + // Primitive type not supported + return null; + } + + if (wrappedRaw == Character.class) { + return new PrimitiveCharacterInserter(parameterName, + defaultValue, + PrimitiveMapper.primitiveToDefaultValueMap.get(wrappedRaw)); + } + + return new PrimitiveValueOfInserter( + parameterName, + defaultValue, + PrimitiveMapper.primitiveToDefaultValueMap.get(wrappedRaw)); + } + + return null; + } +} diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveCharacterInserter.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveCharacterInserter.java new file mode 100644 index 0000000000..af6e9bae90 --- /dev/null +++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveCharacterInserter.java @@ -0,0 +1,84 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2015-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 + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or 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 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. + */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] + +package org.glassfish.jersey.client.internal.inject; + +import org.glassfish.jersey.client.inject.ParameterInserter; + +/** + * Value inserter for {@link java.lang.Character} and {@code char} parameters. + * + * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Gaurav Gupta (gaurav.gupta@payara.fish) + * + */ +class PrimitiveCharacterInserter implements ParameterInserter { + + private final String parameter; + private final String defaultValue; + private final Object defaultPrimitiveTypeValue; + + public PrimitiveCharacterInserter(String parameter, String defaultValue, Object defaultPrimitiveTypeValue) { + this.parameter = parameter; + this.defaultValue = defaultValue; + this.defaultPrimitiveTypeValue = defaultPrimitiveTypeValue; + } + + @Override + public String getName() { + return parameter; + } + + @Override + public String getDefaultValueString() { + return defaultValue; + } + + @Override + public String insert(Character value) { + if (value != null) { + return value.toString(); + } else if (defaultValue != null) { + return defaultValue; + } + return defaultPrimitiveTypeValue.toString(); + } +} diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveValueOfInserter.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveValueOfInserter.java new file mode 100644 index 0000000000..86126253af --- /dev/null +++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveValueOfInserter.java @@ -0,0 +1,96 @@ +/* + * 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 + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or 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 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. + */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] + +package org.glassfish.jersey.client.internal.inject; + +import org.glassfish.jersey.client.inject.ParameterInserter; + +/** + * Insert String value using {@code toString()} methods + * on the primitive Java type wrapper classes. + * + * @author Paul Sandoz + * @author Marek Potociar (marek.potociar at oracle.com) + * @author Gaurav Gupta (gaurav.gupta@payara.fish) + * + */ +final class PrimitiveValueOfInserter implements ParameterInserter { + + private final String parameter; + private final String defaultValue; + private final Object defaultPrimitiveTypeValue; + + /** + * Create new primitive parameter value inserter. + * + * @param valueOf {@code valueOf()} method handler. + * @param parameter string parameter value. + * @param defaultValue default string value. + * @param defaultPrimitiveTypeValue default primitive type value. + */ + public PrimitiveValueOfInserter(String parameter, + String defaultValue, + Object defaultPrimitiveTypeValue) { + this.parameter = parameter; + this.defaultValue = defaultValue; + this.defaultPrimitiveTypeValue = defaultPrimitiveTypeValue; + } + + @Override + public String getName() { + return parameter; + } + + @Override + public String getDefaultValueString() { + return defaultValue; + } + + @Override + public String insert(Number value) { + if (value != null) { + return value.toString(); + } else if (defaultValue != null) { + return defaultValue; + } + return defaultPrimitiveTypeValue.toString(); + } +} diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleStringValueInserter.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleStringValueInserter.java new file mode 100644 index 0000000000..91b12d7795 --- /dev/null +++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleStringValueInserter.java @@ -0,0 +1,96 @@ +/* + * 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 + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or 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 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. + */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] + +package org.glassfish.jersey.client.internal.inject; + +import org.glassfish.jersey.client.inject.ParameterInserter; + +/** + * Insert value of the parameter by returning the first string parameter value + * found in the list of string parameter values. + *

+ * This class can be seen as a special, optimized, case of {@link SingleValueInserter}. + * + * @author Paul Sandoz + * @author Marek Potociar (marek.potociar at oracle.com) + * @author Gaurav Gupta (gaurav.gupta@payara.fish) + */ +final class SingleStringValueInserter implements ParameterInserter { + + private final String paramName; + private final String defaultValue; + + /** + * Create new single string value inserter. + * + * @param parameterName string parameter name. + * @param defaultValue default value. + */ + public SingleStringValueInserter(String parameterName, String defaultValue) { + this.paramName = parameterName; + this.defaultValue = defaultValue; + } + + @Override + public String getName() { + return paramName; + } + + @Override + public String getDefaultValueString() { + return defaultValue; + } + + /** + * {@inheritDoc} + *

+ * This implementation return s the first String value found in the list of + * potential multiple string parameter values. Any other values in the multi-value + * list will be ignored. + * + * @param parameters map of parameters. + * @return inserted single string parameter value. + */ + @Override + public String insert(String value) { + return (value != null) ? value : defaultValue; + } +} diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleValueInserter.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleValueInserter.java new file mode 100644 index 0000000000..4b2f903ed2 --- /dev/null +++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleValueInserter.java @@ -0,0 +1,99 @@ +/* + * 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 + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or 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 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. + */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] + +package org.glassfish.jersey.client.internal.inject; + +import javax.ws.rs.ProcessingException; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.ext.ParamConverter; +import org.glassfish.jersey.internal.inject.InserterException; +import org.glassfish.jersey.client.inject.ParameterInserter; + + +/** + * Insert value of the parameter using a single parameter value and the underlying + * {@link ParamConverter param converter}. + * + * @param custom Java type. + * @author Paul Sandoz + * @author Marek Potociar (marek.potociar at oracle.com) + * @author Gaurav Gupta (gaurav.gupta@payara.fish) + */ +final class SingleValueInserter extends AbstractParamValueInserter implements ParameterInserter { + + /** + * Create new single value inserter. + * + * @param converter string value reader. + * @param parameterName string parameter name. + * @param defaultValue default value. + */ + public SingleValueInserter(final ParamConverter converter, final String parameterName, final String defaultValue) { + super(converter, parameterName, defaultValue); + } + + /** + * {@inheritDoc} + *

+ * This implementation inserts the value of the parameter applying the underlying + * {@link ParamConverter param converter} to the first value found in the list of potential multiple + * parameter values. Any other values in the multi-value list will be ignored. + * + * @param parameters map of parameters. + * @return inserted single parameter value. + */ + @Override + public String insert(final T value){ + try { + if (value == null && isDefaultValueRegistered()) { + return getDefaultValueString(); + } else { + return toString(value); + } + } catch (final WebApplicationException | ProcessingException ex) { + throw ex; + } catch (final IllegalArgumentException ex) { + return defaultValue(); + } catch (final Exception ex) { + throw new InserterException(ex); + } + } +} diff --git a/core-client/src/main/resources/org/glassfish/jersey/client/internal/localization.properties b/core-client/src/main/resources/org/glassfish/jersey/client/internal/localization.properties index 12134f7dd0..8c815f1e3a 100644 --- a/core-client/src/main/resources/org/glassfish/jersey/client/internal/localization.properties +++ b/core-client/src/main/resources/org/glassfish/jersey/client/internal/localization.properties @@ -32,12 +32,14 @@ client.target.link.null=Link to the newly created target must not be null. client.uri.template.null=URI template of the newly created target must not be null. client.uri.null=URI of the newly created target must not be null. client.uri.builder.null=URI builder of the newly created target must not be null. +collection.inserter.type.unsupported=Unsupported collection type. digest.filter.qop.unsupported=The 'qop' (quality of protection) = {0} extension requested by the server is not supported by Jersey HttpDigestAuthFilter. Cannot authenticate against the server using Http Digest Authentication. error.closing.output.stream=Error when closing the output stream. error.committing.output.stream=Error while committing the request output stream. error.digest.filter.generator=Error during initialization of random generator of Digest authentication. error.http.method.entity.not.null=Entity must be null for http method {0}. error.http.method.entity.null=Entity must not be null for http method {0}. +error.parameter.type.processing=Could not process parameter type {0}. error.service.locator.provider.instance.request=Incorrect type of request instance {0}. Parameter must be a default Jersey ClientRequestContext implementation. error.service.locator.provider.instance.response=Incorrect type of response instance {0}. Parameter must be a default Jersey ClientResponseContext implementation. ignored.async.threadpool.size=Zero or negative asynchronous thread pool size specified in the client configuration property: [{0}] \ diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/inject/InserterException.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/InserterException.java new file mode 100644 index 0000000000..a5892de9ea --- /dev/null +++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/InserterException.java @@ -0,0 +1,82 @@ +/* + * 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 + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or 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 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 org.glassfish.jersey.internal.inject; + +import javax.ws.rs.ProcessingException; +import javax.ws.rs.WebApplicationException; + +/** + * A runtime exception that contains a cause, a checked or runtime exception, + * that may be passed to the cause of a {@link WebApplicationException}. + * + * @author Paul Sandoz + */ +public class InserterException extends ProcessingException { + private static final long serialVersionUID = -4918023257104413981L; + + /** + * Create new parameter extractor exception. + * + * @param message exception message. + */ + public InserterException(String message) { + super(message); + } + + /** + * Create new parameter extractor exception. + * + * @param message exception message. + * @param cause exception cause. + */ + public InserterException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Create new parameter extractor exception. + * + * @param cause exception cause. + */ + public InserterException(Throwable cause) { + super(cause); + } +} diff --git a/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientBuilderImpl.java b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientBuilderImpl.java index 13187ea6c1..2142d6e78a 100644 --- a/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientBuilderImpl.java +++ b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientBuilderImpl.java @@ -19,7 +19,6 @@ import java.net.URISyntaxException; import java.net.URL; import java.util.Map; -import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.Configuration; @@ -72,26 +71,21 @@ public RestClientBuilder executorService(ExecutorService executor) { } @Override - public T build(Class restClient) throws IllegalStateException, RestClientDefinitionException { + public T build(Class restClientInterface) throws IllegalStateException, RestClientDefinitionException { // interface validity - RestClientValidator.getInstance().validate(restClient); + RestClientValidator.getInstance().validate(restClientInterface); registerDefaultExceptionMapper(); + registerProviders(restClientInterface); - registerProviders(restClient); - + JerseyClient client = (JerseyClient) clientBuilder.build(); + client.preInitialize(); if (baseUri == null) { throw new IllegalStateException("Base URI or URL can't be null"); } - - Client client = clientBuilder.build(); - if (client instanceof JerseyClient) { - ((JerseyClient) client).preInitialize(); - } WebTarget webTarget = client.target(baseUri); - - return WebResourceFactory.newResource(restClient, webTarget); + return WebResourceFactory.newResource(restClientInterface, webTarget); } private void registerDefaultExceptionMapper() { @@ -177,4 +171,4 @@ public RestClientBuilder register(Object component, Map, Integer> contr return this; } -} \ No newline at end of file +} diff --git a/ext/proxy-client/pom.xml b/ext/proxy-client/pom.xml index fa268a4eca..7b89f3f6f8 100644 --- a/ext/proxy-client/pom.xml +++ b/ext/proxy-client/pom.xml @@ -51,6 +51,11 @@ + + org.glassfish.jersey.core + jersey-client + ${project.version} + org.glassfish.jersey.core jersey-common diff --git a/ext/proxy-client/src/main/java/org/glassfish/jersey/client/proxy/WebResourceFactory.java b/ext/proxy-client/src/main/java/org/glassfish/jersey/client/proxy/WebResourceFactory.java index e0f3f4793e..0e4ec72406 100644 --- a/ext/proxy-client/src/main/java/org/glassfish/jersey/client/proxy/WebResourceFactory.java +++ b/ext/proxy-client/src/main/java/org/glassfish/jersey/client/proxy/WebResourceFactory.java @@ -60,8 +60,14 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedHashMap; import javax.ws.rs.core.MultivaluedMap; +import org.glassfish.jersey.client.ClientConfig; +import org.glassfish.jersey.internal.inject.InjectionManager; +import org.glassfish.jersey.internal.inject.Providers; import org.glassfish.jersey.internal.util.ReflectionHelper; +import org.glassfish.jersey.model.Parameter; +import org.glassfish.jersey.client.inject.ParameterInserter; +import org.glassfish.jersey.client.inject.ParameterInserterProvider; /** * Factory for client-side representation of a resource. @@ -78,6 +84,8 @@ public final class WebResourceFactory implements InvocationHandler { private final MultivaluedMap headers; private final List cookies; private final Form form; + private final InjectionManager injectionManager; + private final Map inserterCache = new HashMap<>(); private static final MultivaluedMap EMPTY_HEADERS = new MultivaluedHashMap<>(); private static final Form EMPTY_FORM = new Form(); @@ -136,6 +144,9 @@ private WebResourceFactory(final WebTarget target, final MultivaluedMap responseType = method.getReturnType(); + final List parameters = Collections.unmodifiableList( + Parameter.create(proxyIfc, method.getDeclaringClass(), method, false) + ); + // determine method name String httpMethod = getHttpMethodName(method); if (httpMethod == null) { @@ -192,21 +207,22 @@ public Object invoke(final Object proxy, final Method method, final Object[] arg final LinkedList cookies = new LinkedList<>(this.cookies); final Form form = new Form(); form.asMap().putAll(this.form.asMap()); - final Annotation[][] paramAnns = method.getParameterAnnotations(); + final Annotation[][] paramAnnotations = method.getParameterAnnotations(); Object entity = null; Type entityType = null; - for (int i = 0; i < paramAnns.length; i++) { - final Map anns = new HashMap<>(); - for (final Annotation ann : paramAnns[i]) { - anns.put(ann.annotationType(), ann); + for (int i = 0; i < paramAnnotations.length; i++) { + final Map annotations = new HashMap<>(); + for (final Annotation annotation : paramAnnotations[i]) { + annotations.put(annotation.annotationType(), annotation); } Object value = args[i]; - if (!hasAnyParamAnnotation(anns)) { + Parameter parameter = parameters.get(i); + if (!hasAnyParamAnnotation(annotations)) { entityType = method.getGenericParameterTypes()[i]; entity = value; } else { - newTarget = parseParamMetadata(newTarget, headers, cookies, form, anns, value); + newTarget = parseParamMetadata(newTarget, headers, cookies, form, annotations, parameter, value); } } @@ -310,6 +326,17 @@ private WebTarget parseParamMetadata( Form form, Map anns, Object value) { + return parseParamMetadata(newTarget, headers, cookies, form, anns, null, value); + } + + private WebTarget parseParamMetadata( + WebTarget newTarget, + MultivaluedHashMap headers, + LinkedList cookies, + Form form, + Map anns, + Parameter parameter, + Object value) { Annotation ann; if (value == null && (ann = anns.get(DefaultValue.class)) != null) { @@ -317,9 +344,17 @@ private WebTarget parseParamMetadata( } if (value != null) { + ParameterInserter parameterInserter = getParameterInserter(parameter); + if ((ann = anns.get(PathParam.class)) != null) { + if (parameterInserter != null) { + value = parameterInserter.insert(value); + } newTarget = newTarget.resolveTemplate(((PathParam) ann).value(), value); } else if ((ann = anns.get((QueryParam.class))) != null) { + if (parameterInserter != null) { + value = parameterInserter.insert(value); + } if (value instanceof Collection) { newTarget = newTarget.queryParam(((QueryParam) ann).value(), convert((Collection) value)); } else { @@ -362,6 +397,9 @@ private WebTarget parseParamMetadata( } } } else if ((ann = anns.get((HeaderParam.class))) != null) { + if (parameterInserter != null) { + value = parameterInserter.insert(value); + } if (value instanceof Collection) { headers.addAll(((HeaderParam) ann).value(), convert((Collection) value)); } else { @@ -369,6 +407,9 @@ private WebTarget parseParamMetadata( } } else if ((ann = anns.get((CookieParam.class))) != null) { + if (parameterInserter != null) { + value = parameterInserter.insert(value); + } final String name = ((CookieParam) ann).value(); Cookie c; if (value instanceof Collection) { @@ -396,6 +437,9 @@ private WebTarget parseParamMetadata( } } } else if ((ann = anns.get((MatrixParam.class))) != null) { + if (parameterInserter != null) { + value = parameterInserter.insert(value); + } if (value instanceof Collection) { newTarget = newTarget.matrixParam(((MatrixParam) ann).value(), convert((Collection) value)); } else { @@ -414,6 +458,25 @@ private WebTarget parseParamMetadata( return newTarget; } + private ParameterInserter getParameterInserter(Parameter parameter) { + ParameterInserter parameterInserter = null; + if (parameter != null) { + parameterInserter = inserterCache.get(parameter); + if (parameterInserter == null) { + Iterable parameterInserterProviders + = Providers.getAllProviders(injectionManager, ParameterInserterProvider.class); + for (final ParameterInserterProvider parameterInserterProvider : parameterInserterProviders) { + if (parameterInserterProvider != null) { + parameterInserter = (ParameterInserter) parameterInserterProvider.get(parameter); + inserterCache.put(parameter, parameterInserter); + break; + } + } + } + } + return parameterInserter; + } + private boolean hasAnyParamAnnotation(final Map anns) { return anns.keySet() .stream() From 87e0494c02427db276a84201f9fb30e5e4a8569d Mon Sep 17 00:00:00 2001 From: jGauravGupta Date: Fri, 25 May 2018 11:08:20 +0530 Subject: [PATCH 06/17] Rest Client API v1.1 upgrade Signed-off-by: jGauravGupta --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 781a460802..15fa6049a8 100644 --- a/pom.xml +++ b/pom.xml @@ -1986,7 +1986,7 @@ 1.0 2.1 2.1 - 1.1-payara-p1 + 1.1 1.1 3.3.0.Final 1.19.3 From 7384c21f92c8f443750339bdf393b6bd45339fad Mon Sep 17 00:00:00 2001 From: jGauravGupta Date: Fri, 25 May 2018 11:09:07 +0530 Subject: [PATCH 07/17] Remove redundant MessageBodyReader/MessageBodyWriter filtering based on custom flag Signed-off-by: jGauravGupta --- .../message/internal/MessageBodyFactory.java | 39 ++++++------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/MessageBodyFactory.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/MessageBodyFactory.java index 4687963bca..16da0f1e17 100644 --- a/core-common/src/main/java/org/glassfish/jersey/message/internal/MessageBodyFactory.java +++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/MessageBodyFactory.java @@ -794,36 +794,21 @@ private MessageBodyWriter _getMessageBodyWriter(final Class c, final T final TracingLogger tracingLogger = TracingLogger.getInstance(propertiesDelegate); MessageBodyWriter selected = null; - - Optional customModel = writers.stream() - .filter(WriterModel::isCustom) - .filter(model -> model.isWriteable(c, t, as, mediaType)) - .findAny(); - if (customModel.isPresent()) { - selected = customModel.get().provider(); - tracingLogger.log(MsgTraceEvent.MBW_SELECTED, selected); - if (tracingLogger.isLogEnabled(MsgTraceEvent.MBW_SKIPPED)) { - writers.stream() - .filter(model -> model != customModel.get()) - .forEach(model -> tracingLogger.log(MsgTraceEvent.MBW_SKIPPED, model.provider())); + final Iterator iterator = writers.iterator(); + while (iterator.hasNext()) { + final WriterModel model = iterator.next(); + if (model.isWriteable(c, t, as, mediaType)) { + selected = (MessageBodyWriter) model.provider(); + tracingLogger.log(MsgTraceEvent.MBW_SELECTED, selected); + break; } - } else { - final Iterator iterator = writers.iterator(); + tracingLogger.log(MsgTraceEvent.MBW_NOT_WRITEABLE, model.provider()); + } + + if (tracingLogger.isLogEnabled(MsgTraceEvent.MBW_SKIPPED)) { while (iterator.hasNext()) { final WriterModel model = iterator.next(); - if (model.isWriteable(c, t, as, mediaType)) { - selected = (MessageBodyWriter) model.provider(); - tracingLogger.log(MsgTraceEvent.MBW_SELECTED, selected); - break; - } - tracingLogger.log(MsgTraceEvent.MBW_NOT_WRITEABLE, model.provider()); - } - - if (tracingLogger.isLogEnabled(MsgTraceEvent.MBW_SKIPPED)) { - while (iterator.hasNext()) { - final WriterModel model = iterator.next(); - tracingLogger.log(MsgTraceEvent.MBW_SKIPPED, model.provider()); - } + tracingLogger.log(MsgTraceEvent.MBW_SKIPPED, model.provider()); } } From 86942c10961e480bbcd14630f7b6b5451f674fb1 Mon Sep 17 00:00:00 2001 From: jGauravGupta Date: Tue, 29 May 2018 18:41:19 +0530 Subject: [PATCH 08/17] Ignore RestClient interface Signed-off-by: jGauravGupta --- containers/jersey-servlet/pom.xml | 6 +++++- .../servlet/init/JerseyServletContainerInitializer.java | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/containers/jersey-servlet/pom.xml b/containers/jersey-servlet/pom.xml index a9a6634551..471a325979 100644 --- a/containers/jersey-servlet/pom.xml +++ b/containers/jersey-servlet/pom.xml @@ -16,6 +16,7 @@ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 --> + 4.0.0 @@ -39,7 +40,10 @@ ${servlet3.version} provided - + + org.eclipse.microprofile.rest.client + microprofile-rest-client-api + org.glassfish.jersey.containers jersey-container-servlet-core diff --git a/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java b/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java index 5d58730dec..5c5935fe20 100644 --- a/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java +++ b/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java @@ -13,6 +13,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ +// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.servlet.init; @@ -38,6 +39,7 @@ import javax.servlet.ServletException; import javax.servlet.ServletRegistration; import javax.servlet.annotation.HandlesTypes; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.servlet.ServletContainer; @@ -111,6 +113,8 @@ public void onStartup(Set> classes, final ServletContext servletContext if (classes == null) { classes = Collections.emptySet(); } + classes.removeIf(clazz -> clazz.isAnnotationPresent(RegisterRestClient.class)); + // PRE INIT for (final ServletContainerProvider servletContainerProvider : allServletContainerProviders) { servletContainerProvider.preInit(servletContext, classes); From 30b9478441454b1a39d98539facaa14292d8c54a Mon Sep 17 00:00:00 2001 From: jGauravGupta Date: Wed, 30 May 2018 20:15:07 +0530 Subject: [PATCH 09/17] Jaxrs Client Decorator fix Signed-off-by: jGauravGupta --- .../rest/client/RestClientBuilderImpl.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientBuilderImpl.java b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientBuilderImpl.java index 2142d6e78a..d2d70fbb21 100644 --- a/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientBuilderImpl.java +++ b/ext/microprofile-rest-client/src/main/java/org/glassfish/jersey/microprofile/rest/client/RestClientBuilderImpl.java @@ -19,6 +19,7 @@ import java.net.URISyntaxException; import java.net.URL; import java.util.Map; +import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.Configuration; @@ -31,7 +32,6 @@ import static java.lang.Boolean.FALSE; import java.net.URI; import java.util.concurrent.ExecutorService; -import org.glassfish.jersey.client.JerseyClient; public class RestClientBuilderImpl implements RestClientBuilder { @@ -72,6 +72,9 @@ public RestClientBuilder executorService(ExecutorService executor) { @Override public T build(Class restClientInterface) throws IllegalStateException, RestClientDefinitionException { + if (baseUri == null) { + throw new IllegalStateException("Base URI or URL can't be null"); + } // interface validity RestClientValidator.getInstance().validate(restClientInterface); @@ -79,11 +82,7 @@ public T build(Class restClientInterface) throws IllegalStateException, R registerDefaultExceptionMapper(); registerProviders(restClientInterface); - JerseyClient client = (JerseyClient) clientBuilder.build(); - client.preInitialize(); - if (baseUri == null) { - throw new IllegalStateException("Base URI or URL can't be null"); - } + Client client = clientBuilder.build(); WebTarget webTarget = client.target(baseUri); return WebResourceFactory.newResource(restClientInterface, webTarget); } From e17ca2cc3ef5621c4716ed1aa09cdf5d53b25cd9 Mon Sep 17 00:00:00 2001 From: jGauravGupta Date: Fri, 1 Jun 2018 19:45:30 +0530 Subject: [PATCH 10/17] microprofile-rest-client snapshot version added Signed-off-by: jGauravGupta --- ext/microprofile-rest-client/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/microprofile-rest-client/pom.xml b/ext/microprofile-rest-client/pom.xml index 84f1b8b8ee..bcb05b063d 100644 --- a/ext/microprofile-rest-client/pom.xml +++ b/ext/microprofile-rest-client/pom.xml @@ -23,7 +23,7 @@ org.glassfish.jersey.ext project - 2.27 + 2.28-SNAPSHOT jersey-microprofile-rest-client From 90268985b8181c804ced3fe11c2a22091db8d0fd Mon Sep 17 00:00:00 2001 From: jGauravGupta Date: Fri, 1 Jun 2018 20:34:44 +0530 Subject: [PATCH 11/17] checkstyle fix Signed-off-by: jGauravGupta --- .../test/java/org/glassfish/jersey/tests/e2e/json/JaxbTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/JaxbTest.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/JaxbTest.java index 3a393deabb..27a09da5cf 100644 --- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/JaxbTest.java +++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/JaxbTest.java @@ -108,7 +108,7 @@ private static boolean isJavaVersionSupported() { if (javaVersion != null) { int pos = javaVersion.lastIndexOf("_"); if (pos > -1) { - final Integer minorVersion = Integer.valueOf(javaVersion.substring(pos+1)); + final Integer minorVersion = Integer.valueOf(javaVersion.substring(pos + 1)); return minorVersion < 160 || minorVersion > 172; //only those between 161 and 172 minor // releases are not supported } From b94dfc0561b4dd2347b0d785db1600e4770d608d Mon Sep 17 00:00:00 2001 From: Gaurav Gupta Date: Thu, 12 Jul 2018 12:50:56 +0530 Subject: [PATCH 12/17] Payara Copyright update Signed-off-by: Gaurav Gupta --- bom/pom.xml | 2 +- containers/jersey-servlet/pom.xml | 2 +- .../JerseyServletContainerInitializer.java | 2 +- .../glassfish/jersey/client/ClientConfig.java | 2 +- .../jersey/client/ClientRuntime.java | 2 +- .../JerseyCompletionStageRxInvoker.java | 2 +- .../jersey/client/JerseyInvocation.java | 2 +- .../client/inject/ParameterInserter.java | 46 +++++------------- .../inject/ParameterInserterProvider.java | 46 +++++------------- .../inject/AbstractParamValueInserter.java | 46 +++++------------- .../internal/inject/CollectionInserter.java | 46 +++++------------- .../inject/ParameterInserterConfigurator.java | 44 ++++------------- .../inject/ParameterInserterFactory.java | 46 +++++------------- .../inject/PrimitiveCharacterInserter.java | 46 +++++------------- .../inject/PrimitiveValueOfInserter.java | 46 +++++------------- .../inject/SingleStringValueInserter.java | 46 +++++------------- .../internal/inject/SingleValueInserter.java | 46 +++++------------- core-common/pom.xml | 2 +- .../main/java/org/glassfish/jersey/Uri.java | 2 +- .../internal/inject/InserterException.java | 47 +++++-------------- .../inject/ParamConverterConfigurator.java | 2 +- .../inject/ParamConverterFactory.java | 2 +- .../internal/inject/ParamConverters.java | 2 +- .../internal/inject/PrimitiveMapper.java | 2 +- .../jersey/internal/inject/Providers.java | 2 +- .../message/internal/MessageBodyFactory.java | 2 +- .../jersey/model/AnnotatedMethod.java | 2 +- .../jersey/model/ParamQualifier.java | 2 +- .../org/glassfish/jersey/model/Parameter.java | 2 +- .../jersey/internal/localization.properties | 3 +- .../glassfish/jersey/model/ParameterTest.java | 2 +- .../ParameterWithMultipleAnnotationsTest.java | 2 +- .../jersey/server/ApplicationHandler.java | 2 +- .../filter/RolesAllowedDynamicFeature.java | 2 +- .../inject/AbstractValueParamProvider.java | 2 +- .../AsyncResponseValueParamProvider.java | 2 +- .../inject/BeanParamValueParamProvider.java | 2 +- .../inject/CookieParamValueParamProvider.java | 2 +- .../DelegatedInjectionValueParamProvider.java | 2 +- .../inject/EntityParamValueParamProvider.java | 2 +- .../inject/FormParamValueParamProvider.java | 2 +- .../inject/HeaderParamValueParamProvider.java | 2 +- .../inject/MatrixParamValueParamProvider.java | 2 +- .../MultivaluedParameterExtractorFactory.java | 2 +- ...MultivaluedParameterExtractorProvider.java | 2 +- .../inject/ParamExtractorConfigurator.java | 2 +- .../inject/ParamInjectionResolver.java | 2 +- .../inject/PathParamValueParamProvider.java | 2 +- .../inject/QueryParamValueParamProvider.java | 2 +- .../ValueParamProviderConfigurator.java | 2 +- .../inject/WebTargetValueParamProvider.java | 2 +- .../routing/MethodSelectingRouter.java | 2 +- .../server/model/HandlerConstructor.java | 2 +- .../server/model/IntrospectionModeller.java | 2 +- .../jersey/server/model/Invocable.java | 2 +- .../server/model/InvocableValidator.java | 2 +- .../jersey/server/model/MethodHandler.java | 2 +- .../jersey/server/model/MethodList.java | 2 +- .../jersey/server/model/Parameterized.java | 2 +- .../jersey/server/model/ResourceMethod.java | 2 +- .../server/model/ResourceMethodValidator.java | 2 +- .../model/RuntimeResourceModelValidator.java | 2 +- .../internal/ParamValueFactoryWithSource.java | 2 +- .../spi/internal/ParameterValueHelper.java | 2 +- .../spi/internal/ValueParamProvider.java | 2 +- .../jersey/server/wadl/WadlGenerator.java | 2 +- .../server/wadl/internal/WadlBuilder.java | 2 +- .../wadl/internal/WadlGeneratorImpl.java | 2 +- .../WadlGeneratorApplicationDoc.java | 2 +- .../WadlGeneratorGrammarsSupport.java | 2 +- .../WadlGeneratorJAXBGrammarGenerator.java | 2 +- .../resourcedoc/ResourceDocAccessor.java | 2 +- .../WadlGeneratorResourceDocSupport.java | 2 +- .../server/TestInjectionManagerFactory.java | 2 +- .../inject/ParamConverterInternalTest.java | 2 +- .../server/internal/inject/UriTest.java | 2 +- .../server/model/GenericMethodListTest.java | 2 +- .../jersey/server/model/MethodListTest.java | 2 +- .../annotation/IntrospectionModellerTest.java | 2 +- .../wadl/config/WadlGeneratorConfigTest.java | 2 +- .../WadlGeneratorConfigurationLoaderTest.java | 2 +- .../wadl/config/WadlGeneratorLoaderTest.java | 2 +- .../resources/ClientResource.java | 2 +- .../managedclient/PublicResource.java | 2 +- .../managedclient/PublicResource.java | 2 +- .../examples/opentracing/TracedResource.java | 2 +- .../examples/rx/agent/AsyncAgentResource.java | 2 +- .../agent/CompletionStageAgentResource.java | 2 +- .../rx/agent/FlowableAgentResource.java | 2 +- .../agent/ListenableFutureAgentResource.java | 2 +- .../rx/agent/ObservableAgentResource.java | 2 +- .../examples/rx/agent/SyncAgentResource.java | 2 +- .../cdi1x/internal/CdiComponentProvider.java | 2 +- ext/pom.xml | 2 +- ext/proxy-client/pom.xml | 2 +- .../client/proxy/WebResourceFactory.java | 2 +- .../linking/InjectLinkFieldDescriptor.java | 2 +- .../jersey/linking/ProvideLinkDescriptor.java | 2 +- .../jersey/media/multipart/FormDataParam.java | 2 +- .../FormDataParamValueParamProvider.java | 2 +- .../SseEventSinkValueParamProvider.java | 2 +- pom.xml | 2 +- .../server/ClientResponseOnServerTest.java | 2 +- .../e2e/server/ManagedClientExecutorTest.java | 2 +- .../jersey/tests/api/ResponseE2ETest.java | 2 +- .../jersey2167/MyValueParamProvider.java | 2 +- 106 files changed, 217 insertions(+), 479 deletions(-) diff --git a/bom/pom.xml b/bom/pom.xml index 9c84309798..c0952203d6 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -2,6 +2,7 @@ - diff --git a/containers/jersey-servlet/pom.xml b/containers/jersey-servlet/pom.xml index 471a325979..ffd2953eec 100644 --- a/containers/jersey-servlet/pom.xml +++ b/containers/jersey-servlet/pom.xml @@ -2,6 +2,7 @@ - 4.0.0 diff --git a/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java b/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java index 5c5935fe20..3bfe080afd 100644 --- a/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java +++ b/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.servlet.init; diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientConfig.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientConfig.java index 39ddab5bd5..6d75aa9409 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/ClientConfig.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientConfig.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client; diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientRuntime.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientRuntime.java index fb384e8a8a..88b0c24c06 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/ClientRuntime.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientRuntime.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client; diff --git a/core-client/src/main/java/org/glassfish/jersey/client/JerseyCompletionStageRxInvoker.java b/core-client/src/main/java/org/glassfish/jersey/client/JerseyCompletionStageRxInvoker.java index 526fa2f76b..8a7fbc5ae0 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/JerseyCompletionStageRxInvoker.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/JerseyCompletionStageRxInvoker.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client; diff --git a/core-client/src/main/java/org/glassfish/jersey/client/JerseyInvocation.java b/core-client/src/main/java/org/glassfish/jersey/client/JerseyInvocation.java index feca2ef567..9607f264ef 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/JerseyInvocation.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/JerseyInvocation.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client; diff --git a/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterInserter.java b/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterInserter.java index 8f961d10fe..041e8d1822 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterInserter.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterInserter.java @@ -1,43 +1,19 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * - * 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. * - * 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 - * https://oss.oracle.com/licenses/CDDL+GPL-1.1 - * or LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * 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. * - * When distributing the software, include this License Header Notice in each - * file and include the License file at 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. + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client.inject; diff --git a/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterInserterProvider.java b/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterInserterProvider.java index 3974813de2..c992a49986 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterInserterProvider.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterInserterProvider.java @@ -1,43 +1,19 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * - * 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. * - * 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 - * https://oss.oracle.com/licenses/CDDL+GPL-1.1 - * or LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * 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. * - * When distributing the software, include this License Header Notice in each - * file and include the License file at 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. + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client.inject; diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/AbstractParamValueInserter.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/AbstractParamValueInserter.java index 80005bdac7..666b7a0c3c 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/AbstractParamValueInserter.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/AbstractParamValueInserter.java @@ -1,43 +1,19 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * - * 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. * - * 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 - * https://oss.oracle.com/licenses/CDDL+GPL-1.1 - * or LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * 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. * - * When distributing the software, include this License Header Notice in each - * file and include the License file at 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. + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client.internal.inject; diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/CollectionInserter.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/CollectionInserter.java index 97467c2cb1..e46d0ca802 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/CollectionInserter.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/CollectionInserter.java @@ -1,43 +1,19 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * - * 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. * - * 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 - * https://oss.oracle.com/licenses/CDDL+GPL-1.1 - * or LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * 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. * - * When distributing the software, include this License Header Notice in each - * file and include the License file at 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. + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client.internal.inject; diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterInserterConfigurator.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterInserterConfigurator.java index ce207fe71a..d9415b2f7c 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterInserterConfigurator.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterInserterConfigurator.java @@ -1,43 +1,19 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * * Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * - * 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 - * https://oss.oracle.com/licenses/CDDL+GPL-1.1 - * or 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 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. + * 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. * - * 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]" + * 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. * - * 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. + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client.internal.inject; diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterInserterFactory.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterInserterFactory.java index 3861dea077..be7ca0c88e 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterInserterFactory.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterInserterFactory.java @@ -1,43 +1,19 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * - * 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. * - * 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 - * https://oss.oracle.com/licenses/CDDL+GPL-1.1 - * or LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * 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. * - * When distributing the software, include this License Header Notice in each - * file and include the License file at 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. + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client.internal.inject; diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveCharacterInserter.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveCharacterInserter.java index af6e9bae90..4afdf8bf11 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveCharacterInserter.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveCharacterInserter.java @@ -1,43 +1,19 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * - * Copyright (c) 2015-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. * - * 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 - * https://oss.oracle.com/licenses/CDDL+GPL-1.1 - * or LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * 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. * - * When distributing the software, include this License Header Notice in each - * file and include the License file at 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. + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client.internal.inject; diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveValueOfInserter.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveValueOfInserter.java index 86126253af..5f148819cf 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveValueOfInserter.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveValueOfInserter.java @@ -1,43 +1,19 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * - * 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. * - * 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 - * https://oss.oracle.com/licenses/CDDL+GPL-1.1 - * or LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * 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. * - * When distributing the software, include this License Header Notice in each - * file and include the License file at 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. + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client.internal.inject; diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleStringValueInserter.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleStringValueInserter.java index 91b12d7795..40f6d2239e 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleStringValueInserter.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleStringValueInserter.java @@ -1,43 +1,19 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * - * 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. * - * 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 - * https://oss.oracle.com/licenses/CDDL+GPL-1.1 - * or LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * 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. * - * When distributing the software, include this License Header Notice in each - * file and include the License file at 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. + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client.internal.inject; diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleValueInserter.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleValueInserter.java index 4b2f903ed2..166921eab8 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleValueInserter.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleValueInserter.java @@ -1,43 +1,19 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * - * 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. * - * 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 - * https://oss.oracle.com/licenses/CDDL+GPL-1.1 - * or LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * 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. * - * When distributing the software, include this License Header Notice in each - * file and include the License file at 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. + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client.internal.inject; diff --git a/core-common/pom.xml b/core-common/pom.xml index e6f6bb5479..dbad8549c2 100644 --- a/core-common/pom.xml +++ b/core-common/pom.xml @@ -2,6 +2,7 @@ - 4.0.0 diff --git a/core-common/src/main/java/org/glassfish/jersey/Uri.java b/core-common/src/main/java/org/glassfish/jersey/Uri.java index fdfb7bb9be..53a00f410f 100644 --- a/core-common/src/main/java/org/glassfish/jersey/Uri.java +++ b/core-common/src/main/java/org/glassfish/jersey/Uri.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey; diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/inject/InserterException.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/InserterException.java index a5892de9ea..39ddbe3e4a 100644 --- a/core-common/src/main/java/org/glassfish/jersey/internal/inject/InserterException.java +++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/InserterException.java @@ -1,41 +1,18 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * - * 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. * - * 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 - * https://oss.oracle.com/licenses/CDDL+GPL-1.1 - * or LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * 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. * - * When distributing the software, include this License Header Notice in each - * file and include the License file at 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. + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ package org.glassfish.jersey.internal.inject; @@ -48,6 +25,8 @@ * that may be passed to the cause of a {@link WebApplicationException}. * * @author Paul Sandoz + * @author Gaurav Gupta + * */ public class InserterException extends ProcessingException { private static final long serialVersionUID = -4918023257104413981L; diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterConfigurator.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterConfigurator.java index 17666c2897..8da0c05447 100644 --- a/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterConfigurator.java +++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterConfigurator.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.internal.inject; diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterFactory.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterFactory.java index 0ed57d8091..3b66017c25 100644 --- a/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterFactory.java +++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterFactory.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -42,7 +43,6 @@ * @author Marek Potociar (marek.potociar at oracle.com) * @author Miroslav Fuksa */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] @Singleton public class ParamConverterFactory implements ParamConverterProvider { diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverters.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverters.java index 2ae600cb5f..22a1d1dc04 100644 --- a/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverters.java +++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverters.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.internal.inject; diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/inject/PrimitiveMapper.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/PrimitiveMapper.java index f111798c24..e9c8c0d3e3 100644 --- a/core-common/src/main/java/org/glassfish/jersey/internal/inject/PrimitiveMapper.java +++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/PrimitiveMapper.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.internal.inject; diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/inject/Providers.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/Providers.java index c86d321be5..d3644cbaf0 100644 --- a/core-common/src/main/java/org/glassfish/jersey/internal/inject/Providers.java +++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/Providers.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.internal.inject; diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/MessageBodyFactory.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/MessageBodyFactory.java index 16da0f1e17..0eab49879a 100644 --- a/core-common/src/main/java/org/glassfish/jersey/message/internal/MessageBodyFactory.java +++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/MessageBodyFactory.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.message.internal; diff --git a/core-common/src/main/java/org/glassfish/jersey/model/AnnotatedMethod.java b/core-common/src/main/java/org/glassfish/jersey/model/AnnotatedMethod.java index b038a42180..6be4d7b642 100644 --- a/core-common/src/main/java/org/glassfish/jersey/model/AnnotatedMethod.java +++ b/core-common/src/main/java/org/glassfish/jersey/model/AnnotatedMethod.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.model; diff --git a/core-common/src/main/java/org/glassfish/jersey/model/ParamQualifier.java b/core-common/src/main/java/org/glassfish/jersey/model/ParamQualifier.java index 838e914020..1d495a0d72 100644 --- a/core-common/src/main/java/org/glassfish/jersey/model/ParamQualifier.java +++ b/core-common/src/main/java/org/glassfish/jersey/model/ParamQualifier.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.model; diff --git a/core-common/src/main/java/org/glassfish/jersey/model/Parameter.java b/core-common/src/main/java/org/glassfish/jersey/model/Parameter.java index 3e0780a7ac..e76408e82e 100644 --- a/core-common/src/main/java/org/glassfish/jersey/model/Parameter.java +++ b/core-common/src/main/java/org/glassfish/jersey/model/Parameter.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.model; diff --git a/core-common/src/main/resources/org/glassfish/jersey/internal/localization.properties b/core-common/src/main/resources/org/glassfish/jersey/internal/localization.properties index 2b9fceaafb..56f2b86502 100644 --- a/core-common/src/main/resources/org/glassfish/jersey/internal/localization.properties +++ b/core-common/src/main/resources/org/glassfish/jersey/internal/localization.properties @@ -1,5 +1,6 @@ # # Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. +# (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. # # This program and the accompanying materials are made available under the # terms of the Eclipse Public License v. 2.0, which is available at @@ -13,8 +14,6 @@ # # SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 # -# Portions Copyright [2018] [Payara Foundation and/or its affiliates] -# # {0} - full classname diff --git a/core-common/src/test/java/org/glassfish/jersey/model/ParameterTest.java b/core-common/src/test/java/org/glassfish/jersey/model/ParameterTest.java index 68e804d42b..0a2526486d 100644 --- a/core-common/src/test/java/org/glassfish/jersey/model/ParameterTest.java +++ b/core-common/src/test/java/org/glassfish/jersey/model/ParameterTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.model; diff --git a/core-common/src/test/java/org/glassfish/jersey/model/ParameterWithMultipleAnnotationsTest.java b/core-common/src/test/java/org/glassfish/jersey/model/ParameterWithMultipleAnnotationsTest.java index 911a081589..93794406a3 100644 --- a/core-common/src/test/java/org/glassfish/jersey/model/ParameterWithMultipleAnnotationsTest.java +++ b/core-common/src/test/java/org/glassfish/jersey/model/ParameterWithMultipleAnnotationsTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.model; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ApplicationHandler.java b/core-server/src/main/java/org/glassfish/jersey/server/ApplicationHandler.java index dbeae922d6..f700ceae6d 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/ApplicationHandler.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/ApplicationHandler.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/filter/RolesAllowedDynamicFeature.java b/core-server/src/main/java/org/glassfish/jersey/server/filter/RolesAllowedDynamicFeature.java index c801a09360..9be9aa4eac 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/filter/RolesAllowedDynamicFeature.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/filter/RolesAllowedDynamicFeature.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.filter; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AbstractValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AbstractValueParamProvider.java index d9ededc883..0b48b2ac06 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AbstractValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AbstractValueParamProvider.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AsyncResponseValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AsyncResponseValueParamProvider.java index 76b36cb032..006c78a754 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AsyncResponseValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AsyncResponseValueParamProvider.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/BeanParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/BeanParamValueParamProvider.java index be0ee936ea..28cb3d704d 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/BeanParamValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/BeanParamValueParamProvider.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/CookieParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/CookieParamValueParamProvider.java index 7c32ce53b5..c64c199cf7 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/CookieParamValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/CookieParamValueParamProvider.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/DelegatedInjectionValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/DelegatedInjectionValueParamProvider.java index 06e02388e1..38feba6988 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/DelegatedInjectionValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/DelegatedInjectionValueParamProvider.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/EntityParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/EntityParamValueParamProvider.java index c854f3aad4..6e8e932ac1 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/EntityParamValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/EntityParamValueParamProvider.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/FormParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/FormParamValueParamProvider.java index 9e9ecd6bdf..9a053014ca 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/FormParamValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/FormParamValueParamProvider.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/HeaderParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/HeaderParamValueParamProvider.java index 639239120e..028bc3fb21 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/HeaderParamValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/HeaderParamValueParamProvider.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MatrixParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MatrixParamValueParamProvider.java index cdcd0af999..7bfcb0cb56 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MatrixParamValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MatrixParamValueParamProvider.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorFactory.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorFactory.java index 47259faba6..f436e51c87 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorFactory.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorFactory.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorProvider.java index 4cafe7634b..775694c05a 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorProvider.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamExtractorConfigurator.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamExtractorConfigurator.java index dd0cc2e716..2ff3eb52c8 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamExtractorConfigurator.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamExtractorConfigurator.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamInjectionResolver.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamInjectionResolver.java index e0fcf8a6b2..50f3d6369e 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamInjectionResolver.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamInjectionResolver.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PathParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PathParamValueParamProvider.java index 38644db750..ff1432bb25 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PathParamValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PathParamValueParamProvider.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/QueryParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/QueryParamValueParamProvider.java index 3611482105..197354b7db 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/QueryParamValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/QueryParamValueParamProvider.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ValueParamProviderConfigurator.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ValueParamProviderConfigurator.java index 291c3ca8c7..b8757620ef 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ValueParamProviderConfigurator.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ValueParamProviderConfigurator.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/WebTargetValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/WebTargetValueParamProvider.java index 92762bc0e7..cf80eddb54 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/WebTargetValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/WebTargetValueParamProvider.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MethodSelectingRouter.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MethodSelectingRouter.java index 94d4b3e043..7cea785a44 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MethodSelectingRouter.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MethodSelectingRouter.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.routing; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/HandlerConstructor.java b/core-server/src/main/java/org/glassfish/jersey/server/model/HandlerConstructor.java index 08f9822060..dd77c78905 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/HandlerConstructor.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/HandlerConstructor.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/IntrospectionModeller.java b/core-server/src/main/java/org/glassfish/jersey/server/model/IntrospectionModeller.java index 418b58e829..7d704dab67 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/IntrospectionModeller.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/IntrospectionModeller.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/Invocable.java b/core-server/src/main/java/org/glassfish/jersey/server/model/Invocable.java index 14d2edab9d..60c362ee81 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/Invocable.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/Invocable.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/InvocableValidator.java b/core-server/src/main/java/org/glassfish/jersey/server/model/InvocableValidator.java index 6fd0ed2d18..4bdb0f82a1 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/InvocableValidator.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/InvocableValidator.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/MethodHandler.java b/core-server/src/main/java/org/glassfish/jersey/server/model/MethodHandler.java index d2bfde1491..3f1179a8d9 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/MethodHandler.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/MethodHandler.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/MethodList.java b/core-server/src/main/java/org/glassfish/jersey/server/model/MethodList.java index 647796bce5..d9ee443b1c 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/MethodList.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/MethodList.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/Parameterized.java b/core-server/src/main/java/org/glassfish/jersey/server/model/Parameterized.java index 3b9301fb23..31f7f2d0fd 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/Parameterized.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/Parameterized.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethod.java b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethod.java index 7a75398f43..3c7ed0d710 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethod.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethod.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodValidator.java b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodValidator.java index d84d37228b..e387c0cf31 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodValidator.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodValidator.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/RuntimeResourceModelValidator.java b/core-server/src/main/java/org/glassfish/jersey/server/model/RuntimeResourceModelValidator.java index 72c1763078..8540ffa0e9 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/RuntimeResourceModelValidator.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/RuntimeResourceModelValidator.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParamValueFactoryWithSource.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParamValueFactoryWithSource.java index 89ab3c8ffc..a40f9ede4c 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParamValueFactoryWithSource.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParamValueFactoryWithSource.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.spi.internal; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParameterValueHelper.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParameterValueHelper.java index 9e653330dd..393fbcb1dd 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParameterValueHelper.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParameterValueHelper.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.spi.internal; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ValueParamProvider.java index c1bdd6c958..29d64a953d 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ValueParamProvider.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.spi.internal; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/wadl/WadlGenerator.java b/core-server/src/main/java/org/glassfish/jersey/server/wadl/WadlGenerator.java index e85bcb264c..8f0d3f2a01 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/wadl/WadlGenerator.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/wadl/WadlGenerator.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.wadl; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/WadlBuilder.java b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/WadlBuilder.java index 859a8fc41c..10797b35eb 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/WadlBuilder.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/WadlBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.wadl.internal; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/WadlGeneratorImpl.java b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/WadlGeneratorImpl.java index bc80f4318e..737fa33e9a 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/WadlGeneratorImpl.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/WadlGeneratorImpl.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.wadl.internal; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorApplicationDoc.java b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorApplicationDoc.java index dd1bfe8a9f..de60556a9c 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorApplicationDoc.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorApplicationDoc.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.wadl.internal.generators; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorGrammarsSupport.java b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorGrammarsSupport.java index bc0ccd7566..e0b38a3301 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorGrammarsSupport.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorGrammarsSupport.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.wadl.internal.generators; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorJAXBGrammarGenerator.java b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorJAXBGrammarGenerator.java index 446d49fff3..696331e371 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorJAXBGrammarGenerator.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/WadlGeneratorJAXBGrammarGenerator.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.wadl.internal.generators; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/resourcedoc/ResourceDocAccessor.java b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/resourcedoc/ResourceDocAccessor.java index 2e92ae0e70..b9211d72e3 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/resourcedoc/ResourceDocAccessor.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/resourcedoc/ResourceDocAccessor.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.wadl.internal.generators.resourcedoc; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/resourcedoc/WadlGeneratorResourceDocSupport.java b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/resourcedoc/WadlGeneratorResourceDocSupport.java index f512c4db9c..69f323021d 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/resourcedoc/WadlGeneratorResourceDocSupport.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/generators/resourcedoc/WadlGeneratorResourceDocSupport.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.wadl.internal.generators.resourcedoc; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/TestInjectionManagerFactory.java b/core-server/src/test/java/org/glassfish/jersey/server/TestInjectionManagerFactory.java index 95351332d5..f959393319 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/TestInjectionManagerFactory.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/TestInjectionManagerFactory.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamConverterInternalTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamConverterInternalTest.java index 341259bbd9..7d3514206d 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamConverterInternalTest.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamConverterInternalTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/UriTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/UriTest.java index 9f54270cde..d3ce32e030 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/UriTest.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/UriTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.internal.inject; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/GenericMethodListTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/GenericMethodListTest.java index 3482248c24..5047a760d6 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/model/GenericMethodListTest.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/model/GenericMethodListTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/MethodListTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/MethodListTest.java index afc553a856..2ef41606d1 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/model/MethodListTest.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/model/MethodListTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.model; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/modelapi/annotation/IntrospectionModellerTest.java b/core-server/src/test/java/org/glassfish/jersey/server/modelapi/annotation/IntrospectionModellerTest.java index 4e2d3cd011..0e5184fb93 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/modelapi/annotation/IntrospectionModellerTest.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/modelapi/annotation/IntrospectionModellerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.modelapi.annotation; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorConfigTest.java b/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorConfigTest.java index cf2960df44..f8f7c615a3 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorConfigTest.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorConfigTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] /* * To change this template, choose Tools | Templates diff --git a/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorConfigurationLoaderTest.java b/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorConfigurationLoaderTest.java index d5bbf8606f..eb0d3a1972 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorConfigurationLoaderTest.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorConfigurationLoaderTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.server.wadl.config; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorLoaderTest.java b/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorLoaderTest.java index 6a6b037f4b..cbae4b114a 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorLoaderTest.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/wadl/config/WadlGeneratorLoaderTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] /* * To change this template, choose Tools | Templates diff --git a/examples/managed-client-simple-webapp/src/main/java/org/glassfish/jersey/examples/managedclientsimple/resources/ClientResource.java b/examples/managed-client-simple-webapp/src/main/java/org/glassfish/jersey/examples/managedclientsimple/resources/ClientResource.java index 9600ce3dae..2c32c9daba 100644 --- a/examples/managed-client-simple-webapp/src/main/java/org/glassfish/jersey/examples/managedclientsimple/resources/ClientResource.java +++ b/examples/managed-client-simple-webapp/src/main/java/org/glassfish/jersey/examples/managedclientsimple/resources/ClientResource.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -7,7 +8,6 @@ * * SPDX-License-Identifier: BSD-3-Clause */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.managedclientsimple.resources; diff --git a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java index 6bf546e81a..75db9a2216 100644 --- a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java +++ b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -7,7 +8,6 @@ * * SPDX-License-Identifier: BSD-3-Clause */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.managedclient; diff --git a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java index c496f6da38..b5cfbba4db 100644 --- a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java +++ b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -7,7 +8,6 @@ * * SPDX-License-Identifier: BSD-3-Clause */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.managedclient; diff --git a/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/TracedResource.java b/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/TracedResource.java index 5c197ae921..41decbff48 100644 --- a/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/TracedResource.java +++ b/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/TracedResource.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -7,7 +8,6 @@ * * SPDX-License-Identifier: BSD-3-Clause */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.opentracing; diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/AsyncAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/AsyncAgentResource.java index 128645bb18..d742666571 100644 --- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/AsyncAgentResource.java +++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/AsyncAgentResource.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -7,7 +8,6 @@ * * SPDX-License-Identifier: BSD-3-Clause */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.rx.agent; diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/CompletionStageAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/CompletionStageAgentResource.java index 79f280f26b..2812f7852d 100644 --- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/CompletionStageAgentResource.java +++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/CompletionStageAgentResource.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -7,7 +8,6 @@ * * SPDX-License-Identifier: BSD-3-Clause */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.rx.agent; diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/FlowableAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/FlowableAgentResource.java index a6ca878dc0..ff53569b42 100644 --- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/FlowableAgentResource.java +++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/FlowableAgentResource.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -7,7 +8,6 @@ * * SPDX-License-Identifier: BSD-3-Clause */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.rx.agent; diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ListenableFutureAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ListenableFutureAgentResource.java index 28b48fcd37..bd2775f265 100644 --- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ListenableFutureAgentResource.java +++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ListenableFutureAgentResource.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -7,7 +8,6 @@ * * SPDX-License-Identifier: BSD-3-Clause */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.rx.agent; diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ObservableAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ObservableAgentResource.java index d1d785696a..27c83e1061 100644 --- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ObservableAgentResource.java +++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ObservableAgentResource.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -7,7 +8,6 @@ * * SPDX-License-Identifier: BSD-3-Clause */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.rx.agent; diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/SyncAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/SyncAgentResource.java index 38440a3e3c..9bd8995741 100644 --- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/SyncAgentResource.java +++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/SyncAgentResource.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -7,7 +8,6 @@ * * SPDX-License-Identifier: BSD-3-Clause */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.examples.rx.agent; diff --git a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java index 3575795ee9..356d1ac3c9 100644 --- a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java +++ b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.ext.cdi1x.internal; diff --git a/ext/pom.xml b/ext/pom.xml index a81cbf38d0..c03cb4fbae 100644 --- a/ext/pom.xml +++ b/ext/pom.xml @@ -2,6 +2,7 @@ - 4.0.0 diff --git a/ext/proxy-client/pom.xml b/ext/proxy-client/pom.xml index 7b89f3f6f8..f3a36f39a3 100644 --- a/ext/proxy-client/pom.xml +++ b/ext/proxy-client/pom.xml @@ -2,6 +2,7 @@ - 4.0.0 diff --git a/ext/proxy-client/src/main/java/org/glassfish/jersey/client/proxy/WebResourceFactory.java b/ext/proxy-client/src/main/java/org/glassfish/jersey/client/proxy/WebResourceFactory.java index 0e4ec72406..271e6b60ca 100644 --- a/ext/proxy-client/src/main/java/org/glassfish/jersey/client/proxy/WebResourceFactory.java +++ b/ext/proxy-client/src/main/java/org/glassfish/jersey/client/proxy/WebResourceFactory.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.client.proxy; diff --git a/incubator/declarative-linking/src/main/java/org/glassfish/jersey/linking/InjectLinkFieldDescriptor.java b/incubator/declarative-linking/src/main/java/org/glassfish/jersey/linking/InjectLinkFieldDescriptor.java index 05f273649c..dd4ac745ed 100644 --- a/incubator/declarative-linking/src/main/java/org/glassfish/jersey/linking/InjectLinkFieldDescriptor.java +++ b/incubator/declarative-linking/src/main/java/org/glassfish/jersey/linking/InjectLinkFieldDescriptor.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.linking; diff --git a/incubator/declarative-linking/src/main/java/org/glassfish/jersey/linking/ProvideLinkDescriptor.java b/incubator/declarative-linking/src/main/java/org/glassfish/jersey/linking/ProvideLinkDescriptor.java index c9a871a3d8..eee615f2e1 100644 --- a/incubator/declarative-linking/src/main/java/org/glassfish/jersey/linking/ProvideLinkDescriptor.java +++ b/incubator/declarative-linking/src/main/java/org/glassfish/jersey/linking/ProvideLinkDescriptor.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.linking; diff --git a/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataParam.java b/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataParam.java index 4bd3f71e89..7b442aef3c 100644 --- a/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataParam.java +++ b/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataParam.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.media.multipart; diff --git a/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/internal/FormDataParamValueParamProvider.java b/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/internal/FormDataParamValueParamProvider.java index 3d131544c8..d0949e8261 100644 --- a/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/internal/FormDataParamValueParamProvider.java +++ b/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/internal/FormDataParamValueParamProvider.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.media.multipart.internal; diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseEventSinkValueParamProvider.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseEventSinkValueParamProvider.java index 0e1fe54ac5..4bc988573b 100644 --- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseEventSinkValueParamProvider.java +++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseEventSinkValueParamProvider.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.media.sse.internal; diff --git a/pom.xml b/pom.xml index 15fa6049a8..0292344b32 100644 --- a/pom.xml +++ b/pom.xml @@ -2,6 +2,7 @@ - 4.0.0 diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ClientResponseOnServerTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ClientResponseOnServerTest.java index a2079eda4d..e6dd1615f4 100644 --- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ClientResponseOnServerTest.java +++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ClientResponseOnServerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.tests.e2e.server; diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ManagedClientExecutorTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ManagedClientExecutorTest.java index 7695be4e59..9d028a31bf 100644 --- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ManagedClientExecutorTest.java +++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ManagedClientExecutorTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.tests.e2e.server; diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseE2ETest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseE2ETest.java index 7edc307596..2b383d4515 100644 --- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseE2ETest.java +++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseE2ETest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.tests.api; diff --git a/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyValueParamProvider.java b/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyValueParamProvider.java index 8fba06450d..2414150fe2 100644 --- a/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyValueParamProvider.java +++ b/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyValueParamProvider.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. + * (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +14,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -// Portions Copyright [2018] [Payara Foundation and/or its affiliates] package org.glassfish.jersey.tests.integration.jersey2167; From ad2faa6c89cc6856fb379503c5fabcf05b9acdc7 Mon Sep 17 00:00:00 2001 From: Gaurav Gupta Date: Thu, 12 Jul 2018 15:23:43 +0530 Subject: [PATCH 13/17] org.glassfish.jersey.Uri refactored to org.glassfish.jersey.uri.Uri Signed-off-by: Gaurav Gupta --- .../glassfish/jersey/apache/connector/ManagedClientTest.java | 2 +- .../org/glassfish/jersey/jetty/connector/ManagedClientTest.java | 2 +- .../src/main/java/org/glassfish/jersey/model/Parameter.java | 2 +- .../src/main/java/org/glassfish/jersey/{ => uri}/Uri.java | 2 +- .../server/internal/inject/ValueParamProviderConfigurator.java | 2 +- .../server/internal/inject/WebTargetValueParamProvider.java | 2 +- .../org/glassfish/jersey/server/internal/inject/UriTest.java | 2 +- .../examples/managedclientsimple/resources/ClientResource.java | 2 +- .../glassfish/jersey/examples/managedclient/PublicResource.java | 2 +- .../glassfish/jersey/examples/managedclient/PublicResource.java | 2 +- .../glassfish/jersey/examples/opentracing/TracedResource.java | 2 +- .../glassfish/jersey/examples/rx/agent/AsyncAgentResource.java | 2 +- .../jersey/examples/rx/agent/CompletionStageAgentResource.java | 2 +- .../jersey/examples/rx/agent/FlowableAgentResource.java | 2 +- .../jersey/examples/rx/agent/ListenableFutureAgentResource.java | 2 +- .../jersey/examples/rx/agent/ObservableAgentResource.java | 2 +- .../glassfish/jersey/examples/rx/agent/SyncAgentResource.java | 2 +- .../jersey/tests/e2e/server/ClientResponseOnServerTest.java | 2 +- .../jersey/tests/e2e/server/ManagedClientExecutorTest.java | 2 +- .../java/org/glassfish/jersey/tests/api/ResponseE2ETest.java | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) rename core-common/src/main/java/org/glassfish/jersey/{ => uri}/Uri.java (99%) diff --git a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/ManagedClientTest.java b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/ManagedClientTest.java index 30800ef9e4..cc7b8d256c 100644 --- a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/ManagedClientTest.java +++ b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/ManagedClientTest.java @@ -43,7 +43,7 @@ import org.glassfish.jersey.logging.LoggingFeature; import org.glassfish.jersey.server.ClientBinding; import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; import org.glassfish.jersey.test.JerseyTest; import org.junit.Test; diff --git a/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/ManagedClientTest.java b/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/ManagedClientTest.java index db55a1ca24..a13520bec3 100644 --- a/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/ManagedClientTest.java +++ b/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/ManagedClientTest.java @@ -43,7 +43,7 @@ import org.glassfish.jersey.logging.LoggingFeature; import org.glassfish.jersey.server.ClientBinding; import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; import org.glassfish.jersey.test.JerseyTest; import org.junit.Test; diff --git a/core-common/src/main/java/org/glassfish/jersey/model/Parameter.java b/core-common/src/main/java/org/glassfish/jersey/model/Parameter.java index e76408e82e..cd23f68c74 100644 --- a/core-common/src/main/java/org/glassfish/jersey/model/Parameter.java +++ b/core-common/src/main/java/org/glassfish/jersey/model/Parameter.java @@ -49,7 +49,7 @@ import org.glassfish.jersey.internal.util.ReflectionHelper; import org.glassfish.jersey.internal.util.collection.ClassTypePair; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; /** * Method parameter model. diff --git a/core-common/src/main/java/org/glassfish/jersey/Uri.java b/core-common/src/main/java/org/glassfish/jersey/uri/Uri.java similarity index 99% rename from core-common/src/main/java/org/glassfish/jersey/Uri.java rename to core-common/src/main/java/org/glassfish/jersey/uri/Uri.java index 53a00f410f..a208bcbd10 100644 --- a/core-common/src/main/java/org/glassfish/jersey/Uri.java +++ b/core-common/src/main/java/org/glassfish/jersey/uri/Uri.java @@ -15,7 +15,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey; +package org.glassfish.jersey.uri; import java.lang.annotation.Documented; import java.lang.annotation.Retention; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ValueParamProviderConfigurator.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ValueParamProviderConfigurator.java index b8757620ef..9ec95975c8 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ValueParamProviderConfigurator.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ValueParamProviderConfigurator.java @@ -47,7 +47,7 @@ import org.glassfish.jersey.internal.util.collection.Values; import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.ServerBootstrapBag; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; import org.glassfish.jersey.server.AsyncContext; import org.glassfish.jersey.server.internal.process.RequestProcessingContextReference; import org.glassfish.jersey.server.spi.internal.ValueParamProvider; diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/WebTargetValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/WebTargetValueParamProvider.java index cf80eddb54..0ee449955c 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/WebTargetValueParamProvider.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/WebTargetValueParamProvider.java @@ -46,7 +46,7 @@ import org.glassfish.jersey.server.ClientBinding; import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.ExtendedUriInfo; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; import org.glassfish.jersey.server.internal.LocalizationMessages; import org.glassfish.jersey.model.Parameter; import org.glassfish.jersey.uri.internal.JerseyUriBuilder; diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/UriTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/UriTest.java index d3ce32e030..ca058c0611 100644 --- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/UriTest.java +++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/UriTest.java @@ -31,7 +31,7 @@ import org.glassfish.jersey.server.ContainerResponse; import org.glassfish.jersey.server.RequestContextBuilder; import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; import org.junit.Test; import static org.hamcrest.CoreMatchers.equalTo; diff --git a/examples/managed-client-simple-webapp/src/main/java/org/glassfish/jersey/examples/managedclientsimple/resources/ClientResource.java b/examples/managed-client-simple-webapp/src/main/java/org/glassfish/jersey/examples/managedclientsimple/resources/ClientResource.java index 2c32c9daba..b73b962769 100644 --- a/examples/managed-client-simple-webapp/src/main/java/org/glassfish/jersey/examples/managedclientsimple/resources/ClientResource.java +++ b/examples/managed-client-simple-webapp/src/main/java/org/glassfish/jersey/examples/managedclientsimple/resources/ClientResource.java @@ -20,7 +20,7 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; /** * A resource which use managed client injected by {@link org.glassfish.jersey.server.Uri @Uri annotation} to query diff --git a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java index 75db9a2216..10fcfaefef 100644 --- a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java +++ b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java @@ -18,7 +18,7 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; /** * A resource that uses managed clients to retrieve values of internal diff --git a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java index b5cfbba4db..930fc01c44 100644 --- a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java +++ b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java @@ -18,7 +18,7 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; /** * A resource that uses managed clients to retrieve values of internal diff --git a/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/TracedResource.java b/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/TracedResource.java index 41decbff48..10791e9f1c 100644 --- a/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/TracedResource.java +++ b/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/TracedResource.java @@ -27,7 +27,7 @@ import org.glassfish.jersey.opentracing.OpenTracingFeature; import org.glassfish.jersey.opentracing.OpenTracingUtils; import org.glassfish.jersey.server.ManagedAsync; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; import io.opentracing.Span; diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/AsyncAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/AsyncAgentResource.java index d742666571..a4015823eb 100644 --- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/AsyncAgentResource.java +++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/AsyncAgentResource.java @@ -42,7 +42,7 @@ import org.glassfish.jersey.internal.guava.ThreadFactoryBuilder; import org.glassfish.jersey.process.JerseyProcessingUncaughtExceptionHandler; import org.glassfish.jersey.server.ManagedAsync; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; /** * Obtain information about visited (destination) and recommended (destination, forecast, price) places for "Async" user. Uses diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/CompletionStageAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/CompletionStageAgentResource.java index 2812f7852d..2f164e3069 100644 --- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/CompletionStageAgentResource.java +++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/CompletionStageAgentResource.java @@ -35,7 +35,7 @@ import org.glassfish.jersey.examples.rx.domain.Forecast; import org.glassfish.jersey.examples.rx.domain.Recommendation; import org.glassfish.jersey.internal.guava.ThreadFactoryBuilder; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; /** * Obtain information about visited (destination) and recommended (destination, forecast, price) places for diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/FlowableAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/FlowableAgentResource.java index ff53569b42..a1d5d1d93a 100644 --- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/FlowableAgentResource.java +++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/FlowableAgentResource.java @@ -33,7 +33,7 @@ import org.glassfish.jersey.examples.rx.domain.Destination; import org.glassfish.jersey.examples.rx.domain.Forecast; import org.glassfish.jersey.examples.rx.domain.Recommendation; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; import io.reactivex.Flowable; import io.reactivex.schedulers.Schedulers; diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ListenableFutureAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ListenableFutureAgentResource.java index bd2775f265..33270522c2 100644 --- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ListenableFutureAgentResource.java +++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ListenableFutureAgentResource.java @@ -30,7 +30,7 @@ import org.glassfish.jersey.examples.rx.domain.Forecast; import org.glassfish.jersey.examples.rx.domain.Recommendation; import org.glassfish.jersey.server.ManagedAsync; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; import com.google.common.collect.Lists; import com.google.common.util.concurrent.AsyncFunction; diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ObservableAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ObservableAgentResource.java index 27c83e1061..8120f51c11 100644 --- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ObservableAgentResource.java +++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ObservableAgentResource.java @@ -33,7 +33,7 @@ import org.glassfish.jersey.examples.rx.domain.Destination; import org.glassfish.jersey.examples.rx.domain.Forecast; import org.glassfish.jersey.examples.rx.domain.Recommendation; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; import rx.Observable; import rx.schedulers.Schedulers; diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/SyncAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/SyncAgentResource.java index 9bd8995741..638bb39a01 100644 --- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/SyncAgentResource.java +++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/SyncAgentResource.java @@ -30,7 +30,7 @@ import org.glassfish.jersey.examples.rx.domain.Destination; import org.glassfish.jersey.examples.rx.domain.Forecast; import org.glassfish.jersey.examples.rx.domain.Recommendation; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; /** * Obtain information about visited (destination) and recommended (destination, forecast, price) places for "Sync" user. Uses diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ClientResponseOnServerTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ClientResponseOnServerTest.java index e6dd1615f4..0b31e34659 100644 --- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ClientResponseOnServerTest.java +++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ClientResponseOnServerTest.java @@ -26,7 +26,7 @@ import javax.ws.rs.core.Response; import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; import org.glassfish.jersey.test.JerseyTest; import org.junit.Test; diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ManagedClientExecutorTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ManagedClientExecutorTest.java index 9d028a31bf..9f7aad4098 100644 --- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ManagedClientExecutorTest.java +++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ManagedClientExecutorTest.java @@ -49,7 +49,7 @@ import org.glassfish.jersey.internal.guava.ThreadFactoryBuilder; import org.glassfish.jersey.server.ClientBinding; import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; import org.glassfish.jersey.spi.ScheduledExecutorServiceProvider; import org.glassfish.jersey.test.JerseyTest; import org.glassfish.jersey.test.TestProperties; diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseE2ETest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseE2ETest.java index 2b383d4515..1009139079 100644 --- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseE2ETest.java +++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseE2ETest.java @@ -40,7 +40,7 @@ import javax.ws.rs.ext.RuntimeDelegate; import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.Uri; +import org.glassfish.jersey.uri.Uri; import org.glassfish.jersey.test.JerseyTest; import org.junit.Test; From e89c80a845e409465de37ee50f522b56348fb94f Mon Sep 17 00:00:00 2001 From: Gaurav Gupta Date: Tue, 17 Jul 2018 11:47:28 +0530 Subject: [PATCH 14/17] microprofile-rest-client tck and example added Signed-off-by: Gaurav Gupta --- .../README.MD | 35 +++++ .../pom.xml | 85 +++++++++++ .../jersey/examples/helloworld/jaxrs/App.java | 92 ++++++++++++ .../helloworld/jaxrs/HelloWorldResource.java | 32 ++++ .../helloworld/jaxrs/JaxRsApplication.java | 36 +++++ .../helloworld/jaxrs/HelloWorldClient.java | 38 +++++ .../jaxrs/HelloWorldClientTest.java | 44 ++++++ examples/pom.xml | 1 + tests/microprofile-rest-client-tck/pom.xml | 139 ++++++++++++++++++ tests/pom.xml | 1 + 10 files changed, 503 insertions(+) create mode 100644 examples/helloworld-microprofile-rest-client/README.MD create mode 100644 examples/helloworld-microprofile-rest-client/pom.xml create mode 100644 examples/helloworld-microprofile-rest-client/src/main/java/org/glassfish/jersey/examples/helloworld/jaxrs/App.java create mode 100644 examples/helloworld-microprofile-rest-client/src/main/java/org/glassfish/jersey/examples/helloworld/jaxrs/HelloWorldResource.java create mode 100644 examples/helloworld-microprofile-rest-client/src/main/java/org/glassfish/jersey/examples/helloworld/jaxrs/JaxRsApplication.java create mode 100644 examples/helloworld-microprofile-rest-client/src/test/java/org/glassfish/jersey/examples/helloworld/jaxrs/HelloWorldClient.java create mode 100644 examples/helloworld-microprofile-rest-client/src/test/java/org/glassfish/jersey/examples/helloworld/jaxrs/HelloWorldClientTest.java create mode 100644 tests/microprofile-rest-client-tck/pom.xml diff --git a/examples/helloworld-microprofile-rest-client/README.MD b/examples/helloworld-microprofile-rest-client/README.MD new file mode 100644 index 0000000000..28e62e8676 --- /dev/null +++ b/examples/helloworld-microprofile-rest-client/README.MD @@ -0,0 +1,35 @@ +[//]: # " Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved. " +[//]: # " (Portions) Copyright (c) 2018 Payara Foundation and/or its affiliates. " +[//]: # " " +[//]: # " This program and the accompanying materials are made available under the " +[//]: # " terms of the Eclipse Distribution License v. 1.0, which is available at " +[//]: # " http://www.eclipse.org/org/documents/edl-v10.php. " +[//]: # " " +[//]: # " SPDX-License-Identifier: BSD-3-Clause " + +Hello World Example +=================== + +This example demonstrates Hello World Microprofile Rest Client example. +JAX-RS resource returns the usual text `Hello World!` +and `HelloWorldClient` rest client interface used as a means to invoke the `HelloWorldResource` service. + +Contents +-------- + +The mapping of the URI path space is presented in the following table: + +URI path | Resource class | HTTP methods | Notes +-------------------- | ------------------- | ------------ | -------------------------------------------------------- +**_/helloworld_** | HelloWorldResource | GET | Returns `Hello World!` + +Running the Example +------------------- + +Run the example as follows: + +> mvn clean compile exec:java + +This deploys the example using [Grizzly](http://grizzly.java.net/) container. You can access the application at: + +- diff --git a/examples/helloworld-microprofile-rest-client/pom.xml b/examples/helloworld-microprofile-rest-client/pom.xml new file mode 100644 index 0000000000..f83b459a26 --- /dev/null +++ b/examples/helloworld-microprofile-rest-client/pom.xml @@ -0,0 +1,85 @@ + + + + + 4.0.0 + + + org.glassfish.jersey.examples + project + 2.28-SNAPSHOT + + + helloworld-microprofile-rest-client + jar + jersey-examples-helloworld-microprofile-rest-client + + Example using only the standard JAX-RS API's and the lightweight HTTP server bundled in JDK. + + + + org.glassfish.jersey.containers + jersey-container-jdk-http + + + org.glassfish.jersey.core + jersey-client + + + org.glassfish.jersey.ext + jersey-microprofile-rest-client + + + org.glassfish.jersey.inject + jersey-hk2 + + + junit + junit + test + + + + + + + org.codehaus.mojo + exec-maven-plugin + + org.glassfish.jersey.examples.helloworld.jaxrs.App + + + + + + + + release + + + + org.apache.maven.plugins + maven-assembly-plugin + + + + + + + diff --git a/examples/helloworld-microprofile-rest-client/src/main/java/org/glassfish/jersey/examples/helloworld/jaxrs/App.java b/examples/helloworld-microprofile-rest-client/src/main/java/org/glassfish/jersey/examples/helloworld/jaxrs/App.java new file mode 100644 index 0000000000..3bb193c98e --- /dev/null +++ b/examples/helloworld-microprofile-rest-client/src/main/java/org/glassfish/jersey/examples/helloworld/jaxrs/App.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Distribution License v. 1.0, which is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +package org.glassfish.jersey.examples.helloworld.jaxrs; + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.URI; + +import javax.ws.rs.core.UriBuilder; +import javax.ws.rs.ext.RuntimeDelegate; + +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; + +/** + * Hello world application using only the standard JAX-RS API and lightweight HTTP server bundled in JDK. + * + * @author Martin Matula + */ +public class App { + + /** + * Starts the lightweight HTTP server serving the JAX-RS application. + * + * @return new instance of the lightweight HTTP server + * @throws IOException + */ + static HttpServer startServer() throws IOException { + // create a new server listening at port 8080 + final HttpServer server = HttpServer.create(new InetSocketAddress(getBaseURI().getPort()), 0); + Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { + @Override + public void run() { + server.stop(0); + } + })); + + // create a handler wrapping the JAX-RS application + HttpHandler handler = RuntimeDelegate.getInstance().createEndpoint(new JaxRsApplication(), HttpHandler.class); + + // map JAX-RS handler to the server root + server.createContext(getBaseURI().getPath(), handler); + + // start the server + server.start(); + + return server; + } + + public static void main(String[] args) throws IOException, InterruptedException { + System.out.println("\"Hello World\" Jersey Example Application"); + + startServer(); + + System.out.println("Application started.\n" + + "Try accessing " + getBaseURI() + "helloworld in the browser.\n" + + "Hit enter to stop the application..."); + + Thread.currentThread().join(); + } + + private static int getPort(int defaultPort) { + final String port = System.getProperty("jersey.config.test.container.port"); + if (null != port) { + try { + return Integer.parseInt(port); + } catch (NumberFormatException e) { + System.out.println("Value of jersey.config.test.container.port property" + + " is not a valid positive integer [" + port + "]." + + " Reverting to default [" + defaultPort + "]."); + } + } + return defaultPort; + } + + /** + * Gets base {@link URI}. + * + * @return base {@link URI}. + */ + public static URI getBaseURI() { + return UriBuilder.fromUri("http://localhost/").port(getPort(8080)).build(); + } +} diff --git a/examples/helloworld-microprofile-rest-client/src/main/java/org/glassfish/jersey/examples/helloworld/jaxrs/HelloWorldResource.java b/examples/helloworld-microprofile-rest-client/src/main/java/org/glassfish/jersey/examples/helloworld/jaxrs/HelloWorldResource.java new file mode 100644 index 0000000000..856f233525 --- /dev/null +++ b/examples/helloworld-microprofile-rest-client/src/main/java/org/glassfish/jersey/examples/helloworld/jaxrs/HelloWorldResource.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Distribution License v. 1.0, which is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +package org.glassfish.jersey.examples.helloworld.jaxrs; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +/** + * + * @author Jakub Podlesak (jakub.podlesak at oracle.com) + */ +@Path("helloworld") +public class HelloWorldResource { + public static final String CLICHED_MESSAGE = "Hello World!"; + + @GET + @Produces(MediaType.TEXT_PLAIN) + public String getHello() { + return CLICHED_MESSAGE; + } + +} diff --git a/examples/helloworld-microprofile-rest-client/src/main/java/org/glassfish/jersey/examples/helloworld/jaxrs/JaxRsApplication.java b/examples/helloworld-microprofile-rest-client/src/main/java/org/glassfish/jersey/examples/helloworld/jaxrs/JaxRsApplication.java new file mode 100644 index 0000000000..240ea1c711 --- /dev/null +++ b/examples/helloworld-microprofile-rest-client/src/main/java/org/glassfish/jersey/examples/helloworld/jaxrs/JaxRsApplication.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Distribution License v. 1.0, which is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +package org.glassfish.jersey.examples.helloworld.jaxrs; + +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import javax.ws.rs.core.Application; + +/** + * JAX-RS Application class for this example. + * + * @author Martin Matula + */ +public class JaxRsApplication extends Application { + private final Set> classes; + + public JaxRsApplication() { + HashSet> c = new HashSet>(); + c.add(HelloWorldResource.class); + classes = Collections.unmodifiableSet(c); + } + + @Override + public Set> getClasses() { + return classes; + } +} diff --git a/examples/helloworld-microprofile-rest-client/src/test/java/org/glassfish/jersey/examples/helloworld/jaxrs/HelloWorldClient.java b/examples/helloworld-microprofile-rest-client/src/test/java/org/glassfish/jersey/examples/helloworld/jaxrs/HelloWorldClient.java new file mode 100644 index 0000000000..3942ebb37a --- /dev/null +++ b/examples/helloworld-microprofile-rest-client/src/test/java/org/glassfish/jersey/examples/helloworld/jaxrs/HelloWorldClient.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018 Payara Foundation 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 org.glassfish.jersey.examples.helloworld.jaxrs; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * Client interface represents the HelloWorldResource rest service + * + * @author Gaurav Gupta + */ +@Path("helloworld") +@RegisterRestClient +interface HelloWorldClient { + + @GET + @Produces(MediaType.TEXT_PLAIN) + public String getHello(); + +} diff --git a/examples/helloworld-microprofile-rest-client/src/test/java/org/glassfish/jersey/examples/helloworld/jaxrs/HelloWorldClientTest.java b/examples/helloworld-microprofile-rest-client/src/test/java/org/glassfish/jersey/examples/helloworld/jaxrs/HelloWorldClientTest.java new file mode 100644 index 0000000000..4197c00dff --- /dev/null +++ b/examples/helloworld-microprofile-rest-client/src/test/java/org/glassfish/jersey/examples/helloworld/jaxrs/HelloWorldClientTest.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2018 Payara Foundation 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 org.glassfish.jersey.examples.helloworld.jaxrs; + + +import org.junit.Test; +import static org.junit.Assert.assertEquals; + +import com.sun.net.httpserver.HttpServer; +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +/** + * Simple test to call HelloWorldResource REST API using HelloWorldClient proxy client. + * + * @author Gaurav Gupta + */ +public class HelloWorldClientTest { + + @Test + public void testHelloWorld() throws Exception { + HttpServer server = App.startServer(); + + HelloWorldClient simpleGetApi = RestClientBuilder.newBuilder() + .baseUri(App.getBaseURI()) + .build(HelloWorldClient.class); + + assertEquals(HelloWorldResource.CLICHED_MESSAGE, simpleGetApi.getHello()); + + server.stop(0); + } +} diff --git a/examples/pom.xml b/examples/pom.xml index 2354e7d2b2..d4cd8b464e 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -80,6 +80,7 @@ helloworld-weld helloworld-spring-webapp helloworld-spring-annotations + helloworld-microprofile-rest-client http-patch http-trace https-clientserver-grizzly diff --git a/tests/microprofile-rest-client-tck/pom.xml b/tests/microprofile-rest-client-tck/pom.xml new file mode 100644 index 0000000000..4969ee1255 --- /dev/null +++ b/tests/microprofile-rest-client-tck/pom.xml @@ -0,0 +1,139 @@ + + + + + 4.0.0 + + + org.glassfish.jersey.tests + project + 2.28-SNAPSHOT + + + microprofile-rest-client-tck + jar + microprofile-rest-client-tck + MicroProfile Rest Client TCK + + + + org.glassfish.jersey.core + jersey-client + + + org.glassfish.jersey.ext + jersey-microprofile-rest-client + + + org.eclipse.microprofile.rest.client + microprofile-rest-client-tck + ${microprofile.rest.client.api.version} + test + + + org.jboss.weld.se + weld-se-core + 2.4.7.Final + test + + + org.jboss.arquillian.container + arquillian-weld-embedded + 2.0.0.Final + test + + + io.smallrye + smallrye-config + 1.3.1 + + + org.glassfish + javax.json + test + + + org.glassfish.jersey.media + jersey-media-json-processing + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + 1 + false + false + ${skip.e2e} + + org.eclipse.microprofile.rest.client:microprofile-rest-client-tck + + + **/InvokeWithBuiltProvidersTest.java + **/InvokeWithRegisteredProvidersTest.java + **/CDIInvokeWithRegisteredProvidersTest.java + **/AsyncMethodTest.java + + + + + uk.co.deliverymind + wiremock-maven-plugin + 2.7.0 + + + generate-test-sources + + run + + +

target/classes + --port=8765 --verbose + + + + + + + + + + sonar + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + + + + + + + +
diff --git a/tests/pom.xml b/tests/pom.xml index 9d6e92a49d..4b7b015fbb 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -39,6 +39,7 @@ e2e e2e-client + microprofile-rest-client-tck e2e-core-common e2e-entity e2e-inject From c61169ba9d29d3db66e8ebce931f5d169b2a9cc7 Mon Sep 17 00:00:00 2001 From: Gaurav Gupta Date: Thu, 19 Jul 2018 15:22:53 +0530 Subject: [PATCH 15/17] Portions Copyright update Signed-off-by: Gaurav Gupta --- bom/pom.xml | 2 +- containers/jersey-servlet/pom.xml | 2 +- .../jersey/servlet/init/JerseyServletContainerInitializer.java | 2 +- .../src/main/java/org/glassfish/jersey/client/ClientConfig.java | 2 +- .../main/java/org/glassfish/jersey/client/ClientRuntime.java | 2 +- .../glassfish/jersey/client/JerseyCompletionStageRxInvoker.java | 2 +- .../main/java/org/glassfish/jersey/client/JerseyInvocation.java | 2 +- .../org/glassfish/jersey/client/inject/ParameterInserter.java | 2 +- .../jersey/client/inject/ParameterInserterProvider.java | 2 +- .../client/internal/inject/AbstractParamValueInserter.java | 2 +- .../jersey/client/internal/inject/CollectionInserter.java | 2 +- .../client/internal/inject/ParameterInserterConfigurator.java | 2 +- .../jersey/client/internal/inject/ParameterInserterFactory.java | 2 +- .../client/internal/inject/PrimitiveCharacterInserter.java | 2 +- .../jersey/client/internal/inject/PrimitiveValueOfInserter.java | 2 +- .../client/internal/inject/SingleStringValueInserter.java | 2 +- .../jersey/client/internal/inject/SingleValueInserter.java | 2 +- core-common/pom.xml | 2 +- .../org/glassfish/jersey/internal/inject/InserterException.java | 2 +- .../jersey/internal/inject/ParamConverterConfigurator.java | 2 +- .../glassfish/jersey/internal/inject/ParamConverterFactory.java | 2 +- .../org/glassfish/jersey/internal/inject/ParamConverters.java | 2 +- .../org/glassfish/jersey/internal/inject/PrimitiveMapper.java | 2 +- .../java/org/glassfish/jersey/internal/inject/Providers.java | 2 +- .../glassfish/jersey/message/internal/MessageBodyFactory.java | 2 +- .../main/java/org/glassfish/jersey/model/AnnotatedMethod.java | 2 +- .../main/java/org/glassfish/jersey/model/ParamQualifier.java | 2 +- .../src/main/java/org/glassfish/jersey/model/Parameter.java | 2 +- core-common/src/main/java/org/glassfish/jersey/uri/Uri.java | 2 +- .../org/glassfish/jersey/internal/localization.properties | 2 +- .../src/test/java/org/glassfish/jersey/model/ParameterTest.java | 2 +- .../jersey/model/ParameterWithMultipleAnnotationsTest.java | 2 +- .../java/org/glassfish/jersey/server/ApplicationHandler.java | 2 +- .../jersey/server/filter/RolesAllowedDynamicFeature.java | 2 +- .../server/internal/inject/AbstractValueParamProvider.java | 2 +- .../server/internal/inject/AsyncResponseValueParamProvider.java | 2 +- .../server/internal/inject/BeanParamValueParamProvider.java | 2 +- .../server/internal/inject/CookieParamValueParamProvider.java | 2 +- .../internal/inject/DelegatedInjectionValueParamProvider.java | 2 +- .../server/internal/inject/EntityParamValueParamProvider.java | 2 +- .../server/internal/inject/FormParamValueParamProvider.java | 2 +- .../server/internal/inject/HeaderParamValueParamProvider.java | 2 +- .../server/internal/inject/MatrixParamValueParamProvider.java | 2 +- .../internal/inject/MultivaluedParameterExtractorFactory.java | 2 +- .../internal/inject/MultivaluedParameterExtractorProvider.java | 2 +- .../server/internal/inject/ParamExtractorConfigurator.java | 2 +- .../jersey/server/internal/inject/ParamInjectionResolver.java | 2 +- .../server/internal/inject/PathParamValueParamProvider.java | 2 +- .../server/internal/inject/QueryParamValueParamProvider.java | 2 +- .../server/internal/inject/ValueParamProviderConfigurator.java | 2 +- .../server/internal/inject/WebTargetValueParamProvider.java | 2 +- .../jersey/server/internal/routing/MethodSelectingRouter.java | 2 +- .../org/glassfish/jersey/server/model/HandlerConstructor.java | 2 +- .../glassfish/jersey/server/model/IntrospectionModeller.java | 2 +- .../main/java/org/glassfish/jersey/server/model/Invocable.java | 2 +- .../org/glassfish/jersey/server/model/InvocableValidator.java | 2 +- .../java/org/glassfish/jersey/server/model/MethodHandler.java | 2 +- .../main/java/org/glassfish/jersey/server/model/MethodList.java | 2 +- .../java/org/glassfish/jersey/server/model/Parameterized.java | 2 +- .../java/org/glassfish/jersey/server/model/ResourceMethod.java | 2 +- .../glassfish/jersey/server/model/ResourceMethodValidator.java | 2 +- .../jersey/server/model/RuntimeResourceModelValidator.java | 2 +- .../jersey/server/spi/internal/ParamValueFactoryWithSource.java | 2 +- .../jersey/server/spi/internal/ParameterValueHelper.java | 2 +- .../jersey/server/spi/internal/ValueParamProvider.java | 2 +- .../java/org/glassfish/jersey/server/wadl/WadlGenerator.java | 2 +- .../org/glassfish/jersey/server/wadl/internal/WadlBuilder.java | 2 +- .../jersey/server/wadl/internal/WadlGeneratorImpl.java | 2 +- .../wadl/internal/generators/WadlGeneratorApplicationDoc.java | 2 +- .../wadl/internal/generators/WadlGeneratorGrammarsSupport.java | 2 +- .../internal/generators/WadlGeneratorJAXBGrammarGenerator.java | 2 +- .../internal/generators/resourcedoc/ResourceDocAccessor.java | 2 +- .../generators/resourcedoc/WadlGeneratorResourceDocSupport.java | 2 +- .../glassfish/jersey/server/TestInjectionManagerFactory.java | 2 +- .../server/internal/inject/ParamConverterInternalTest.java | 2 +- .../org/glassfish/jersey/server/internal/inject/UriTest.java | 2 +- .../glassfish/jersey/server/model/GenericMethodListTest.java | 2 +- .../java/org/glassfish/jersey/server/model/MethodListTest.java | 2 +- .../server/modelapi/annotation/IntrospectionModellerTest.java | 2 +- .../jersey/server/wadl/config/WadlGeneratorConfigTest.java | 2 +- .../wadl/config/WadlGeneratorConfigurationLoaderTest.java | 2 +- .../jersey/server/wadl/config/WadlGeneratorLoaderTest.java | 2 +- examples/helloworld-microprofile-rest-client/README.MD | 2 +- .../examples/managedclientsimple/resources/ClientResource.java | 2 +- .../glassfish/jersey/examples/managedclient/PublicResource.java | 2 +- .../glassfish/jersey/examples/managedclient/PublicResource.java | 2 +- .../glassfish/jersey/examples/opentracing/TracedResource.java | 2 +- .../glassfish/jersey/examples/rx/agent/AsyncAgentResource.java | 2 +- .../jersey/examples/rx/agent/CompletionStageAgentResource.java | 2 +- .../jersey/examples/rx/agent/FlowableAgentResource.java | 2 +- .../jersey/examples/rx/agent/ListenableFutureAgentResource.java | 2 +- .../jersey/examples/rx/agent/ObservableAgentResource.java | 2 +- .../glassfish/jersey/examples/rx/agent/SyncAgentResource.java | 2 +- .../jersey/ext/cdi1x/internal/CdiComponentProvider.java | 2 +- ext/pom.xml | 2 +- ext/proxy-client/pom.xml | 2 +- .../org/glassfish/jersey/client/proxy/WebResourceFactory.java | 2 +- .../org/glassfish/jersey/linking/InjectLinkFieldDescriptor.java | 2 +- .../org/glassfish/jersey/linking/ProvideLinkDescriptor.java | 2 +- .../org/glassfish/jersey/media/multipart/FormDataParam.java | 2 +- .../multipart/internal/FormDataParamValueParamProvider.java | 2 +- .../media/sse/internal/SseEventSinkValueParamProvider.java | 2 +- pom.xml | 2 +- .../jersey/tests/e2e/server/ClientResponseOnServerTest.java | 2 +- .../jersey/tests/e2e/server/ManagedClientExecutorTest.java | 2 +- .../java/org/glassfish/jersey/tests/api/ResponseE2ETest.java | 2 +- .../tests/integration/jersey2167/MyValueParamProvider.java | 2 +- 107 files changed, 107 insertions(+), 107 deletions(-) diff --git a/bom/pom.xml b/bom/pom.xml index c0952203d6..1682bcaca4 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -2,7 +2,7 @@