Package com.evolveum.midpoint.task.api
Interface ClusterExecutionHelper
-
public interface ClusterExecutionHelper
Helps with the intra-cluster remote code execution. 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 Modifier and Type Interface Description static interface
ClusterExecutionHelper.ClientCode
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
execute(@NotNull ClusterExecutionHelper.ClientCode code, ClusterExecutionOptions options, String context, OperationResult parentResult)
Executes operation on all cluster nodes except for the current one.OperationResult
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).PrismObject<NodeType>
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(javax.ws.rs.core.Response response, Class<T> expectedClass)
Extracts the result from the REST response.
-
-
-
Method Detail
-
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(javax.ws.rs.core.Response response, Class<T> expectedClass) throws SchemaException
Extracts the result from the REST response.- Throws:
SchemaException
-
-