i-net Clear Reports

com.inet.report.schedule
Class FtpAction

java.lang.Object
  extended by com.inet.report.schedule.ScheduleAction
      extended by com.inet.report.schedule.FileAction
          extended by com.inet.report.schedule.FtpAction

public class FtpAction
extends FileAction

The FtpAction is an enhancement of the FileAction which allows the generated reports to be stored on a FTP server instead of saving them to a local path of the server.
The FtpAction will therefore connect to a given server using the set port (by default port 21). After this a log-in will be made with the set user name and password and the directory on the ftp server will be changed to the set path. Then all files of the generated reports will be uploaded to the FTP server.

Since:
i-net Crystal-Clear 7.0

Field Summary
 
Fields inherited from class com.inet.report.schedule.ScheduleAction
TYPE_CACHE, TYPE_CUSTOM, TYPE_EMAIL, TYPE_FILE, TYPE_FTP, TYPE_PRINT
 
Constructor Summary
FtpAction()
          Creates an instance of FtpAction.
 
Method Summary
 void action(ExecutedTask task)
          This will render all report of the given task and save them to the ftp server directory configured.
 java.lang.String[] getErrorMessages()
          Returns an array of error messages if available or an empty array if this FtpAction is valid.
 java.lang.String getPassword()
          Returns the password which will be used to connect to the FTP server.
 int getPort()
          Returns the port on which the FTP server is listening for FTP request.
 java.lang.String getServer()
          Returns the name of the FTP server on which the reports should be stored.
 java.lang.String getUserName()
          Returns the user name which will be used to connect to the FTP server.
 void setPassword(java.lang.String password)
          Sets the password which will be used to connect to the FTP server.
 void setPort(int newPort)
          Sets the port on which the FTP server is listening for FTP requests.
 void setServer(java.lang.String server)
          Sets the name of the FTP server on which the reports should be stored.
 void setUserName(java.lang.String userName)
          Sets the user name which should be used to connect to the FTP server.
 java.lang.String toString()
          Returns a string representation of this FtpAction.
 
Methods inherited from class com.inet.report.schedule.FileAction
getDateFormat, getPath, isAppendDate, isAppendTime, setAppendDate, setAppendTime, setDateFormat, setPath
 
Methods inherited from class com.inet.report.schedule.ScheduleAction
getType, isValid
 

Constructor Detail

FtpAction

public FtpAction()
Creates an instance of FtpAction.

Method Detail

action

public void action(ExecutedTask task)
This will render all report of the given task and save them to the ftp server directory configured. If no export format has been set for a report this will be changed to pdf.

Overrides:
action in class FileAction
Parameters:
task - The executed task including all reports which can be executed.

getPassword

public java.lang.String getPassword()
Returns the password which will be used to connect to the FTP server.

Returns:
The currently set password.
See Also:
setPassword(String)

setPassword

public void setPassword(java.lang.String password)
Sets the password which will be used to connect to the FTP server.

Parameters:
password - The new password to be set.
See Also:
getPassword()

getServer

public java.lang.String getServer()
Returns the name of the FTP server on which the reports should be stored.

Returns:
The name of the FTP server.
See Also:
setServer(String)

setServer

public void setServer(java.lang.String server)
Sets the name of the FTP server on which the reports should be stored. The name has the following format: ftp.company.com or it can also be the IP address e.g. 192.122.200.1

Parameters:
server - The name of the FTP server which should be used.

getUserName

public java.lang.String getUserName()
Returns the user name which will be used to connect to the FTP server. If no authentication (anonymous login) is required null or an empty name can be returned.

Returns:
The user nam which will be uses to connect to the FTP server.

setUserName

public void setUserName(java.lang.String userName)
Sets the user name which should be used to connect to the FTP server. If no authentication is needed it can be null or empty.

Parameters:
userName - The user name to be used to connect to the FTP server.

setPort

public void setPort(int newPort)
Sets the port on which the FTP server is listening for FTP requests. Usually this value should be 21. (This is also the default value).

Parameters:
newPort - The port which should be used.

getPort

public int getPort()
Returns the port on which the FTP server is listening for FTP request. If no special port has been set this will return the default value 21.

Returns:
The port which will be used.

getErrorMessages

public java.lang.String[] getErrorMessages()
Returns an array of error messages if available or an empty array if this FtpAction is valid.
The reasons for an invalid FtpAction can be:

Overrides:
getErrorMessages in class FileAction
Returns:
A string array containing error messages.
See Also:
ScheduleAction.isValid()

toString

public java.lang.String toString()
Returns a string representation of this FtpAction. The string returned will contain the value of the properties server, port and userName and any error message of ScheduleAction.getErrorMessages() if available.

Overrides:
toString in class FileAction
Returns:
A string representation of this FtpAction.

i-net Clear Reports

Copyright © 1999-2011 by i-net software GmbH