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

org.hidetake.groovy.ssh.session.SessionExtension.groovy Maven / Gradle / Ivy

There is a newer version: 2.11.2
Show newest version
package org.hidetake.groovy.ssh.session

import org.hidetake.groovy.ssh.core.Remote
import org.hidetake.groovy.ssh.core.settings.CompositeSettings
import org.hidetake.groovy.ssh.operation.Operations
import org.hidetake.groovy.ssh.operation.SftpOperations

/**
 * A base trait of session extensions.
 * Session extensions must apply this trait.
 *
 * @author Hidetake Iwata
 */
trait SessionExtension {
    /**
     * Returns remote host for the current session.
     *
     * @return the remote host
     */
    abstract Remote getRemote()

    /**
     * Perform SFTP operations.
     *
     * @param closure closure for {@link org.hidetake.groovy.ssh.operation.SftpOperations}
     * @return result of the closure
     */
    abstract def  T sftp(@DelegatesTo(SftpOperations) Closure closure)

    /**
     * Return the current {@link Operations}.
     * Only for DSL extensions, do not use from the script.
     */
    abstract Operations getOperations()

    /**
     * Return the settings with default, global, per-service and per-remote.
     * Only for DSL extensions, do not use from the script.
     */
    abstract CompositeSettings getMergedSettings()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy