Class BaseSshTask<T extends BaseSshTask<T,​E>,​E extends BaseSshTaskProperties>

  • Direct Known Subclasses:
    ScpTask, SshTask

    public abstract class BaseSshTask<T extends BaseSshTask<T,​E>,​E extends BaseSshTaskProperties>
    extends com.atlassian.bamboo.specs.api.builders.task.Task<T,​E>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected BaseSshTaskProperties.AuthenticationType authenticationType  
      protected @Nullable java.lang.String hostFingerprint  
      protected java.util.List<java.lang.String> hosts  
      protected @Nullable java.lang.String key  
      protected @Nullable java.lang.String passphrase  
      protected @Nullable java.lang.String password  
      protected int port  
      protected @Nullable com.atlassian.bamboo.specs.api.model.credentials.SharedCredentialsIdentifierProperties sharedCredentials  
      protected java.lang.String username  
      • Fields inherited from class com.atlassian.bamboo.specs.api.builders.task.Task

        conditions, description, requirements, taskEnabled
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseSshTask()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T authenticateWithKey​(@NotNull java.lang.String key)
      Authenticate with key (without passphrase).
      T authenticateWithKey​(@NotNull java.nio.file.Path keyPath)
      Authenticate with key (without passphrase).
      T authenticateWithKeyWithPassphrase​(@NotNull java.lang.String key, @NotNull java.lang.String passphrase)
      Authenticate with key with passphrase.
      T authenticateWithKeyWithPassphrase​(@NotNull java.nio.file.Path keyPath, @NotNull java.lang.String passphrase)
      Authenticate with key with passphrase.
      T authenticateWithPassword​(@NotNull java.lang.String password)
      Authenticate with password associated with username username(String).
      T authenticateWithSshSharedCredentials​(@NotNull com.atlassian.bamboo.specs.api.builders.credentials.SharedCredentialsIdentifier sharedCredentials)  
      T authenticateWithUsernamePasswordSharedCredentials​(@NotNull com.atlassian.bamboo.specs.api.builders.credentials.SharedCredentialsIdentifier sharedCredentials)  
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      T host​(@NotNull java.lang.String host)
      Hostname or IP address of the remote host.
      T host​(@NotNull java.lang.String... host)
      Hostnames or IP addresses of the remote hosts.
      T hostFingerprint​(@NotNull java.lang.String hostFingerprint)
      Set public key fingerprint.
      T port​(int port)
      Set the port number of the remote host that is used for the SSH connection.
      T portDefault()
      Set the port number of the remote host to the default value (22).
      T username​(@NotNull java.lang.String username)
      Username you want to use to access the remote host.
      • Methods inherited from class com.atlassian.bamboo.specs.api.builders.task.Task

        build, conditions, description, enabled, requirements, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • hosts

        protected java.util.List<java.lang.String> hosts
      • username

        protected java.lang.String username
      • password

        @Nullable
        protected @Nullable java.lang.String password
      • key

        @Nullable
        protected @Nullable java.lang.String key
      • passphrase

        @Nullable
        protected @Nullable java.lang.String passphrase
      • hostFingerprint

        @Nullable
        protected @Nullable java.lang.String hostFingerprint
      • port

        protected int port
      • sharedCredentials

        @Nullable
        protected @Nullable com.atlassian.bamboo.specs.api.model.credentials.SharedCredentialsIdentifierProperties sharedCredentials
    • Constructor Detail

      • BaseSshTask

        public BaseSshTask()
    • Method Detail

      • host

        public T host​(@NotNull
                      @NotNull java.lang.String host)
        Hostname or IP address of the remote host.
      • host

        public T host​(@NotNull
                      @NotNull java.lang.String... host)
        Hostnames or IP addresses of the remote hosts.
      • username

        public T username​(@NotNull
                          @NotNull java.lang.String username)
        Username you want to use to access the remote host.
      • authenticateWithPassword

        public T authenticateWithPassword​(@NotNull
                                          @NotNull java.lang.String password)
        Authenticate with password associated with username username(String).
      • authenticateWithKeyWithPassphrase

        public T authenticateWithKeyWithPassphrase​(@NotNull
                                                   @NotNull java.lang.String key,
                                                   @NotNull
                                                   @NotNull java.lang.String passphrase)
        Authenticate with key with passphrase.
        Parameters:
        key - - SSH private key
        passphrase - - SSH passphrase
      • authenticateWithKeyWithPassphrase

        public T authenticateWithKeyWithPassphrase​(@NotNull
                                                   @NotNull java.nio.file.Path keyPath,
                                                   @NotNull
                                                   @NotNull java.lang.String passphrase)
        Authenticate with key with passphrase.
        Parameters:
        keyPath - - path to SSH private key
        passphrase - - SSH passphrase
      • authenticateWithKey

        public T authenticateWithKey​(@NotNull
                                     @NotNull java.lang.String key)
        Authenticate with key (without passphrase).
        Parameters:
        key - - SSH private key
      • authenticateWithKey

        public T authenticateWithKey​(@NotNull
                                     @NotNull java.nio.file.Path keyPath)
        Authenticate with key (without passphrase).
        Parameters:
        keyPath - - path to SSH private key
      • authenticateWithSshSharedCredentials

        public T authenticateWithSshSharedCredentials​(@NotNull
                                                      @NotNull com.atlassian.bamboo.specs.api.builders.credentials.SharedCredentialsIdentifier sharedCredentials)
      • authenticateWithUsernamePasswordSharedCredentials

        public T authenticateWithUsernamePasswordSharedCredentials​(@NotNull
                                                                   @NotNull com.atlassian.bamboo.specs.api.builders.credentials.SharedCredentialsIdentifier sharedCredentials)
      • hostFingerprint

        public T hostFingerprint​(@NotNull
                                 @NotNull java.lang.String hostFingerprint)
        Set public key fingerprint.
      • port

        public T port​(int port)
        Set the port number of the remote host that is used for the SSH connection. The default value is 22.
        See Also:
        portDefault()
      • portDefault

        public T portDefault()
        Set the port number of the remote host to the default value (22).
        See Also:
        portDefault()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class com.atlassian.bamboo.specs.api.builders.task.Task<T extends BaseSshTask<T,​E>,​E extends BaseSshTaskProperties>
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class com.atlassian.bamboo.specs.api.builders.task.Task<T extends BaseSshTask<T,​E>,​E extends BaseSshTaskProperties>