Net components provides SmartFrog components for FTP, Telnet etc.
How to build
First build the SmartFrog framework by running ant dist in core/smartfrog
Build ant tasks by running ant in core/extras/ant
Build Logger by running ant in core/components/net
Step creates networkComponents.jar file in directory core/components/net/ build/dist/lib
Copy following jar files from core/components/net/ build/dist/lib to core/smartfrog/dist/lib or update class path for the SmartFrog daemon so that net classes are available at run time.
The FTP component is deployed as a SmartFrog component. When deployed it will download or upload the specified files.
|ftpHost||FTP host name||Mandatory|
|username||FTP User Name||Mandatory|
|transferType||Type of file transfer ( possible values "get"/"put")||Optional (Default is "get")|
|transferMode||Mode of file transfer||Optional (Default is "ascii")|
|localFiles||List of local files in the form of a vector. Fully qualified, comma separated file names.||Mandatory|
|remoteFiles||List of remote files corresponding to local files in the form of a vector.||Mandatory|
|passwordProvider||Reference to password provider component. By default FilePasswordProvider is used.||Mandatory|
|shouldTerminate||Boolean attribute enables self termination of the FTP component after it upload/download files.||Optional ( Default is true)|
Please refer to ftpExample.sf for a sample usage of the FTP component.
Telnet component is deployed as a SmartFrog component. When the component is started, it issues the series of telnet commands to the remote host.
|Host||Telnet host name||Mandatory|
|Username||Telnet User Name||Mandatory|
|commands||Comma separated list of command to be executed in telnet session.||Mandatory|
|passwordProvider||Reference to password provider component. By default FilePasswordProvider is used but user can provide their own Password providers such as Database and DirectoryServer password providers by implementing PasswordProvider interface method getPassword().||Mandatory|
|timeout||Time in milli seconds. Beyond this time telnet component stops waiting on telnet input stream for some response.||Optional ( default value is 30000 ms)|
|port||Telnet Port||Optional (default value is 23)|
|shellPrompt||Shell Prompt expected after login in telnet session||Optional (default value is "#")|
|logFile||Log file used to log all activities in a telnet session. This could be useful for debugging.||Optional|
|shouldTerminate||Boolean attribute enables self termination of the Telnet component after executing telnet commands.||Optional ( Default is true)|
Please refer to telnetExample.sf for a sample usage of Telnet component.
Remember that neither telnet or FTP are secure protocols; both send passwords in clear text when a session is made, and neither perform any rigorous verification that the remote server is the one that is normally used.
The FilePasswordProvider uses passwords stored in a text file. This text file should have restricted permissions: only the user that the SmartFrog daemon runs as needs read access. Because the passwords are kept out of the .sf files, these file do not need to be kept secret, and can be stored in public locations.