summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/Constants.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/gitblit/Constants.java')
-rw-r--r--src/com/gitblit/Constants.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/com/gitblit/Constants.java b/src/com/gitblit/Constants.java
index f4541c9f..63a877f4 100644
--- a/src/com/gitblit/Constants.java
+++ b/src/com/gitblit/Constants.java
@@ -52,6 +52,8 @@ public class Constants {
public static final String SYNDICATION_PATH = "/feed/";
public static final String FEDERATION_PATH = "/federation/";
+
+ public static final String RPC_PATH = "/rpc/";
public static final String BORDER = "***********************************************************";
@@ -193,4 +195,27 @@ public class Constants {
return name();
}
}
+
+ /**
+ * Enumeration representing the possible remote procedure call requests from
+ * a client.
+ */
+ public static enum RpcRequest {
+ LIST_REPOSITORIES, CREATE_REPOSITORY, EDIT_REPOSITORY, DELETE_REPOSITORY,
+ LIST_USERS, CREATE_USER, EDIT_USER, DELETE_USER;
+
+ public static RpcRequest fromName(String name) {
+ for (RpcRequest type : values()) {
+ if (type.name().equalsIgnoreCase(name)) {
+ return type;
+ }
+ }
+ return LIST_REPOSITORIES;
+ }
+
+ @Override
+ public String toString() {
+ return name();
+ }
+ }
}