Class FtpQueue


  • public class FtpQueue
    extends Object
    The FtpQueue class allows administrators to create FTP queues.

    A FTP queue is special destinations allowing to transfer file by FTP. It wraps the FTP transfer of a file through a message exchange. The sender starts the transfer by sending a JMS message, and the receiver is notified of the transfer completion by a JMS message.

    • Field Detail

      • DefaultFTPImpl

        public static final String DefaultFTPImpl
        Class name of default handler allowing to transfer file through FTP.
        See Also:
        Constant Field Values
      • JFTPImpl

        public static final String JFTPImpl
        Class name of handler allowing to transfer file using JFTP.
        See Also:
        Constant Field Values
    • Constructor Detail

      • FtpQueue

        public FtpQueue()
    • Method Detail

      • create

        public static Queue create​(String name)
                            throws ConnectException,
                                   AdminException
        Administration method creating and deploying a FTP queue on the local server.

        The request fails if the destination deployment fails server side.

        Be careful this method use the static AdminModule connection.

        Parameters:
        name - The name of the created queue.
        Returns:
        the created destination.
        Throws:
        ConnectException - If the administration connection is closed or broken.
        AdminException - If the request fails.
        See Also:
        create(int, String)
      • create

        public static Queue create​(int serverId,
                                   String name)
                            throws ConnectException,
                                   AdminException
        Administration method creating and deploying a FTP queue on a given server.

        The request fails if the target server does not belong to the platform, or if the destination deployment fails server side.

        Be careful this method use the static AdminModule connection.

        Parameters:
        serverId - The identifier of the server where deploying the queue.
        name - The name of the created queue.
        Returns:
        the created destination.
        Throws:
        ConnectException - If the administration connection is closed or broken.
        AdminException - If the request fails.
      • create

        public static Queue create​(int serverId,
                                   String name,
                                   Properties props)
                            throws ConnectException,
                                   AdminException
        Administration method creating and deploying a FTP queue on a given server.

        A set of properties is used to configure the FTP destination:

        • user - the user name for the FTP.
        • pass - the user password for FTP.
        • path - the local directory to store the file transferred. Default is the running directory (path=null).
        • ftpImplName: The implementation of the FTP transfer, we provide two implementations:
          • the default one based on JDK URL:
            com.scalagent.joram.mom.dest.ftp.TransferImplRef
          • the second is based on JFTP:
            com.scalagent.joram.mom.dest.ftp.TransferImplJftp.
        The user and pass options are optional, because this information can be set through an URL by the sender as a message property like this:
        msg.setStringProperty("url", "ftp://user:pass@host/file;type=i");

        The request fails if the target server does not belong to the platform, or if the destination deployment fails server side.

        Be careful this method use the static AdminModule connection.

        Parameters:
        serverId - The identifier of the server where deploying the queue.
        name - The name of the created queue.
        props - A Properties object containing all needed parameters.
        Returns:
        the created destination.
        Throws:
        ConnectException - If the administration connection is closed or broken.
        AdminException - If the request fails.