FileTransferProgress.java 2.08 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
/**
 * $RCSfile$
 * $Revision: 1217 $
 * $Date: 2005-04-11 18:11:06 -0300 (Mon, 11 Apr 2005) $
 *
 * Copyright (C) 1999-2006 Jive Software. All rights reserved.
 *
 * This software is published under the terms of the GNU Public License (GPL),
 * a copy of which is included in this distribution.
 */
package org.jivesoftware.wildfire.filetransfer;

13
import java.util.concurrent.Future;
Alex Wenckus's avatar
Alex Wenckus committed
14 15
import java.io.InputStream;
import java.io.OutputStream;
16

17 18 19
/**
 * An interface to track the progress of a file transfer through the server. This interface is used
 * by {@link FileTransfer} to make this information available if it is in the system.
20 21
 *
 * @author Alexander Wenckus
22 23 24 25
 */
public interface FileTransferProgress {
    public long getAmountTransfered() throws UnsupportedOperationException;

26 27 28 29 30
    /**
     * Returns the fully qualified JID of the initiator of the file transfer.
     *
     * @return the fully qualified JID of the initiator of the file transfer.
     */
31 32
    public String getInitiator();

33 34 35 36 37 38 39
    public void setInitiator(String initiator);

    /**
     * Returns the full qualified JID of the target of the file transfer.
     *
     * @return the fully qualified JID of the target
     */
40 41
    public String getTarget();

42 43 44 45 46 47 48
    public void setTarget(String target);

    /**
     * Returns the unique session id that correlates to the file transfer.
     *
     * @return Returns the unique session id that correlates to the file transfer.
     */
49
    public String getSessionID();
50 51 52 53 54 55 56 57 58 59 60

    public void setSessionID(String streamID);

    /**
     * When the file transfer is being caried out by another thread this will set the Future
     * relating to the thread that is carrying out the transfer.
     *
     * @param future the furute that is carrying out the transfer
     */
    public void setTransferFuture(Future<?> future);

Alex Wenckus's avatar
Alex Wenckus committed
61
    public void setInputStream(InputStream initiatorInputStream);
62

Alex Wenckus's avatar
Alex Wenckus committed
63
    public InputStream getInputStream();
64

Alex Wenckus's avatar
Alex Wenckus committed
65
    public void setOutputStream(OutputStream targetOutputStream);
66

Alex Wenckus's avatar
Alex Wenckus committed
67
    public OutputStream getOutputStream();
68
}