ProxyTransfer.java 2.14 KB
Newer Older
1 2 3 4
/**
 * $Revision$
 * $Date$
 *
5
 * Copyright (C) 1999-2008 Jive Software. All rights reserved.
6
 *
7 8 9 10 11 12 13 14 15 16 17
 * 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.
18
 */
19
package org.jivesoftware.openfire.filetransfer.proxy;
20

21
import org.jivesoftware.util.cache.Cacheable;
22
import org.jivesoftware.openfire.filetransfer.FileTransferProgress;
23 24 25 26 27 28 29 30 31

import java.io.IOException;

/**
 * Tracks the different connections related to a proxy file transfer. There are two connections, the
 * initiator and the target and when both connections are completed the transfer can begin.
 */
public interface ProxyTransfer extends Cacheable, FileTransferProgress {

32 33 34 35 36 37
    /**
     * Sets the transfer digest for a file transfer. The transfer digest uniquely identifies a file
     * transfer in the system.
     *
     * @param digest the digest which uniquely identifies this transfer.
     */
38 39
    public void setTransferDigest(String digest);

40 41 42 43 44
    /**
     * Returns the transfer digest uniquely identifies a file transfer in the system.
     *  
     * @return the transfer digest uniquely identifies a file transfer in the system.
     */
45 46 47
    public String getTransferDigest();

    /**
48
     * Returns true if the Bytestream is ready to be activated and the proxy transfer can begin.
49
     *
50
     * @return true if the Bytestream is ready to be activated.
51 52 53 54 55
     */
    public boolean isActivatable();

    /**
     * Transfers the file from the initiator to the target.
Alex Wenckus's avatar
Alex Wenckus committed
56 57 58
     *
     * @throws java.io.IOException when an error occurs either reading from the input stream or
     * writing to the output stream.
59 60 61
     */
    public void doTransfer() throws IOException;
}