-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Steffen Nießing <[email protected]>
- Loading branch information
Showing
157 changed files
with
5,995 additions
and
545 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
...onnector/src/main/java11/org/glassfish/jersey/jetty/connector/JettyConnectorProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
* Copyright (c) 2013, 2023 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
package org.glassfish.jersey.jetty.connector; | ||
|
||
import jakarta.ws.rs.ProcessingException; | ||
import jakarta.ws.rs.client.Client; | ||
import jakarta.ws.rs.core.Configuration; | ||
import org.glassfish.jersey.client.spi.Connector; | ||
import org.glassfish.jersey.client.spi.ConnectorProvider; | ||
|
||
/** | ||
* A {@link ConnectorProvider} for Jersey {@link Connector connector} | ||
* instances that utilize the Jetty HTTP Client to send and receive | ||
* HTTP request and responses. | ||
* <p> | ||
* The following connector configuration properties are supported: | ||
* <ul> | ||
* <li>{@link org.glassfish.jersey.client.ClientProperties#ASYNC_THREADPOOL_SIZE}</li> | ||
* <li>{@link org.glassfish.jersey.client.ClientProperties#CONNECT_TIMEOUT}</li> | ||
* <li>{@link org.glassfish.jersey.client.ClientProperties#FOLLOW_REDIRECTS}</li> | ||
* <li>{@link org.glassfish.jersey.client.ClientProperties#PROXY_URI}</li> | ||
* <li>{@link org.glassfish.jersey.client.ClientProperties#PROXY_USERNAME}</li> | ||
* <li>{@link org.glassfish.jersey.client.ClientProperties#PROXY_PASSWORD}</li> | ||
* <li>{@link org.glassfish.jersey.client.ClientProperties#PROXY_PASSWORD}</li> | ||
* <li>{@link JettyClientProperties#DISABLE_COOKIES}</li>* | ||
* <li>{@link JettyClientProperties#ENABLE_SSL_HOSTNAME_VERIFICATION}</li> | ||
* <li>{@link JettyClientProperties#PREEMPTIVE_BASIC_AUTHENTICATION}</li> | ||
* <li>{@link JettyClientProperties#SYNC_LISTENER_RESPONSE_MAX_SIZE}</li> | ||
* </ul> | ||
* </p> | ||
* <p> | ||
* This transport supports both synchronous and asynchronous processing of client requests. | ||
* The following methods are supported: GET, POST, PUT, DELETE, HEAD, OPTIONS, TRACE, CONNECT and MOVE. | ||
* </p> | ||
* <p> | ||
* Typical usage: | ||
* </p> | ||
* <pre> | ||
* {@code | ||
* ClientConfig config = new ClientConfig(); | ||
* config.connectorProvider(new JettyConnectorProvider()); | ||
* Client client = ClientBuilder.newClient(config); | ||
* | ||
* // async request | ||
* WebTarget target = client.target("http://localhost:8080"); | ||
* Future<Response> future = target.path("resource").request().async().get(); | ||
* | ||
* // wait for 3 seconds | ||
* Response response = future.get(3, TimeUnit.SECONDS); | ||
* String entity = response.readEntity(String.class); | ||
* client.close(); | ||
* } | ||
* </pre> | ||
* <p> | ||
* Connector instances created via Jetty HTTP Client-based connector provider support only | ||
* {@link org.glassfish.jersey.client.RequestEntityProcessing#BUFFERED entity buffering}. | ||
* Defining the property {@link org.glassfish.jersey.client.ClientProperties#REQUEST_ENTITY_PROCESSING} has no | ||
* effect on Jetty HTTP Client-based connectors. | ||
* </p> | ||
* | ||
* @author Arul Dhesiaseelan (aruld at acm.org) | ||
* @author Marek Potociar | ||
* @since 2.5 | ||
*/ | ||
public class JettyConnectorProvider implements ConnectorProvider { | ||
|
||
@Override | ||
public Connector getConnector(Client client, Configuration runtimeConfig) { | ||
throw new ProcessingException(LocalizationMessages.NOT_SUPPORTED()); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...ty/connector/JettyHttpClientContract.java → ...ty/connector/JettyHttpClientContract.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ty/connector/JettyHttpClientSupplier.java → ...ty/connector/JettyHttpClientSupplier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.