01: /**
02: * $RCSfile: $
03: * $Revision: $
04: * $Date: $
05: *
06: * Copyright (C) 2006 Jive Software. All rights reserved.
07: * This software is the proprietary information of Jive Software. Use is subject to license terms.
08: */package org.jivesoftware.openfire.filetransfer;
09:
10: /**
11: * Interface used to capture a file transfer before it begins.
12: *
13: * @author Alexander Wenckus
14: */
15: public interface FileTransferInterceptor {
16: /**
17: * Invokes the interceptor on the specified file transfer. The interceptor can either modify
18: * the file transfer or throw a FileTransferRejectedException. The file transfer went sent to
19: * the interceptor can be in two states, ready and not ready. The not ready state indicates
20: * that this event was fired when the file transfer request was sent by the initatior. The ready
21: * state indicates that the file transfer is ready to begin, and the channels can be
22: * manipulated by the interceptor.
23: * <p>
24: * It is recommended for the the sake of user experience that
25: * when in the not ready state, any processing done on the file transfer should be quick.
26: *
27: * @param transfer the transfer being intercepted
28: * @param isReady true if the transfer is ready to commence or false if this is related to the
29: * initial file transfer request. An exception at this point will cause the transfer to
30: * not go through.
31: *
32: */
33: void interceptFileTransfer(FileTransfer transfer, boolean isReady)
34: throws FileTransferRejectedException;
35: }
|