public CompletionStage < Map < String , Result < SSHResult < R > > > > callSyncSSH ( final SaltClient client , SSHTarget < ? > target , SaltSSHConfig cfg , AuthMethod auth ) { Map < String , Object > args = new HashMap <> ( ) ; args . putAll ( getPayload ( ) ) ; args . putAll ( target . getProps ( ) ) ; SaltSSHUtils . mapConfigPropsToArgs ( cfg , args ) ; Type xor = parameterizedType ( null , Result . class , parameterizedType ( null , SSHResult . class , getReturnType ( ) . getType ( ) ) ) ; Type map = parameterizedType ( null , Map . class , String . class , xor ) ; Type listType = parameterizedType ( null , List . class , map ) ; Type wrapperType = parameterizedType ( null , Return . class , listType ) ; return client . call ( this , Client . SSH , Optional . of ( target ) , args , ( TypeToken < Return < List < Map < String , Result < SSHResult < R > > > > > > ) TypeToken . get ( wrapperType ) , auth ) . thenApply ( wrapper -> wrapper . getResult ( ) . get ( 0 ) ) ; }
Call an execution module function on the given target via salt - ssh and synchronously wait for the result .