KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > drftpd > event > TransferEvent


1 /*
2  * This file is part of DrFTPD, Distributed FTP Daemon.
3  *
4  * DrFTPD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * 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 java.net.InetAddress JavaDoc;
21
22 import net.sf.drftpd.master.RemoteSlave;
23 import net.sf.drftpd.master.usermanager.User;
24 import net.sf.drftpd.remotefile.LinkedRemoteFileInterface;
25
26 /**
27  * @author mog
28  * @version $Id: TransferEvent.java,v 1.9 2004/04/22 02:10:10 mog Exp $
29  */

30 public class TransferEvent extends DirectoryFtpEvent {
31     private boolean _complete;
32     private InetAddress JavaDoc _peer;
33
34     private RemoteSlave _rslave;
35     private char _type;
36     private InetAddress JavaDoc _clientHost;
37
38     /**
39      * @param user
40      * @param command
41      * @param directory
42      */

43     public TransferEvent(
44         User user,
45         String JavaDoc command,
46         LinkedRemoteFileInterface directory,
47         InetAddress JavaDoc clientHost,
48         RemoteSlave rslave,
49         InetAddress JavaDoc peer,
50         char type,
51         boolean complete) {
52         this(
53             user,
54             command,
55             directory,
56             clientHost,
57             rslave,
58             peer,
59             type,
60             complete,
61             System.currentTimeMillis());
62     }
63
64     public TransferEvent(
65         User user,
66         String JavaDoc command,
67         LinkedRemoteFileInterface directory,
68         InetAddress JavaDoc clientHost,
69         RemoteSlave rslave,
70         InetAddress JavaDoc peer,
71         char type,
72         boolean complete,
73         long time) {
74         super(user, command, directory, time);
75         _clientHost = clientHost;
76         _rslave = rslave;
77         if(peer == null) throw new NullPointerException JavaDoc();
78         _peer = peer;
79         _complete = complete;
80         _type = type;
81     }
82
83     public char getType() {
84         return _type;
85     }
86
87     public InetAddress JavaDoc getClientHost() {
88         return _clientHost;
89     }
90
91     public InetAddress JavaDoc getXferHost() {
92         return _peer;
93     }
94
95     /**
96      * @return Whether this transfer finished successfully.
97      */

98     public boolean isComplete() {
99         return _complete;
100     }
101
102     public InetAddress JavaDoc getPeer() {
103         return _peer;
104     }
105 }
106
Popular Tags