Package com.evolveum.midpoint.task.api
Interface ClusterExecutionHelper
public interface ClusterExecutionHelper
Generally, execute(..) methods prepare a configured WebClient (URL, authentication, ...) and execute
specified client code on it. The client code is responsible for setting the correct path (e.g. "/scheduler/information"),
executing specified operation (e.g. GET) and interpreting the result. See callers of these methods for sample usage.
Other helper methods will probably appear here as well.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
execute
(@NotNull ClusterExecutionHelper.ClientCode code, ClusterExecutionOptions options, String context, OperationResult parentResult) Executes operation on all cluster nodes except for the current one.execute
(@NotNull NodeType node, @NotNull ClusterExecutionHelper.ClientCode code, ClusterExecutionOptions options, String context, OperationResult parentResult) Executes operation on a specified remote node (by node object).void
execute
(@NotNull String nodeOid, @NotNull ClusterExecutionHelper.ClientCode code, ClusterExecutionOptions options, String context, OperationResult parentResult) Executes operation on a specified remote node (by OID).executeWithFallback
(@Nullable String nodeOid, @NotNull ClusterExecutionHelper.ClientCode code, ClusterExecutionOptions options, String context, OperationResult parentResult) Executes operation on a specified remote node (by OID).<T> T
extractResult
(jakarta.ws.rs.core.Response response, Class<T> expectedClass) Extracts the result from the REST response.
-
Method Details
-
execute
void execute(@NotNull @NotNull String nodeOid, @NotNull @NotNull ClusterExecutionHelper.ClientCode code, ClusterExecutionOptions options, String context, OperationResult parentResult) throws SchemaException, ObjectNotFoundException Executes operation on a specified remote node (by OID). -
executeWithFallback
PrismObject<NodeType> executeWithFallback(@Nullable @Nullable String nodeOid, @NotNull @NotNull ClusterExecutionHelper.ClientCode code, ClusterExecutionOptions options, String context, OperationResult parentResult) Executes operation on a specified remote node (by OID). If the operation does not succeed it tries to execute it on other nodes (NOT on the current node).- Returns:
- The node that was ultimately successful in executing the code (or null if none).
-
execute
OperationResult execute(@NotNull @NotNull NodeType node, @NotNull @NotNull ClusterExecutionHelper.ClientCode code, ClusterExecutionOptions options, String context, OperationResult parentResult) throws SchemaException Executes operation on a specified remote node (by node object).- Returns:
- OperationResult of the execution itself
- Throws:
SchemaException
-
execute
void execute(@NotNull @NotNull ClusterExecutionHelper.ClientCode code, ClusterExecutionOptions options, String context, OperationResult parentResult) Executes operation on all cluster nodes except for the current one. -
extractResult
<T> T extractResult(jakarta.ws.rs.core.Response response, Class<T> expectedClass) throws SchemaException Extracts the result from the REST response.- Throws:
SchemaException
-