Initial opendaylight infrastructure commit!!
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / utils / StatusCode.java
diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/StatusCode.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/StatusCode.java
new file mode 100644 (file)
index 0000000..aca7919
--- /dev/null
@@ -0,0 +1,40 @@
+package org.opendaylight.controller.sal.utils;
+
+/**
+ * The enum which describes the generic error conditions.
+ * Each enum value is associated with a minimal description string. 
+ *
+ */
+public enum StatusCode {
+       SUCCESS("Success"),
+
+       BADREQUEST("Bad Request"),
+       UNAUTHORIZED("UnAuthorized"),
+       FORBIDDEN("Forbidden"),
+       NOTFOUND("Not Found"),
+       NOTALLOWED("Method Not Allowed"),
+       NOTACCEPTABLE("Request Not Acceptable"),
+       TIMEOUT("Request Timeout"),
+       CONFLICT("Resource Conflict"),
+       GONE("Resource Gone"),
+       UNSUPPORTED("Unsupported"),
+
+       INTERNALERROR("Internal Error"), 
+       NOTIMPLEMENTED("Not Implemented"),
+       NOSERVICE("Service Not Available"),
+       
+       UNDEFINED("Undefined Error");
+       
+       private String description;
+       private StatusCode(String description) {
+               this.description = description; 
+       }
+       
+       /**
+        * Prints the description associated to the code value
+        */
+       public String toString() {
+               return description;
+       }
+
+}