2 * © 2008 INA Service GmbH
4 package net.pterodactylus.util.fcp;
7 * The “ProtocolError” message signals that something has gone really wrong.
9 * @author <a href="mailto:dr@ina-germany.de">David Roden</a>
12 public class ProtocolError extends BaseMessage {
15 * Creates a new “ProtocolError” message that wraps the received message.
17 * @param receivedMessage
18 * The received message
20 public ProtocolError(FcpMessage receivedMessage) {
21 super(receivedMessage);
25 * Returns whether the causing message had the “Global” flag set.
27 * @return <code>true</code> if the causing message had the “Global” flag
30 public boolean isGlobal() {
31 return Boolean.valueOf(getField("Global"));
35 * Returns the error code.
37 * @return The error code, or <code>-1</code> if the error code could not
40 public int getCode() {
42 return Integer.valueOf(getField("Code"));
43 } catch (NumberFormatException nfe1) {
49 * Returns the description of the error.
51 * @return The description of the error
53 public String getCodeDescription() {
54 return getField("CodeDescription");
58 * Returns some extra description of the error.
60 * @return Extra description of the error, or <code>null</code> if there
63 public String getExtraDescription() {
64 return getField("ExtraDescription");
68 * Returns whether the connection to the node can stay open.
70 * @return <code>true</code> when the connection has to be closed,
71 * <code>false</code> otherwise
73 public boolean isFatal() {
74 return Boolean.valueOf(getField("Fatal"));
78 * The identifier of the causing request, if any.
80 * @return The identifier of the causing request
82 public String getIdentifier() {
83 return getField("Identifier");