Added new constructor. May need to tighten down interfaces in the future.
[packetcable.git] / packetcable-driver / src / main / java / org / umu / cops / stack / COPSPrClassError.java
1 /*\r
2  * Copyright (c) 2003 University of Murcia.  All rights reserved.\r
3  * --------------------------------------------------------------\r
4  * For more information, please see <http://www.umu.euro6ix.org/>.\r
5  */\r
6 \r
7 package org.umu.cops.stack;\r
8 \r
9 \r
10 \r
11 /**\r
12  * COPS Provisioning Class Error\r
13  *\r
14  * @version COPSPrClassError.java, v 1.00 2003\r
15  *\r
16  */\r
17 public class COPSPrClassError extends COPSPrError {\r
18 \r
19     public final static byte C_spaceExhausted = 1;\r
20     public final static byte C_instanceInvalid = 2;\r
21     public final static byte C_attrValueInvalid = 3;\r
22     public final static byte C_attrValueSupLimited = 4;\r
23     public final static byte C_attrEnumSupLimited = 5;\r
24     public final static byte C_attrMaxLengthExceeded = 6;\r
25     public final static byte C_attrRefUnknown = 7;\r
26     public final static byte C_notifyOnly = 8;\r
27     public final static byte C_unknownPrc = 9;\r
28     public final static byte C_tooFewAttrs = 10;\r
29     public final static byte C_invalidAttrType = 11;\r
30     public final static byte C_deletedInRef = 12;\r
31     public final static byte C_specificError = 13;\r
32     public final static byte C_errmax = 14;\r
33 \r
34     private final static String CerrTable[] = {\r
35         "Reserved",\r
36         "No more instances may currently be installed in the given class",\r
37         "Invalid class instance",\r
38         "Invalid attribute value",\r
39         "The value for attribute not currently supported by the device",\r
40         "The enumeration for attribute not currently supported by the device",\r
41         "Attribute length exceeds device limitations",\r
42         "Unknown attribute reference",\r
43         "Only supported for use by request or report",\r
44         "Class not supported by PEP",\r
45         "Too few attributes",\r
46         "Invalid attribute type",\r
47         "Reference to deleted instance",\r
48         "PRC specific error, check subcode for more details"\r
49     };\r
50 \r
51     public COPSPrClassError(short eCode, short eSubCode) {\r
52         super (eCode, eSubCode);\r
53         _sNum = COPSPrObjBase.PR_CPERR;\r
54         _sType = COPSPrObjBase.PR_BER;\r
55     }\r
56 \r
57     /**\r
58           Parse the data and create a PrClassError object\r
59      */\r
60     protected COPSPrClassError(byte[] dataPtr) {\r
61         super(dataPtr);\r
62     }\r
63 \r
64     /**\r
65      * Method isPRCClassError\r
66      *\r
67      * @return   a boolean\r
68      *\r
69      */\r
70     public boolean isPRCClassError() {\r
71         return true;\r
72     }\r
73 \r
74     /**\r
75      * Method strError\r
76      *\r
77      * @return   a String\r
78      *\r
79      */\r
80     public String strError() {\r
81         return CerrTable[_errCode];\r
82     };\r
83 }\r
84 \r