2 * jSite2 - FpcListener.java -
3 * Copyright © 2008 David Roden
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 package net.pterodactylus.util.fcp;
22 import java.util.EventListener;
25 * Interface for objects that want to be notified on certain FCP events.
27 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
30 public interface FcpListener extends EventListener {
33 * Notifies a listener that a “NodeHello” message was received.
35 * @param fcpConnection
36 * The connection that received the message
38 * The “NodeHello” message
40 public void receivedNodeHello(FcpConnection fcpConnection, NodeHello nodeHello);
43 * Notifies a listener that a “CloseConnectionDuplicateClientName” message
46 * @param fcpConnection
47 * The connection that received the message
48 * @param closeConnectionDuplicateClientName
49 * The “CloseConnectionDuplicateClientName” message
51 public void receivedCloseConnectionDuplicateClientName(FcpConnection fcpConnection, CloseConnectionDuplicateClientName closeConnectionDuplicateClientName);
54 * Notifies a listener that a “SSKKeypair” message was received.
56 * @param fcpConnection
57 * The connection that received themessage
59 * The “SSKKeypair” message
61 public void receivedSSKKeypair(FcpConnection fcpConnection, SSKKeypair sskKeypair);
64 * Notifies a listener that a “Peer” message was received.
66 * @param fcpConnection
67 * The connection that received the message
71 public void receivedPeer(FcpConnection fcpConnection, Peer peer);
74 * Notifies a listener that an “EndListPeers” message was received.
76 * @param fcpConnection
77 * The connection that recevied the message
79 * The “EndListPeers” message
81 public void receivedEndListPeers(FcpConnection fcpConnection, EndListPeers endListPeers);
84 * Notifies a listener that a “PeerNote” message was received.
86 * @param fcpConnection
87 * The connection that received the message
89 * The “PeerNote” message
91 public void receivedPeerNote(FcpConnection fcpConnection, PeerNote peerNote);
94 * Notifies a listener that an “EndListPeerNotes” message was received.
96 * @param fcpConnection
97 * The connection that received the message
98 * @param endListPeerNotes
99 * The “EndListPeerNotes” message
101 public void receivedEndListPeerNotes(FcpConnection fcpConnection, EndListPeerNotes endListPeerNotes);
104 * Notifies a listener that a “PeerRemoved” message was received.
106 * @param fcpConnection
107 * The connection that received the message
109 * The “PeerRemoved” message
111 public void receivedPeerRemoved(FcpConnection fcpConnection, PeerRemoved peerRemoved);
114 * Notifies a listener that a “NodeData” message was received.
116 * @param fcpConnection
117 * The connection that received the message
119 * The “NodeData” message
121 public void receivedNodeData(FcpConnection fcpConnection, NodeData nodeData);
124 * Notifies a listener that a “TestDDAReply” message was received.
126 * @param fcpConnection
127 * The connection that received the message
128 * @param testDDAReply
129 * The “TestDDAReply” message
131 public void receivedTestDDAReply(FcpConnection fcpConnection, TestDDAReply testDDAReply);
134 * Notifies a listener that a “TestDDAComplete” was received.
136 * @param fcpConnection
137 * The connection that received the message
138 * @param testDDAComplete
139 * The “TestDDAComplete” message
141 public void receivedTestDDAComplete(FcpConnection fcpConnection, TestDDAComplete testDDAComplete);
144 * Notifies a listener that a “PersistentGet” was received.
146 * @param fcpConnection
147 * The connection that received the message
148 * @param persistentGet
149 * The “PersistentGet” message
151 public void receivedPersistentGet(FcpConnection fcpConnection, PersistentGet persistentGet);
154 * Notifies a listener that a “PersistentPut” was received.
156 * @param fcpConnection
157 * The connection that received the message
158 * @param persistentPut
159 * The “PersistentPut” message
161 public void receivedPersistentPut(FcpConnection fcpConnection, PersistentPut persistentPut);
164 * Notifies a listener that a “EndListPersistentRequests” was received.
166 * @param fcpConnection
167 * The connection that received the message
168 * @param endListPersistentRequests
169 * The “EndListPersistentRequests” message
171 public void receivedEndListPersistentRequests(FcpConnection fcpConnection, EndListPersistentRequests endListPersistentRequests);
174 * Notifies a listener that a “URIGenerated” was received.
176 * @param fcpConnection
177 * The connection that received the message
178 * @param uriGenerated
179 * The “URIGenerated” message
181 public void receivedURIGenerated(FcpConnection fcpConnection, URIGenerated uriGenerated);
184 * Notifies a listener that a “DataFound” was received.
186 * @param fcpConnection
187 * The connection that received the message
189 * The “DataFound” message
191 public void receivedDataFound(FcpConnection fcpConnection, DataFound dataFound);
194 * Notifies a listener that an “AllData” was received.
196 * @param fcpConnection
197 * The connection that received the message
199 * The “AllData” message
201 public void receivedAllData(FcpConnection fcpConnection, AllData allData);
204 * Notifies a listener that a “SimpleProgress” was received.
206 * @param fcpConnection
207 * The connection that received the message
208 * @param simpleProgress
209 * The “SimpleProgress” message
211 public void receivedSimpleProgress(FcpConnection fcpConnection, SimpleProgress simpleProgress);
214 * Notifies a listener that a “StartedCompression” was received.
216 * @param fcpConnection
217 * The connection that received the message
218 * @param startedCompression
219 * The “StartedCompression” message
221 public void receivedStartedCompression(FcpConnection fcpConnection, StartedCompression startedCompression);
224 * Notifies a listener that a “FinishedCompression” was received.
226 * @param fcpConnection
227 * The connection that received the message
228 * @param finishedCompression
229 * The “FinishedCompression” message
231 public void receviedFinishedCompression(FcpConnection fcpConnection, FinishedCompression finishedCompression);
234 * Notifies a listener that an “UnknownPeerNoteType” was received.
236 * @param fcpConnection
237 * The connection that received the message
238 * @param unknownPeerNoteType
239 * The “UnknownPeerNoteType” message
241 public void receivedUnknownPeerNoteType(FcpConnection fcpConnection, UnknownPeerNoteType unknownPeerNoteType);
244 * Notifies a listener that a “UnknownNodeIdentifier” message was received.
246 * @param fcpConnection
247 * The connection that received the message
248 * @param unknownNodeIdentifier
249 * The “UnknownNodeIdentifier” message
251 public void receivedUnknownNodeIdentifier(FcpConnection fcpConnection, UnknownNodeIdentifier unknownNodeIdentifier);
254 * Notifies a listener that a “ProtocolError” was received.
256 * @param fcpConnection
257 * The connection that received the message
258 * @param protocolError
259 * The “ProtocolError” message
261 public void receivedProtocolError(FcpConnection fcpConnection, ProtocolError protocolError);
264 * Notifies a listener that a message has been received. This method is only
265 * called if {@link FcpConnection#handleMessage(FcpMessage)} does not
266 * recognize the message. Should that ever happen, please file a bug report!
268 * @param fcpConnection
269 * The connection that received the message
271 * The message that was received
273 public void receivedMessage(FcpConnection fcpConnection, FcpMessage fcpMessage);