Package transfer.download

Source Code of transfer.download.FileDownloadConnector

package transfer.download;


import java.io.IOException;

import transfer.download.logic.DownloadAttempter;

import common.connection.AbstractCommunicationSet;
import common.connection.AbstractConnection;
import common.connection.AbstractConnector;

import connection.peer.AbstractConnectorToPeer;
import connection.peer.GenericPeerConnection;
import connection.peer.secure.ClientSideSecurableConnection;
import connection.peer.secure.ConnectionSecurerInterface;


public class FileDownloadConnector extends AbstractConnectorToPeer implements
    ConnectionSecurerInterface
{
  private FileDownload download;
  private DownloadAttempter attempter;

  public FileDownloadConnector(FileDownload download, DownloadAttempter attempter)
  {
    this.download = download;
    this.attempter = attempter;
  }

  protected AbstractConnection createConnectionObject() throws IOException
  {
    return new ClientSideSecurableConnection(this);
  }

  public AbstractConnector getConnector()
  {
    return this;
  }

  public GenericPeerConnection createConnection(AbstractCommunicationSet source)
      throws IOException
  {
    FileDownloadConnection connection = new FileDownloadConnection(source, download,
        attempter);
    return connection;
  }

  public void notifyFailedNegotiation()
  {
    attempter.notifyFailure();
  }

}
TOP

Related Classes of transfer.download.FileDownloadConnector

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.