mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-08 06:01:22 +00:00
GUACAMOLE-986: Update documentation of all parameters/returns to specify non-nullable and/or primitive types where appropriate.
This commit is contained in:
@@ -25,24 +25,27 @@ var Guacamole = Guacamole || {};
|
||||
* included for debugging convenience.
|
||||
*
|
||||
* @constructor
|
||||
* @param {Number} code
|
||||
* @param {!number} code
|
||||
* The Guacamole status code, as defined by Guacamole.Status.Code.
|
||||
*
|
||||
* @param {String} [message]
|
||||
* @param {string} [message]
|
||||
* An optional human-readable message.
|
||||
*/
|
||||
Guacamole.Status = function(code, message) {
|
||||
|
||||
/**
|
||||
* Reference to this Guacamole.Status.
|
||||
*
|
||||
* @private
|
||||
* @type {!Guacamole.Status}
|
||||
*/
|
||||
var guac_status = this;
|
||||
|
||||
/**
|
||||
* The Guacamole status code.
|
||||
*
|
||||
* @see Guacamole.Status.Code
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
this.code = code;
|
||||
|
||||
@@ -52,14 +55,15 @@ Guacamole.Status = function(code, message) {
|
||||
* for debugging purposes only. For user feedback, it is better to translate
|
||||
* the Guacamole status code into a message.
|
||||
*
|
||||
* @type {String}
|
||||
* @type {string}
|
||||
*/
|
||||
this.message = message;
|
||||
|
||||
/**
|
||||
* Returns whether this status represents an error.
|
||||
* @returns {boolean} true if this status represents an error, false
|
||||
* otherwise.
|
||||
*
|
||||
* @returns {!boolean}
|
||||
* true if this status represents an error, false otherwise.
|
||||
*/
|
||||
this.isError = function() {
|
||||
return guac_status.code < 0 || guac_status.code > 0x00FF;
|
||||
@@ -75,28 +79,28 @@ Guacamole.Status.Code = {
|
||||
/**
|
||||
* The operation succeeded.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"SUCCESS": 0x0000,
|
||||
|
||||
/**
|
||||
* The requested operation is unsupported.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"UNSUPPORTED": 0x0100,
|
||||
|
||||
/**
|
||||
* The operation could not be performed due to an internal failure.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"SERVER_ERROR": 0x0200,
|
||||
|
||||
/**
|
||||
* The operation could not be performed as the server is busy.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"SERVER_BUSY": 0x0201,
|
||||
|
||||
@@ -104,7 +108,7 @@ Guacamole.Status.Code = {
|
||||
* The operation could not be performed because the upstream server is not
|
||||
* responding.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"UPSTREAM_TIMEOUT": 0x0202,
|
||||
|
||||
@@ -112,7 +116,7 @@ Guacamole.Status.Code = {
|
||||
* The operation was unsuccessful due to an error or otherwise unexpected
|
||||
* condition of the upstream server.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"UPSTREAM_ERROR": 0x0203,
|
||||
|
||||
@@ -120,7 +124,7 @@ Guacamole.Status.Code = {
|
||||
* The operation could not be performed as the requested resource does not
|
||||
* exist.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"RESOURCE_NOT_FOUND": 0x0204,
|
||||
|
||||
@@ -128,7 +132,7 @@ Guacamole.Status.Code = {
|
||||
* The operation could not be performed as the requested resource is
|
||||
* already in use.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"RESOURCE_CONFLICT": 0x0205,
|
||||
|
||||
@@ -136,7 +140,7 @@ Guacamole.Status.Code = {
|
||||
* The operation could not be performed as the requested resource is now
|
||||
* closed.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"RESOURCE_CLOSED": 0x0206,
|
||||
|
||||
@@ -144,7 +148,7 @@ Guacamole.Status.Code = {
|
||||
* The operation could not be performed because the upstream server does
|
||||
* not appear to exist.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"UPSTREAM_NOT_FOUND": 0x0207,
|
||||
|
||||
@@ -152,7 +156,7 @@ Guacamole.Status.Code = {
|
||||
* The operation could not be performed because the upstream server is not
|
||||
* available to service the request.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"UPSTREAM_UNAVAILABLE": 0x0208,
|
||||
|
||||
@@ -160,7 +164,7 @@ Guacamole.Status.Code = {
|
||||
* The session within the upstream server has ended because it conflicted
|
||||
* with another session.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"SESSION_CONFLICT": 0x0209,
|
||||
|
||||
@@ -168,21 +172,21 @@ Guacamole.Status.Code = {
|
||||
* The session within the upstream server has ended because it appeared to
|
||||
* be inactive.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"SESSION_TIMEOUT": 0x020A,
|
||||
|
||||
/**
|
||||
* The session within the upstream server has been forcibly terminated.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"SESSION_CLOSED": 0x020B,
|
||||
|
||||
/**
|
||||
* The operation could not be performed because bad parameters were given.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"CLIENT_BAD_REQUEST": 0x0300,
|
||||
|
||||
@@ -190,7 +194,7 @@ Guacamole.Status.Code = {
|
||||
* Permission was denied to perform the operation, as the user is not yet
|
||||
* authorized (not yet logged in, for example).
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"CLIENT_UNAUTHORIZED": 0x0301,
|
||||
|
||||
@@ -198,28 +202,28 @@ Guacamole.Status.Code = {
|
||||
* Permission was denied to perform the operation, and this permission will
|
||||
* not be granted even if the user is authorized.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"CLIENT_FORBIDDEN": 0x0303,
|
||||
|
||||
/**
|
||||
* The client took too long to respond.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"CLIENT_TIMEOUT": 0x0308,
|
||||
|
||||
/**
|
||||
* The client sent too much data.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"CLIENT_OVERRUN": 0x030D,
|
||||
|
||||
/**
|
||||
* The client sent data of an unsupported or unexpected type.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"CLIENT_BAD_TYPE": 0x030F,
|
||||
|
||||
@@ -227,7 +231,7 @@ Guacamole.Status.Code = {
|
||||
* The operation failed because the current client is already using too
|
||||
* many resources.
|
||||
*
|
||||
* @type {Number}
|
||||
* @type {!number}
|
||||
*/
|
||||
"CLIENT_TOO_MANY": 0x031D
|
||||
|
||||
@@ -237,11 +241,11 @@ Guacamole.Status.Code = {
|
||||
* Returns the Guacamole protocol status code which most closely
|
||||
* represents the given HTTP status code.
|
||||
*
|
||||
* @param {Number} status
|
||||
* @param {!number} status
|
||||
* The HTTP status code to translate into a Guacamole protocol status
|
||||
* code.
|
||||
*
|
||||
* @returns {Number}
|
||||
* @returns {!number}
|
||||
* The Guacamole protocol status code which most closely represents the
|
||||
* given HTTP status code.
|
||||
*/
|
||||
@@ -281,11 +285,11 @@ Guacamole.Status.Code.fromHTTPCode = function fromHTTPCode(status) {
|
||||
* Returns the Guacamole protocol status code which most closely
|
||||
* represents the given WebSocket status code.
|
||||
*
|
||||
* @param {Number} code
|
||||
* @param {!number} code
|
||||
* The WebSocket status code to translate into a Guacamole protocol
|
||||
* status code.
|
||||
*
|
||||
* @returns {Number}
|
||||
* @returns {!number}
|
||||
* The Guacamole protocol status code which most closely represents the
|
||||
* given WebSocket status code.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user