Class FtpResultActionBuilder


  • public class FtpResultActionBuilder
    extends java.lang.Object
    Use this to easily create definitions for a FtpResultAction. This action saves the results in a directory on the FTP Server.

    Example usage:

     TaskDefinition task = new TaskDefinition( "mytask" );
     //Save generated files to a FTP server
     ResultActionDefinition definition = new FtpResultActionBuilder().setServerURL( "127.0.0.1" ).setServerPort( 21 ).setUserLogin( "user", "pwd" ).withDateAppending( true ).create();
     task.addResulAction( definition );
     
     // .. add jobs and triggers ...
     
     TaskPlanner.getInstance().addTask( task );
     
     
    Since:
    taskplanner 3.0
    • Constructor Detail

      • FtpResultActionBuilder

        public FtpResultActionBuilder()
    • Method Detail

      • createFTPConnection

        public static FtpResultActionBuilder createFTPConnection()
        Creating a new FTP connection.
        Returns:
        the ftp connection builder
        Since:
        taskplanner 3.0
      • setServerURL

        public FtpResultActionBuilder setServerURL​(java.lang.String serverURL)
        Sets the URL to connect to the FTP server.
        Parameters:
        serverURL - the server URL
        Returns:
        the ftp connection builder
        Since:
        taskplanner 3.0
      • setUserLogin

        public FtpResultActionBuilder setUserLogin​(java.lang.String username,
                                                   java.lang.String password)
        Sets the username and password to authenticate an user for the FTP server.
        Parameters:
        username - the username to login
        password - the password to login
        Returns:
        the ftp connection builder
        Since:
        taskplanner 3.0
      • setAnonymousLogin

        public FtpResultActionBuilder setAnonymousLogin()
        Sets the login for an anonymous user. The user is "anonymous" and the password is empty.
        Returns:
        the ftp connection builder
        Since:
        taskplanner 3.0
      • setServerPath

        public FtpResultActionBuilder setServerPath​(java.lang.String serverPath)
        Sets the path on the FTP server where to save the file. If the path not exists, it will be created if the user has the permission to do this.
        Parameters:
        serverPath - the server path to save the file
        Returns:
        the ftp connection builder
        Since:
        taskplanner 3.0
      • setServerPort

        public FtpResultActionBuilder setServerPort​(int serverPort)
        Sets the connection port to the FTP server.
        Parameters:
        serverPort - the FTP server port
        Returns:
        the ftp connection builder
        Since:
        taskplanner 3.0
      • setServerProtocol

        public FtpResultActionBuilder setServerProtocol​(java.lang.String securityType)
        Sets the type of security for server connetion. It can be FTPS, FTPES, SFTP.
        Parameters:
        securityType - the types connection security
        Returns:
        the ftp connection builder
        Since:
        taskplanner 3.0
      • setFileNameFormat

        public FtpResultActionBuilder setFileNameFormat​(java.lang.String fileNameFormat)
        Defines the format of the file name. Allows the usage of the placeholders [filename] [date] and [time]
        Parameters:
        fileNameFormat - the format of the resulting file name
        Returns:
        the ftp connection builder
        Since:
        taskplanner 3.0
      • create

        public com.inet.taskplanner.server.api.action.ResultActionDefinition create()
        Creates the resulting ResultActionDefinition
        Returns:
        the result action definition
        Since:
        taskplanner 3.0