Skip to content

Commit

Permalink
Issue #4881 - Java client connector
Browse files Browse the repository at this point in the history
Provide a basic implementation of a client connector using java.net.http.HttpClient

Signed-off-by: Steffen Nießing <[email protected]>
  • Loading branch information
zUniQueX committed Dec 16, 2021
1 parent b7a3946 commit 2295cce
Show file tree
Hide file tree
Showing 15 changed files with 916 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@
<artifactId>jersey-grizzly-connector</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.connectors</groupId>
<artifactId>jersey-java-connector</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.connectors</groupId>
<artifactId>jersey-jetty-connector</artifactId>
Expand Down
79 changes: 79 additions & 0 deletions connectors/java-connector/pom.xml
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>
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() {}
}
Loading

0 comments on commit 2295cce

Please sign in to comment.