From 7e942107c8dea05caa3901589c18c85a5affb6ef Mon Sep 17 00:00:00 2001 From: hauntingEcho Date: Thu, 11 Oct 2018 13:37:36 -0500 Subject: [PATCH] expand buildRequest and toScimException access from package-only to protected, remove final modifier from builders. This allows easier wrapping for interaction with not-quite-compliant scim2 implementations --- .../scim2/client/requests/CreateRequestBuilder.java | 2 +- .../scim2/client/requests/DeleteRequestBuilder.java | 2 +- .../scim2/client/requests/ModifyRequestBuilder.java | 2 +- .../scim2/client/requests/ReplaceRequestBuilder.java | 4 ++-- .../com/unboundid/scim2/client/requests/RequestBuilder.java | 6 +++--- .../client/requests/ResourceReturningRequestBuilder.java | 2 +- .../scim2/client/requests/RetrieveRequestBuilder.java | 2 +- .../scim2/client/requests/SearchRequestBuilder.java | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/CreateRequestBuilder.java b/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/CreateRequestBuilder.java index 23239c91..2e0b654f 100644 --- a/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/CreateRequestBuilder.java +++ b/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/CreateRequestBuilder.java @@ -27,7 +27,7 @@ /** * A builder for SCIM create requests. */ -public final class CreateRequestBuilder +public class CreateRequestBuilder extends ResourceReturningRequestBuilder> { private final T resource; diff --git a/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/DeleteRequestBuilder.java b/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/DeleteRequestBuilder.java index 083b9029..8b959dda 100644 --- a/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/DeleteRequestBuilder.java +++ b/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/DeleteRequestBuilder.java @@ -58,7 +58,7 @@ public DeleteRequestBuilder ifMatch(final String version) * {@inheritDoc} */ @Override - Invocation.Builder buildRequest() + protected Invocation.Builder buildRequest() { Invocation.Builder request = super.buildRequest(); if(version != null) diff --git a/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/ModifyRequestBuilder.java b/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/ModifyRequestBuilder.java index 75d18fa6..2d2bed3b 100644 --- a/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/ModifyRequestBuilder.java +++ b/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/ModifyRequestBuilder.java @@ -66,7 +66,7 @@ private ModifyRequestBuilder(final WebTarget target) * {@inheritDoc} */ @Override - Invocation.Builder buildRequest() + protected Invocation.Builder buildRequest() { Invocation.Builder request = super.buildRequest(); if(version != null) diff --git a/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/ReplaceRequestBuilder.java b/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/ReplaceRequestBuilder.java index ce0ed7cb..d830f6c4 100644 --- a/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/ReplaceRequestBuilder.java +++ b/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/ReplaceRequestBuilder.java @@ -29,7 +29,7 @@ /** * A builder for SCIM replace requests. */ -public final class ReplaceRequestBuilder +public class ReplaceRequestBuilder extends ResourceReturningRequestBuilder> { private final T resource; @@ -63,7 +63,7 @@ public ReplaceRequestBuilder ifMatch() * {@inheritDoc} */ @Override - Invocation.Builder buildRequest() + protected Invocation.Builder buildRequest() { Invocation.Builder request = super.buildRequest(); if(version != null) diff --git a/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/RequestBuilder.java b/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/RequestBuilder.java index fcf34524..9fcdfd04 100644 --- a/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/RequestBuilder.java +++ b/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/RequestBuilder.java @@ -167,7 +167,7 @@ static String getResourceVersion(final ScimResource resource) * @param response The JAX-RS response. * @return the converted ScimException. */ - static ScimException toScimException(final Response response) + protected static ScimException toScimException(final Response response) { try { @@ -203,7 +203,7 @@ protected WebTarget target() * * @return The WebTarget for the request. */ - WebTarget buildTarget() + protected WebTarget buildTarget() { for(Map.Entry> queryParam : queryParams.entrySet()) { @@ -237,7 +237,7 @@ protected List getAccept() * * @return The Invocation.Builder for the request. */ - Invocation.Builder buildRequest() + protected Invocation.Builder buildRequest() { Invocation.Builder builder = buildTarget().request(accept.toArray(new String[accept.size()])); diff --git a/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/ResourceReturningRequestBuilder.java b/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/ResourceReturningRequestBuilder.java index 9173d663..d2bab10d 100644 --- a/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/ResourceReturningRequestBuilder.java +++ b/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/ResourceReturningRequestBuilder.java @@ -54,7 +54,7 @@ public abstract class ResourceReturningRequestBuilder * * @return The WebTarget for the request. */ - WebTarget buildTarget() + protected WebTarget buildTarget() { if(attributes != null && attributes.size() > 0) { diff --git a/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/RetrieveRequestBuilder.java b/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/RetrieveRequestBuilder.java index a353ede1..6b321c7e 100644 --- a/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/RetrieveRequestBuilder.java +++ b/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/RetrieveRequestBuilder.java @@ -51,7 +51,7 @@ private RetrieveRequestBuilder(final WebTarget target) * {@inheritDoc} */ @Override - Invocation.Builder buildRequest() + protected Invocation.Builder buildRequest() { Invocation.Builder request = super.buildRequest(); if(version != null) diff --git a/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/SearchRequestBuilder.java b/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/SearchRequestBuilder.java index 436b0447..eb47872d 100644 --- a/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/SearchRequestBuilder.java +++ b/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/SearchRequestBuilder.java @@ -53,7 +53,7 @@ /** * A builder for SCIM search requests. */ -public final class SearchRequestBuilder +public class SearchRequestBuilder extends ResourceReturningRequestBuilder { private String filter; @@ -119,7 +119,7 @@ public SearchRequestBuilder page(final int startIndex, * {@inheritDoc} */ @Override - WebTarget buildTarget() + protected WebTarget buildTarget() { WebTarget target = super.buildTarget(); if(filter != null)