01: /*
02: * This file is part of DrFTPD, Distributed FTP Daemon.
03: *
04: * DrFTPD is free software; you can redistribute it and/or modify
05: * it under the terms of the GNU General Public License as published by
06: * the Free Software Foundation; either version 2 of the License, or
07: * (at your option) any later version.
08: *
09: * DrFTPD is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU General Public License for more details.
13: *
14: * You should have received a copy of the GNU General Public License
15: * along with DrFTPD; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18: package net.sf.drftpd.event;
19:
20: import net.sf.drftpd.master.BaseFtpConnection;
21:
22: import org.drftpd.master.RemoteSlave;
23: import org.drftpd.remotefile.LinkedRemoteFileInterface;
24:
25: import java.net.InetAddress;
26:
27: /**
28: * @author mog
29: * @version $Id: TransferEvent.java 1238 2005-09-02 11:54:26Z zubov $
30: */
31: public class TransferEvent extends DirectoryFtpEvent {
32: private InetAddress _peer;
33: private char _type;
34: private InetAddress _clientHost;
35: private BaseFtpConnection _conn;
36:
37: /**
38: * @param user
39: * @param command
40: * @param directory
41: */
42: public TransferEvent(BaseFtpConnection conn, String command,
43: LinkedRemoteFileInterface directory,
44: InetAddress clientHost, RemoteSlave rslave,
45: InetAddress peer, char type) {
46: this (conn, command, directory, clientHost, rslave, peer, type,
47: System.currentTimeMillis());
48: }
49:
50: private TransferEvent(BaseFtpConnection conn, String command,
51: LinkedRemoteFileInterface directory,
52: InetAddress clientHost, RemoteSlave rslave,
53: InetAddress peer, char type, long time) {
54: super (conn.getUserNull(), command, directory, time);
55: _clientHost = clientHost;
56:
57: if (peer == null) {
58: throw new NullPointerException();
59: }
60:
61: _peer = peer;
62: _type = type;
63: _conn = conn;
64: }
65:
66: public char getType() {
67: return _type;
68: }
69:
70: public InetAddress getClientHost() {
71: return _clientHost;
72: }
73:
74: public InetAddress getXferHost() {
75: return _peer;
76: }
77:
78: public InetAddress getPeer() {
79: return _peer;
80: }
81:
82: public BaseFtpConnection getConn() {
83: return _conn;
84: }
85: }
|