Added a LICENSE file, fixed/added a few license headers.
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / utils / StatusCode.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved. 
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.controller.sal.utils;
10
11 /**
12  * The enum which describes the generic error conditions.
13  * Each enum value is associated with a minimal description string. 
14  *
15  */
16 public enum StatusCode {
17         SUCCESS("Success"),
18
19         BADREQUEST("Bad Request"),
20         UNAUTHORIZED("UnAuthorized"),
21         FORBIDDEN("Forbidden"),
22         NOTFOUND("Not Found"),
23         NOTALLOWED("Method Not Allowed"),
24         NOTACCEPTABLE("Request Not Acceptable"),
25         TIMEOUT("Request Timeout"),
26         CONFLICT("Resource Conflict"),
27         GONE("Resource Gone"),
28         UNSUPPORTED("Unsupported"),
29
30         INTERNALERROR("Internal Error"), 
31         NOTIMPLEMENTED("Not Implemented"),
32         NOSERVICE("Service Not Available"),
33         
34         UNDEFINED("Undefined Error");
35         
36         private String description;
37         private StatusCode(String description) {
38                 this.description = description; 
39         }
40         
41         /**
42          * Prints the description associated to the code value
43          */
44         public String toString() {
45                 return description;
46         }
47
48 }