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 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() {
41 return FcpUtils.safeParseInt(getField("Code"));
45 * Returns the description of the error.
47 * @return The description of the error
49 public String getCodeDescription() {
50 return getField("CodeDescription");
54 * Returns some extra description of the error.
56 * @return Extra description of the error, or <code>null</code> if there
59 public String getExtraDescription() {
60 return getField("ExtraDescription");
64 * Returns whether the connection to the node can stay open.
66 * @return <code>true</code> when the connection has to be closed,
67 * <code>false</code> otherwise
69 public boolean isFatal() {
70 return Boolean.valueOf(getField("Fatal"));
74 * The identifier of the causing request, if any.
76 * @return The identifier of the causing request
78 public String getIdentifier() {
79 return getField("Identifier");