Class SendRemoteCommand

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ErrorHandler, InputConsumer, RemoteCommandProcessorHandler, Serializable, Comparable

    public class SendRemoteCommand
    extends AbstractSink
    implements RemoteCommandProcessorHandler
    Sends a command to the remote host defined by the connection settings.
    Unsuccessful commands can be store on disk to retry later.

    Input/output:
    - accepts:
       adams.scripting.command.RemoteCommand


    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: SendRemoteCommand
     
    -annotation <adams.core.base.BaseAnnotation> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow gets stopped in case this actor encounters an error;
         useful for critical actors.
        default: false
     
    -silent <boolean> (property: silent)
        If enabled, then no errors are output in the console; Note: the enclosing 
        actor handler must have this enabled as well.
        default: false
     
    -connection <adams.scripting.connection.Connection> (property: connection)
        The connection to send the command to.
        default: adams.scripting.connection.DefaultConnection
     
    -store-unsuccessful <boolean> (property: storeUnsuccessful)
        If enabled, unsuccessful remote commands get stored in the specified directory.
        default: false
     
    -unsuccessful-dir <adams.core.io.PlaceholderDirectory> (property: unsuccessfulDir)
        The directory to store the unsuccessful commands in (if enabled).
        default: ${CWD}
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Connection

        protected Connection m_Connection
        the connection.
      • m_StoreUnsuccessful

        protected boolean m_StoreUnsuccessful
        whether to save unsuccessful remote commands to disk.
      • m_UnsuccessfulDir

        protected PlaceholderDirectory m_UnsuccessfulDir
        the directory for the unsuccessful remote commands.
    • Constructor Detail

      • SendRemoteCommand

        public SendRemoteCommand()
    • Method Detail

      • setConnection

        public void setConnection​(Connection value)
        Sets the connection to send the command to.
        Parameters:
        value - the connection
      • getConnection

        public Connection getConnection()
        Returns the connection to send the command to.
        Returns:
        the connection
      • connectionTipText

        public String connectionTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the gui
      • commandProcessorTipText

        public String commandProcessorTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the gui
      • setStoreUnsuccessful

        public void setStoreUnsuccessful​(boolean value)
        Sets whether to store unsuccessful commands on disk.
        Parameters:
        value - true if to store unsuccessful commands
      • getStoreUnsuccessful

        public boolean getStoreUnsuccessful()
        Returns whether to store unsuccessful commands on disk.
        Returns:
        true if to store unsuccessful commands
      • storeUnsuccessfulTipText

        public String storeUnsuccessfulTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setUnsuccessfulDir

        public void setUnsuccessfulDir​(PlaceholderDirectory value)
        Sets the directory to store the unsuccessful commands ins.
        Parameters:
        value - the directory
      • getUnsuccessfulDir

        public PlaceholderDirectory getUnsuccessfulDir()
        Returns the directory to store the unsuccessful commands in.
        Returns:
        the directory
      • unsuccessfulDirTipText

        public String unsuccessfulDirTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • accepts

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Specified by:
        accepts in interface InputConsumer
        Returns:
        adams.scripting.command.RemoteCommand.class
      • doExecute

        protected String doExecute()
        Executes the flow item.
        Specified by:
        doExecute in class AbstractActor
        Returns:
        null if everything is fine, otherwise error message
      • wrapUp

        public void wrapUp()
        Cleans up after the execution has finished.
        Specified by:
        wrapUp in interface Actor
        Overrides:
        wrapUp in class AbstractSink