Initial opendaylight infrastructure commit!!
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / authorization / AppRoleLevel.java
diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/authorization/AppRoleLevel.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/authorization/AppRoleLevel.java
new file mode 100644 (file)
index 0000000..aa6514c
--- /dev/null
@@ -0,0 +1,46 @@
+
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.sal.authorization;
+
+import java.io.Serializable;
+
+/**
+ * Represents the application user role levels
+ * This level has meaning only inside the application context
+ * In the controller space such a role will be seen as <code>APPUSER<code>
+ * as specified in {@link UserLevel}
+ */
+public enum AppRoleLevel implements Serializable {
+    APPADMIN(0, "App-Admin", "Application Administrator"), APPUSER(1,
+            "App-User", "Application User"), APPOPERATOR(2, "Network-Operator",
+            "Application Operator"), NOUSER(255, "Unknown User", "Unknown User");
+
+    private int userLevel;
+    private String level;
+    private String prettyLevel;
+
+    private AppRoleLevel(int userlevel, String level, String prettyLevel) {
+        this.userLevel = userlevel;
+        this.level = level;
+        this.prettyLevel = prettyLevel;
+    }
+
+    public int toNumber() {
+        return this.userLevel;
+    }
+
+    public String toString() {
+        return this.level;
+    }
+
+    public String toStringPretty() {
+        return this.prettyLevel;
+    }
+}