FileTransferProgress.java 2.7 KB
Newer Older
1 2 3 4 5
/**
 * $RCSfile$
 * $Revision: 1217 $
 * $Date: 2005-04-11 18:11:06 -0300 (Mon, 11 Apr 2005) $
 *
6
 * Copyright (C) 1999-2008 Jive Software. All rights reserved.
7
 *
8 9 10 11 12 13 14 15 16 17 18
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
19
 */
20
package org.jivesoftware.openfire.filetransfer;
21

22
import java.util.concurrent.Future;
Alex Wenckus's avatar
Alex Wenckus committed
23 24
import java.io.InputStream;
import java.io.OutputStream;
25

26 27 28
/**
 * 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.
29 30
 *
 * @author Alexander Wenckus
31 32
 */
public interface FileTransferProgress {
33 34 35 36 37 38 39 40

    /**
     * Returns the number of bytes that has been transferred.
     *
     * @return the number of bytes that has been transferred.
     * @throws UnsupportedOperationException
     */
    public long getAmountTransferred() throws UnsupportedOperationException;
41

42 43 44 45 46
    /**
     * Returns the fully qualified JID of the initiator of the file transfer.
     *
     * @return the fully qualified JID of the initiator of the file transfer.
     */
47 48
    public String getInitiator();

49 50 51 52 53 54 55
    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
     */
56 57
    public String getTarget();

58 59 60 61 62 63 64
    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.
     */
65
    public String getSessionID();
66 67 68 69 70 71 72 73 74 75 76

    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
77
    public void setInputStream(InputStream initiatorInputStream);
78

Alex Wenckus's avatar
Alex Wenckus committed
79
    public InputStream getInputStream();
80

Alex Wenckus's avatar
Alex Wenckus committed
81
    public void setOutputStream(OutputStream targetOutputStream);
82

Alex Wenckus's avatar
Alex Wenckus committed
83
    public OutputStream getOutputStream();
84
}