Class RunnerCall<R>

  • Type Parameters:
    R - the return type of the called function
    All Implemented Interfaces:
    Call<R>

    public class RunnerCall<R>
    extends AbstractCall<R>
    Class representing a function call of a salt runner module.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Optional<java.util.Map<java.lang.String,​?>> kwargs  
    • Constructor Summary

      Constructors 
      Constructor Description
      RunnerCall​(java.lang.String functionName, java.util.Optional<java.util.Map<java.lang.String,​?>> kwargs, com.google.gson.reflect.TypeToken<R> returnType)  
    • Field Detail

      • kwargs

        private final java.util.Optional<java.util.Map<java.lang.String,​?>> kwargs
    • Constructor Detail

      • RunnerCall

        public RunnerCall​(java.lang.String functionName,
                          java.util.Optional<java.util.Map<java.lang.String,​?>> kwargs,
                          com.google.gson.reflect.TypeToken<R> returnType)
    • Method Detail

      • getPayload

        public java.util.Map<java.lang.String,​java.lang.Object> getPayload()
        Return the call payload as a map of key/value pairs. Usually this contains the function name and arguments, but the various clients differ in the details.
        Returns:
        call payload as a map of key/value pairs
      • callAsync

        public java.util.concurrent.CompletionStage<RunnerAsyncResult<R>> callAsync​(SaltClient client,
                                                                                    AuthMethod auth)
        Calls a runner module function on the master asynchronously and returns information about the scheduled job that can be used to query the result. Authentication is done with the token therefore you have to login prior to using this function.
        Parameters:
        client - SaltClient instance
        auth - authentication credentials to use
        Returns:
        information about the scheduled job
      • callSync

        public java.util.concurrent.CompletionStage<Result<R>> callSync​(SaltClient client,
                                                                        AuthMethod auth)
        Calls a runner module function on the master and synchronously waits for the result. Authentication is done with the given credentials no session token is created.
        Parameters:
        client - SaltClient instance
        auth - authentication credentials to use
        Returns:
        the result of the called function