Remove pointless exception encapsulation
This commit is contained in:
parent
c793c138a3
commit
3009edf101
1 changed files with 14 additions and 28 deletions
|
@ -70,16 +70,11 @@ public class ScimClient<S extends ResourceNode> implements AutoCloseable {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Retry retry = retryRegistry.retry("create-%s".formatted(id.asString()));
|
Retry retry = retryRegistry.retry("create-%s".formatted(id.asString()));
|
||||||
ServerResponse<S> response = retry.executeSupplier(() -> {
|
ServerResponse<S> response = retry.executeSupplier(() -> scimRequestBuilder
|
||||||
try {
|
.create(getResourceClass(), getScimEndpoint())
|
||||||
return scimRequestBuilder
|
.setResource(scimForCreation)
|
||||||
.create(getResourceClass(), getScimEndpoint())
|
.sendRequest()
|
||||||
.setResource(scimForCreation)
|
);
|
||||||
.sendRequest();
|
|
||||||
} catch (ResponseException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
checkResponseIsSuccess(response);
|
checkResponseIsSuccess(response);
|
||||||
S resource = response.getResource();
|
S resource = response.getResource();
|
||||||
return resource.getId()
|
return resource.getId()
|
||||||
|
@ -104,29 +99,20 @@ public class ScimClient<S extends ResourceNode> implements AutoCloseable {
|
||||||
|
|
||||||
public void replace(EntityOnRemoteScimId externalId, ResourceNode scimForReplace) {
|
public void replace(EntityOnRemoteScimId externalId, ResourceNode scimForReplace) {
|
||||||
Retry retry = retryRegistry.retry("replace-%s".formatted(externalId.asString()));
|
Retry retry = retryRegistry.retry("replace-%s".formatted(externalId.asString()));
|
||||||
ServerResponse<S> response = retry.executeSupplier(() -> {
|
ServerResponse<S> response = retry.executeSupplier(() -> scimRequestBuilder
|
||||||
try {
|
.update(getResourceClass(), getScimEndpoint(), externalId.asString())
|
||||||
return scimRequestBuilder
|
.setResource(scimForReplace)
|
||||||
.update(getResourceClass(), getScimEndpoint(), externalId.asString())
|
.sendRequest()
|
||||||
.setResource(scimForReplace)
|
);
|
||||||
.sendRequest();
|
|
||||||
} catch (ResponseException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
checkResponseIsSuccess(response);
|
checkResponseIsSuccess(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void delete(EntityOnRemoteScimId externalId) {
|
public void delete(EntityOnRemoteScimId externalId) {
|
||||||
Retry retry = retryRegistry.retry("delete-%s".formatted(externalId.asString()));
|
Retry retry = retryRegistry.retry("delete-%s".formatted(externalId.asString()));
|
||||||
ServerResponse<S> response = retry.executeSupplier(() -> {
|
ServerResponse<S> response = retry.executeSupplier(() -> scimRequestBuilder
|
||||||
try {
|
.delete(getResourceClass(), getScimEndpoint(), externalId.asString())
|
||||||
return scimRequestBuilder.delete(getResourceClass(), getScimEndpoint(), externalId.asString())
|
.sendRequest()
|
||||||
.sendRequest();
|
);
|
||||||
} catch (ResponseException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
checkResponseIsSuccess(response);
|
checkResponseIsSuccess(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue