-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide a basic implementation of a client connector using java.net.http.HttpClient Signed-off-by: Steffen Nießing <[email protected]>
- Loading branch information
Showing
15 changed files
with
916 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2021 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 | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>project</artifactId> | ||
<groupId>org.glassfish.jersey.connectors</groupId> | ||
<version>3.1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>jersey-java-connector</artifactId> | ||
<packaging>jar</packaging> | ||
<name>jersey-connectors-java</name> | ||
|
||
<description>Jersey Client Transport via Java's HttpClient</description> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.glassfish.jersey.test-framework.providers</groupId> | ||
<artifactId>jersey-test-framework-provider-bundle</artifactId> | ||
<version>${project.version}</version> | ||
<type>pom</type> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.awaitility</groupId> | ||
<artifactId>awaitility</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.sun.istack</groupId> | ||
<artifactId>istack-commons-maven-plugin</artifactId> | ||
<inherited>true</inherited> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>build-helper-maven-plugin</artifactId> | ||
<inherited>true</inherited> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
51 changes: 51 additions & 0 deletions
51
...ava-connector/src/main/java/org/glassfish/jersey/java/connector/JavaClientProperties.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,51 @@ | ||
/* | ||
* Copyright (c) 2021 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.java.connector; | ||
|
||
import org.glassfish.jersey.internal.util.PropertiesClass; | ||
|
||
import java.net.http.HttpClient; | ||
|
||
/** | ||
* Provides configuration properties for a {@link JavaConnector}. | ||
* | ||
* @author Steffen Nießing | ||
*/ | ||
@PropertiesClass | ||
public class JavaClientProperties { | ||
/** | ||
* Configuration of the {@link java.net.CookieHandler} that should be used by the {@link HttpClient}. | ||
* If this option is not set, {@link HttpClient#cookieHandler()} will return an empty {@link java.util.Optional} | ||
* and therefore no cookie handler will be used. | ||
* | ||
* A provided value to this option has to be of type {@link java.net.CookieHandler}. | ||
*/ | ||
public static final String COOKIE_HANDLER = "jersey.config.java.client.cookieHandler"; | ||
|
||
/** | ||
* Configuration of SSL parameters used by the {@link HttpClient}. | ||
* If this option is not set, then the {@link HttpClient} will use <it>implementation specific</it> default values. | ||
* | ||
* A provided value to this option has to be of type {@link javax.net.ssl.SSLParameters}. | ||
*/ | ||
public static final String SSL_PARAMETERS = "jersey.config.java.client.sslParameters"; | ||
|
||
/** | ||
* Prevent this class from instantiation. | ||
*/ | ||
private JavaClientProperties() {} | ||
} |
Oops, something went wrong.