You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by mj...@apache.org on 2018/02/14 23:42:01 UTC
[06/12] guacamole-client git commit: GUACAMOLE-504: Add method for
WebSocket status, and reconfigure REST API to use new HTTP method.
GUACAMOLE-504: Add method for WebSocket status, and reconfigure REST API to use new HTTP method.
Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/0c5b3012
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/0c5b3012
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/0c5b3012
Branch: refs/heads/master
Commit: 0c5b3012ac796749537ede1dd5a0ef0deb56c6ac
Parents: 5239a83
Author: Nick Couchman <vn...@apache.org>
Authored: Thu Feb 8 09:44:19 2018 -0500
Committer: Nick Couchman <vn...@apache.org>
Committed: Fri Feb 9 13:17:08 2018 -0500
----------------------------------------------------------------------
.../java/org/apache/guacamole/GuacamoleException.java | 12 ++++++++++++
.../org/apache/guacamole/rest/RESTExceptionWrapper.java | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/0c5b3012/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleException.java
----------------------------------------------------------------------
diff --git a/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleException.java b/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleException.java
index 44d40e3..d984226 100644
--- a/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleException.java
+++ b/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleException.java
@@ -80,5 +80,17 @@ public class GuacamoleException extends Exception {
public int getHttpStatusCode() {
return getStatus().getHttpStatusCode();
}
+
+ /**
+ * Returns the most applicable WebSocket status code that can be
+ * associated with this exception.
+ *
+ * @return
+ * An integer representing the most applicable WebSocket status
+ * code associated with this exception.
+ */
+ public int getWebSocketCode() {
+ return getStatus().getWebSocketCode();
+ }
}
http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/0c5b3012/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionWrapper.java
----------------------------------------------------------------------
diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionWrapper.java b/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionWrapper.java
index 28736e8..a0c756e 100644
--- a/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionWrapper.java
+++ b/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionWrapper.java
@@ -173,7 +173,7 @@ public class RESTExceptionWrapper implements MethodInterceptor {
// Translate GuacamoleException subclasses to HTTP error codes
catch (GuacamoleException e) {
throw new APIException(
- Response.Status.fromStatusCode(e.getStatus().getHttpStatusCode()),
+ Response.Status.fromStatusCode(e.getHttpStatusCode()),
e
);
}