Compare commits

...

8 Commits

4 changed files with 14 additions and 14 deletions

View File

@@ -6,7 +6,7 @@
<groupId>com.inteligr8</groupId>
<artifactId>common-rest-client</artifactId>
<version>3.0.2-jersey</version>
<version>3.0.3-jersey</version>
<packaging>jar</packaging>
<name>ReST API Client for Java</name>

View File

@@ -30,7 +30,7 @@ import jakarta.ws.rs.client.ClientRequestContext;
*/
public class HeaderAuthorizationFilter implements AuthorizationFilter {
private final MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
private final MultiValueMap<String, Object> headers = new LinkedMultiValueMap<>();
/**
* This constructor instantiates the filter with required fields.
@@ -38,7 +38,7 @@ public class HeaderAuthorizationFilter implements AuthorizationFilter {
* @param headerName A header name.
* @param headerValue A header value.
*/
public HeaderAuthorizationFilter(String headerName, String headerValue) {
public HeaderAuthorizationFilter(String headerName, Object headerValue) {
this.headers.add(headerName, headerValue);
}
@@ -49,7 +49,7 @@ public class HeaderAuthorizationFilter implements AuthorizationFilter {
* @param headerValue A header value.
* @return This class for fluent chaining.
*/
public HeaderAuthorizationFilter add(String headerName, String headerValue) {
public HeaderAuthorizationFilter add(String headerName, Object headerValue) {
this.headers.add(headerName, headerValue);
return this;
}
@@ -61,8 +61,8 @@ public class HeaderAuthorizationFilter implements AuthorizationFilter {
*/
@Override
public void filter(ClientRequestContext requestContext) throws UnsupportedEncodingException {
for (Entry<String, List<String>> header : this.headers.entrySet())
requestContext.getHeaders().addAll(header.getKey(), header.getValue());
for (Entry<String, List<Object>> header : this.headers.entrySet())
requestContext.getHeaders().put(header.getKey(), header.getValue());
}
}

View File

@@ -16,7 +16,7 @@ package com.inteligr8.rs;
/**
* This interface defines additional configurations specific to the Jersey
* JAX-RS library and its nuances.
* Jakarta RS library and its nuances.
*
* @author brian@inteligr8.com
*/

View File

@@ -47,17 +47,17 @@ public class ClientJerseyImpl extends Client {
/**
* This method registers the Jersey library as the default provider for the
* JAX-RS specification.
* Jakarta RS specification.
*/
@PostConstruct
public void register() {
if (RuntimeDelegate.getInstance() == null) {
this.logger.info("Setting JAX-RS runtime delegate to the Jersey library");
this.logger.info("Setting Jakarta RS runtime delegate to the Jersey library");
RuntimeDelegate.setInstance(new RuntimeDelegateImpl());
} else if (RuntimeDelegate.getInstance() instanceof RuntimeDelegateImpl) {
this.logger.info("JAX-RS runtime delegate already the Jersey library");
this.logger.info("Jakarta RS runtime delegate already the Jersey library");
} else {
this.logger.warn("Setting JAX-RS runtime delegate to the Jersey library; was: " + RuntimeDelegate.getInstance().getClass().getName());
this.logger.warn("Setting Jakarta RS runtime delegate to the Jersey library; was: " + RuntimeDelegate.getInstance().getClass().getName());
RuntimeDelegate.setInstance(new RuntimeDelegateImpl());
}
@@ -86,11 +86,11 @@ public class ClientJerseyImpl extends Client {
}
/**
* This method retrieves a JAX-RS implementation of the specified API with
* the specified authorization.
* This method retrieves a Jakarta RS implementation of the specified API
* with the specified authorization.
*
* @param authFilter A dynamic authorization filter.
* @param apiClass A JAX-RS annotation API class.
* @param apiClass A Jakarta RS annotation API class.
* @return An instance of the API class.
*/
@Override