01: /**
02: * $RCSfile$
03: * $Revision: 1217 $
04: * $Date: 2005-04-11 18:11:06 -0300 (Mon, 11 Apr 2005) $
05: *
06: * Copyright (C) 1999-2006 Jive Software. All rights reserved.
07: *
08: * This software is published under the terms of the GNU Public License (GPL),
09: * a copy of which is included in this distribution.
10: */package org.jivesoftware.openfire.filetransfer;
11:
12: import org.jivesoftware.openfire.auth.UnauthorizedException;
13: import org.jivesoftware.openfire.container.Module;
14: import org.jivesoftware.openfire.filetransfer.proxy.ProxyTransfer;
15:
16: /**
17: * Manages all file transfer currently happening originating from and/or ending at users of the
18: * server. From here, file transfers can be administered and stats can be tracked.
19: *
20: * @author Alexander Wenckus
21: */
22: public interface FileTransferManager extends Module {
23: /**
24: * The Stream Initiation, SI, namespace.
25: */
26: static final String NAMESPACE_SI = "http://jabber.org/protocol/si";
27:
28: /**
29: * Namespace for the file transfer profile of Stream Initiation.
30: */
31: static final String NAMESPACE_SI_FILETRANSFER = "http://jabber.org/protocol/si/profile/file-transfer";
32:
33: /**
34: * Bytestreams namespace
35: */
36: static final String NAMESPACE_BYTESTREAMS = "http://jabber.org/protocol/bytestreams";
37:
38: /**
39: * Checks an incoming file transfer request to see if it should be accepted or rejected.
40: * If it is accepted true will be returned and if it is rejected false will be returned.
41: *
42: * @param transfer the transfer to test for acceptance
43: * @return true if it should be accepted false if it should not.
44: */
45: boolean acceptIncomingFileTransferRequest(FileTransfer transfer)
46: throws FileTransferRejectedException;
47:
48: /**
49: * Registers that a transfer has begun through the proxy connected to the server.
50: *
51: * @param transferDigest the digest of the initiator + target + sessionID that uniquely
52: * identifies a file transfer
53: * @param proxyTransfer the related proxy transfer.
54: * @throws UnauthorizedException when in the current server configuration this transfer
55: * should not be permitted.
56: */
57: void registerProxyTransfer(String transferDigest,
58: ProxyTransfer proxyTransfer) throws UnauthorizedException;
59:
60: void addFileTransferInterceptor(FileTransferInterceptor interceptor);
61:
62: void removeFileTransferInterceptor(
63: FileTransferInterceptor interceptor);
64:
65: void fireFileTransferIntercept(FileTransferProgress transfer,
66: boolean isReady) throws FileTransferRejectedException;
67: }
|