diff --git a/src/main/java/sh/libre/scim/core/Adapter.java b/src/main/java/sh/libre/scim/core/Adapter.java index 01c2ab9cf1..e9762122c1 100644 --- a/src/main/java/sh/libre/scim/core/Adapter.java +++ b/src/main/java/sh/libre/scim/core/Adapter.java @@ -57,7 +57,7 @@ public abstract class Adapter } } - public String getSCIMEndpoint() { + public String getScimEndpoint() { return "/" + type + "s"; } @@ -117,7 +117,7 @@ public abstract class Adapter public abstract Class getResourceClass(); - public abstract S toSCIM(); + public abstract S toScim(); public abstract Boolean entityExists(); diff --git a/src/main/java/sh/libre/scim/core/GroupAdapter.java b/src/main/java/sh/libre/scim/core/GroupAdapter.java index 6da5c078c7..ef6609e663 100644 --- a/src/main/java/sh/libre/scim/core/GroupAdapter.java +++ b/src/main/java/sh/libre/scim/core/GroupAdapter.java @@ -75,7 +75,7 @@ public class GroupAdapter extends Adapter { } @Override - public Group toSCIM() { + public Group toScim() { Group group = new Group(); group.setId(externalId); group.setExternalId(id); diff --git a/src/main/java/sh/libre/scim/core/ScimClient.java b/src/main/java/sh/libre/scim/core/ScimClient.java index bb3655a228..33b98c4928 100644 --- a/src/main/java/sh/libre/scim/core/ScimClient.java +++ b/src/main/java/sh/libre/scim/core/ScimClient.java @@ -91,7 +91,7 @@ public class ScimClient { return new ScimClient(scimRequestBuilder, retryRegistry, session, model); } - protected EntityManager getEM() { + protected EntityManager getEntityManager() { return session.getProvider(JpaConnectionProvider.class).getEntityManager(); } @@ -124,8 +124,8 @@ public class ScimClient { ServerResponse response = retry.executeSupplier(() -> { try { return scimRequestBuilder - .create(adapter.getResourceClass(), adapter.getSCIMEndpoint()) - .setResource(adapter.toSCIM()) + .create(adapter.getResourceClass(), adapter.getScimEndpoint()) + .setResource(adapter.toScim()) .sendRequest(); } catch (ResponseException e) { throw new RuntimeException(e); @@ -154,8 +154,8 @@ public class ScimClient { ServerResponse response = retry.executeSupplier(() -> { try { return scimRequestBuilder - .update(adapter.getResourceClass(), adapter.getSCIMEndpoint(), adapter.getExternalId()) - .setResource(adapter.toSCIM()) + .update(adapter.getResourceClass(), adapter.getScimEndpoint(), adapter.getExternalId()) + .setResource(adapter.toScim()) .sendRequest(); } catch (ResponseException e) { throw new RuntimeException(e); @@ -185,7 +185,7 @@ public class ScimClient { ServerResponse response = retry.executeSupplier(() -> { try { - return scimRequestBuilder.delete(adapter.getResourceClass(), adapter.getSCIMEndpoint(), adapter.getExternalId()) + return scimRequestBuilder.delete(adapter.getResourceClass(), adapter.getScimEndpoint(), adapter.getExternalId()) .sendRequest(); } catch (ResponseException e) { throw new RuntimeException(e); @@ -197,7 +197,7 @@ public class ScimClient { LOGGER.warn(response.getHttpStatus()); } - getEM().remove(resource); + getEntityManager().remove(resource); } catch (NoResultException e) { LOGGER.warnf("Failed to delete resource %s, scim mapping not found", id); @@ -232,7 +232,7 @@ public class ScimClient { LOGGER.info("Import"); try { A adapter = getAdapter(aClass); - ServerResponse> response = scimRequestBuilder.list(adapter.getResourceClass(), adapter.getSCIMEndpoint()).get().sendRequest(); + ServerResponse> response = scimRequestBuilder.list(adapter.getResourceClass(), adapter.getScimEndpoint()).get().sendRequest(); ListResponse resourceTypeListResponse = response.getResource(); for (S resource : resourceTypeListResponse.getListedResources()) { @@ -272,7 +272,7 @@ public class ScimClient { case "DELETE_REMOTE": LOGGER.info("Delete remote resource"); scimRequestBuilder - .delete(adapter.getResourceClass(), adapter.getSCIMEndpoint(), resource.getId().get()) + .delete(adapter.getResourceClass(), adapter.getScimEndpoint(), resource.getId().get()) .sendRequest(); syncRes.increaseRemoved(); break; diff --git a/src/main/java/sh/libre/scim/core/UserAdapter.java b/src/main/java/sh/libre/scim/core/UserAdapter.java index 3546751bcb..d4bd9ac6c9 100644 --- a/src/main/java/sh/libre/scim/core/UserAdapter.java +++ b/src/main/java/sh/libre/scim/core/UserAdapter.java @@ -145,7 +145,7 @@ public class UserAdapter extends Adapter { } @Override - public User toSCIM() { + public User toScim() { User user = new User(); user.setExternalId(id); user.setUserName(username);