FileTransferManager.java 2.6 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
 *
 * This software is published under the terms of the GNU Public License (GPL),
9 10
 * a copy of which is included in this distribution, or a commercial license
 * agreement with Jive.
11
 */
12
package org.jivesoftware.openfire.filetransfer;
13

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

/**
19 20
 * 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.
21 22 23
 *
 * @author Alexander Wenckus
 */
24 25
public interface FileTransferManager extends Module {
    /**
26
     * The Stream Initiation, SI, namespace.
27
     */
28
    static final String NAMESPACE_SI = "http://jabber.org/protocol/si";
29 30

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

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

41 42 43 44
    /**
     * 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.
     *
45
     * @param transfer the transfer to test for acceptance
46
     * @return true if it should be accepted false if it should not.
47
     */
48
    boolean acceptIncomingFileTransferRequest(FileTransfer transfer) throws FileTransferRejectedException;
49 50 51 52

    /**
     * Registers that a transfer has begun through the proxy connected to the server.
     *
53 54 55 56 57 58
     * @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.
     */
59
    void registerProxyTransfer(String transferDigest, ProxyTransfer proxyTransfer)
60 61
            throws UnauthorizedException;

62 63 64 65
    void addFileTransferInterceptor(FileTransferInterceptor interceptor);

    void removeFileTransferInterceptor(FileTransferInterceptor interceptor);

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