Package com.evolveum.midpoint.task.api
Interface ClusterExecutionHelper
-
public interface ClusterExecutionHelperHelps 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 interfaceClusterExecutionHelper.ClientCode
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidexecute(@NotNull ClusterExecutionHelper.ClientCode code, ClusterExecutionOptions options, String context, OperationResult parentResult)Executes operation on all cluster nodes except for the current one.OperationResultexecute(@NotNull NodeType node, @NotNull ClusterExecutionHelper.ClientCode code, ClusterExecutionOptions options, String context, OperationResult parentResult)Executes operation on a specified remote node (by node object).voidexecute(@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> TextractResult(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, ObjectNotFoundExceptionExecutes 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 SchemaExceptionExtracts the result from the REST response.- Throws:
SchemaException
-
-