Update license to GPLv3, fix header comments
[jFCPlib.git] / src / main / java / net / pterodactylus / fcp / SentFeed.java
1 /*
2  * jFCPlib - SentFeed.java - Copyright © 2009–2016 David Roden
3  *
4  * This program 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 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17
18 package net.pterodactylus.fcp;
19
20 /**
21  * The “SentFeed” message signals that a feed was successfully sent to a peer.
22  *
23  * @author David ‘Bombe’ Roden &lt;bombe@freenetproject.org&gt;
24  */
25 public class SentFeed extends BaseMessage implements Identifiable {
26
27         /**
28          * Creates a new “SentFeed” message from the given FCP message.
29          *
30          * @param fcpMessage
31          *            The FCP message containing the “SentFeed” message
32          */
33         public SentFeed(FcpMessage fcpMessage) {
34                 super(fcpMessage);
35         }
36
37         /**
38          * Returns the identifier of the sent feed. The identifier of this message
39          * matches the identifier that was given when a {@link SendBookmarkFeed},
40          * {@link SendDownloadFeed}, or {@link SendTextFeed} command was created.
41          *
42          * @return The send feed’s identifier
43          */
44         @Override
45         public String getIdentifier() {
46                 return getField("Identifier");
47         }
48
49         /**
50          * Returns the node status of the peer. The node status is definied in
51          * {@code freenet.node.PeerManager}.
52          * <p>
53          * <ol start="1">
54          * <li>Connected</li>
55          * <li>Backed off</li>
56          * <li>Version too new</li>
57          * <li>Version too old</li>
58          * <li>Disconnected</li>
59          * <li>Never connected</li>
60          * <li>Disabled</li>
61          * <li>Bursting</li>
62          * <li>Listening</li>
63          * <li>Listening only</li>
64          * <li>Clock problem</li>
65          * <li>Connection error</li>
66          * <li>Disconnecting</li>
67          * <li>Routing disabled</li>
68          * </ol>
69          *
70          * @return The node’s status
71          */
72         public int getNodeStatus() {
73                 return FcpUtils.safeParseInt(getField("NodeStatus"));
74         }
75
76 }