Initial opendaylight infrastructure commit!!
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / utils / StatusCode.java
1 package org.opendaylight.controller.sal.utils;
2
3 /**
4  * The enum which describes the generic error conditions.
5  * Each enum value is associated with a minimal description string. 
6  *
7  */
8 public enum StatusCode {
9         SUCCESS("Success"),
10
11         BADREQUEST("Bad Request"),
12         UNAUTHORIZED("UnAuthorized"),
13         FORBIDDEN("Forbidden"),
14         NOTFOUND("Not Found"),
15         NOTALLOWED("Method Not Allowed"),
16         NOTACCEPTABLE("Request Not Acceptable"),
17         TIMEOUT("Request Timeout"),
18         CONFLICT("Resource Conflict"),
19         GONE("Resource Gone"),
20         UNSUPPORTED("Unsupported"),
21
22         INTERNALERROR("Internal Error"), 
23         NOTIMPLEMENTED("Not Implemented"),
24         NOSERVICE("Service Not Available"),
25         
26         UNDEFINED("Undefined Error");
27         
28         private String description;
29         private StatusCode(String description) {
30                 this.description = description; 
31         }
32         
33         /**
34          * Prints the description associated to the code value
35          */
36         public String toString() {
37                 return description;
38         }
39
40 }