FileTransferManager.java 2.56 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
/**
 * $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.
 */
11
package org.jivesoftware.openfire.filetransfer;
12

13 14 15
import org.jivesoftware.openfire.auth.UnauthorizedException;
import org.jivesoftware.openfire.container.Module;
import org.jivesoftware.openfire.filetransfer.proxy.ProxyTransfer;
16 17

/**
18 19
 * Manages all file transfer currently happening originating from and/or ending at users of the
 * server. From here, file transfers can be administered and stats can be tracked.
20 21 22
 *
 * @author Alexander Wenckus
 */
23 24
public interface FileTransferManager extends Module {
    /**
25
     * The Stream Initiation, SI, namespace.
26
     */
27
    static final String NAMESPACE_SI = "http://jabber.org/protocol/si";
28 29

    /**
30
     * Namespace for the file transfer profile of Stream Initiation.
31
     */
32 33
    static final String NAMESPACE_SI_FILETRANSFER =
            "http://jabber.org/protocol/si/profile/file-transfer";
34 35 36 37

    /**
     * Bytestreams namespace
     */
38
    static final String NAMESPACE_BYTESTREAMS = "http://jabber.org/protocol/bytestreams";
39

40 41 42 43
    /**
     * Checks an incoming file transfer request to see if it should be accepted or rejected.
     * If it is accepted true will be returned and if it is rejected false will be returned.
     *
44
     * @param transfer the transfer to test for acceptance
45
     * @return true if it should be accepted false if it should not.
46
     */
47
    boolean acceptIncomingFileTransferRequest(FileTransfer transfer) throws FileTransferRejectedException;
48 49 50 51

    /**
     * Registers that a transfer has begun through the proxy connected to the server.
     *
52 53 54 55 56 57
     * @param transferDigest the digest of the initiator + target + sessionID that uniquely
     * identifies a file transfer
     * @param proxyTransfer the related proxy transfer.
     * @throws UnauthorizedException when in the current server configuration this transfer
     * should not be permitted.
     */
58
    void registerProxyTransfer(String transferDigest, ProxyTransfer proxyTransfer)
59 60
            throws UnauthorizedException;

61 62 63 64
    void addFileTransferInterceptor(FileTransferInterceptor interceptor);

    void removeFileTransferInterceptor(FileTransferInterceptor interceptor);

65 66
    void fireFileTransferIntercept(FileTransferProgress transfer, boolean isReady)
            throws FileTransferRejectedException;
67
}