001    /*
002     * ftp4j - A pure Java FTP client library
003     * 
004     * Copyright (C) 2008 Carlo Pelliccia (www.sauronsoftware.it)
005     * 
006     * This program is free software: you can redistribute it and/or modify
007     * it under the terms of the GNU General Public License as published by
008     * the Free Software Foundation, either version 3 of the License, or
009     * (at your option) any later version.
010     *
011     * This program is distributed in the hope that it will be useful,
012     * but WITHOUT ANY WARRANTY; without even the implied warranty of
013     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014     * GNU General Public License for more details.
015     *
016     * You should have received a copy of the GNU General Public License
017     * along with this program.  If not, see <http://www.gnu.org/licenses/>.
018     */
019    package it.sauronsoftware.ftp4j;
020    
021    import java.io.IOException;
022    
023    /**
024     * This interface describes a connector. Connectors are used by the client to
025     * establish connections with remote servers.
026     * 
027     * @author Carlo Pelliccia
028     */
029    public interface FTPConnector {
030    
031            /**
032             * This methods returns an established connection to a remote host, suitable
033             * for a FTP communication channel.
034             * 
035             * @param host
036             *            The remote host name or address.
037             * @param port
038             *            The remote port.
039             * @return The connection with the remote host.
040             * @throws IOException
041             *             If the connection cannot be established.
042             */
043            public FTPConnection connectForCommunicationChannel(String host, int port)
044                            throws IOException;
045    
046            /**
047             * This methods returns an established connection to a remote host, suitable
048             * for a FTP data transfer channel.
049             * 
050             * @param host
051             *            The remote host name or address.
052             * @param port
053             *            The remote port.
054             * @return The connection with the remote host.
055             * @throws IOException
056             *             If the connection cannot be established.
057             */
058            public FTPConnection connectForDataTransferChannel(String host, int port)
059                            throws IOException;
060    
061    }