All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.client.rest.RestTaskClient Maven / Gradle / Ivy

There is a newer version: 14.0.33.Final
Show newest version
package org.infinispan.client.rest;

import java.util.Collections;
import java.util.Map;
import java.util.concurrent.CompletionStage;

/**
 * @author Tristan Tarrant <[email protected]>
 * @since 10.1
 **/
public interface RestTaskClient {

   /**
    * Task type filter definition.
    */
   enum ResultType {
      /**
       * User created tasks
       */
      USER,
      /**
       * All tasks, including admin tasks, that contains name starting with '@@'
       */
      ALL
   }

   /**
    * Retrieves a list of tasks from the server
    * @param resultType the type of task to return
    */
   CompletionStage list(ResultType resultType);

   /**
    * Executes a task with the supplied parameters. Currently only supports String values
    */
   CompletionStage exec(String taskName, String cacheName, Map parameters);

   /**
    * Uploads a script
    */
   CompletionStage uploadScript(String taskName, RestEntity script);

   /**
    * Downloads a script
    */
   CompletionStage downloadScript(String taskName);

   /**
    * Executes a task without parameters
    */
   default CompletionStage exec(String taskName) {
      return exec(taskName, null, Collections.emptyMap());
   }

   default CompletionStage exec(String taskName, Map parameters) {
      return exec(taskName, null, parameters);
   }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy