Coverage Summary for Class: EthereumListener (org.ethereum.listener)
1 /*
2 * This file is part of RskJ
3 * Copyright (C) 2017 RSK Labs Ltd.
4 * (derived from ethereumJ library, Copyright (c) 2016 <ether.camp>)
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 package org.ethereum.listener;
21
22 import org.ethereum.core.Block;
23 import org.ethereum.core.Transaction;
24 import org.ethereum.core.TransactionPool;
25 import org.ethereum.core.TransactionReceipt;
26 import org.ethereum.net.eth.message.StatusMessage;
27 import org.ethereum.net.message.Message;
28 import org.ethereum.net.p2p.HelloMessage;
29 import org.ethereum.net.rlpx.Node;
30 import org.ethereum.net.server.Channel;
31
32 import java.util.List;
33
34 /**
35 * @author Roman Mandeleil
36 * @since 27.07.2014
37 */
38 public interface EthereumListener {
39
40 void trace(String output);
41
42 void onNodeDiscovered(Node node);
43
44 void onHandShakePeer(Channel channel, HelloMessage helloMessage);
45
46 void onEthStatusUpdated(Channel channel, StatusMessage status);
47
48 void onRecvMessage(Channel channel, Message message);
49
50 void onBlock(Block block, List<TransactionReceipt> receipts);
51
52 void onBestBlock(Block block, List<TransactionReceipt> receipts);
53
54 void onPeerDisconnect(String host, long port);
55
56 void onPendingTransactionsReceived(List<Transaction> transactions);
57
58 void onTransactionPoolChanged(TransactionPool transactionPool);
59
60 void onNoConnections();
61
62 void onPeerAddedToSyncPool(Channel peer);
63
64 void onLongSyncDone();
65
66 void onLongSyncStarted();
67 }