Merge "Remove "response" from yang."
[packetcable.git] / protocol_plugins.packetcable / src / main / java / org / pcmm / gates / IPCMMError.java
1 /**
2  @header@
3  */
4 package org.pcmm.gates;
5
6 import org.pcmm.base.IPCMMBaseObject;
7
8 /**
9  *
10  */
11 public interface IPCMMError extends IPCMMBaseObject {
12         static final short LENGTH = 8;
13         static final byte SNUM = 14;
14         static final byte STYPE = 1;
15         final String[] errors = { "Insufficient Resources", "Unknown GateID",
16                         "Missing Required Object", "Invalid Object",
17                         "Volume Based Usage Limit Exceeded",
18                         "Time Based Usage Limit Exceeded", "Session Class Limit Exceeded",
19                         "Undefined Service Class Name", "Incompatible Envelope",
20                         "Invalid SubscriberID", "Unauthorized AMID",
21                         "Number of Classifiers Not Supported", "Policy Exception",
22                         "Invalid Field Value in Object", "Transport Error",
23                         "Unknown Gate Command", "DOCSIS 1.0 CM",
24                         "Number of SIDs exceeded in CM", "Number of SIDs exceeded in CMTS",
25                         "Unauthorized PSID", "No State for PDP", "Unsupported Synch Type",
26                         "State Data Incomplete", "Upstream Drop Unsupported",
27                         "Multicast Gate Error", "Multicast Volume Limit Unsupported",
28                         "Uncommitted Multicast Not Supported",
29                         "Multicast Gate Modification Not Supported",
30                         "Upstream Multicast Not Supported",
31                         "Multicast GateSpec incompatibility", "Multicast QoS Error",
32                         "Multicast Downstream Resequencing mismatch",
33                         "Other, Unspecified Error" };
34
35         static enum Description {
36                 ERROR_01((short) 1, errors[0]), ERROR_02((short) 2, errors[1]), ERROR_06(
37                                 (short) 6, errors[2]), ERROR_07((short) 7, errors[3]), ERROR_08(
38                                 (short) 8, errors[4]), ERROR_09((short) 9, errors[5]), ERROR_10(
39                                 (short) 10, errors[6]), ERROR_11((short) 11, errors[7]), ERROR_12(
40                                 (short) 12, errors[8]), ERROR_13((short) 13, errors[9]), ERROR_14(
41                                 (short) 14, errors[10]), ERROR_15((short) 15, errors[11]), ERROR_16(
42                                 (short) 16, errors[12]), ERROR_17((short) 17, errors[13]), ERROR_18(
43                                 (short) 18, errors[14]), ERROR_19((short) 19, errors[15]), ERROR_20(
44                                 (short) 20, errors[16]), ERROR_21((short) 21, errors[17]), ERROR_22(
45                                 (short) 22, errors[18]), ERROR_23((short) 23, errors[19]), ERROR_24(
46                                 (short) 24, errors[20]), ERROR_25((short) 25, errors[21]), ERROR_26(
47                                 (short) 26, errors[22]), ERROR_27((short) 27, errors[23]), ERROR_28(
48                                 (short) 28, errors[24]), ERROR_29((short) 29, errors[25]), ERROR_30(
49                                 (short) 30, errors[26]), ERROR_31((short) 31, errors[27]), ERROR_32(
50                                 (short) 32, errors[28]), ERROR_33((short) 33, errors[29]), ERROR_34(
51                                 (short) 34, errors[30]), ERROR_35((short) 35, errors[31]), ERROR_127(
52                                 (short) 127, errors[28]);
53
54                 private final short code;
55                 private final String description;
56
57                 private Description(short code, String description) {
58                         this.code = code;
59                         this.description = description;
60                 }
61
62                 public String getDescription() {
63                         return description;
64                 }
65
66                 public short getCode() {
67                         return code;
68                 }
69
70                 public static String valueOf(short errCode) {
71                         switch (errCode) {
72                         case 1:
73                         case 2:
74                                 return errors[errCode - 1];
75                         case 127:
76                                 return errors[32];
77                         default:
78                                 if (errCode > 35 || errCode < 1)
79                                         throw new IllegalArgumentException("unrecongnized error code : " + errCode);
80                                 return errors[errCode - 4];
81                         }
82                 }
83         }
84
85         void setErrorCode(short ErrorCode);
86
87         short getErrorCode();
88
89         void setErrorSubcode(short ErrorSubcode);
90
91         short getErrorSubcode();
92
93         String getDescription();
94 }