Class Guacamole.Object
Defined in: Object.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Guacamole.Object(client, index)
An object used by the Guacamole client to house arbitrarily-many named
input and output streams.
|
Field Attributes | Field Name and Description |
---|---|
The index of this object.
|
|
<static> <constant> |
Guacamole.Object.ROOT_STREAM
The reserved name denoting the root stream of any object.
|
<static> <constant> |
Guacamole.Object.STREAM_INDEX_MIMETYPE
The mimetype of a stream containing JSON which maps available stream names
to their corresponding mimetype.
|
Method Attributes | Method Name and Description |
---|---|
createOutputStream(mimetype, name)
Creates a new output stream associated with this object and having the
given mimetype and name.
|
|
requestInputStream(name, bodyCallback)
Requests read access to the input stream having the given name.
|
Event Attributes | Event Name and Description |
---|---|
onbody(inputStream, mimetype, name)
Called when this object receives the body of a requested input stream.
|
|
Called when this object is being undefined.
|
Class Detail
Guacamole.Object(client, index)
An object used by the Guacamole client to house arbitrarily-many named
input and output streams.
- Parameters:
- {Guacamole.Client} client
- The client owning this object.
- {Number} index
- The index of this object.
Field Detail
{Number}
index
The index of this object.
<static> <constant>
{String}
Guacamole.Object.ROOT_STREAM
The reserved name denoting the root stream of any object. The contents of
the root stream MUST be a JSON map of stream name to mimetype.
<static> <constant>
{String}
Guacamole.Object.STREAM_INDEX_MIMETYPE
The mimetype of a stream containing JSON which maps available stream names
to their corresponding mimetype. The root stream of a Guacamole.Object MUST
have this mimetype.
Method Detail
{Guacamole.OutputStream}
createOutputStream(mimetype, name)
Creates a new output stream associated with this object and having the
given mimetype and name. The legality of a mimetype and name is dictated
by the object itself.
- Parameters:
- {String} mimetype
- The mimetype of the data which will be sent to the output stream.
- {String} name
- The defined name of an output stream within this object.
- Returns:
- {Guacamole.OutputStream} An output stream which will write blobs to the named output stream of this object.
requestInputStream(name, bodyCallback)
Requests read access to the input stream having the given name. If
successful, a new input stream will be created.
- Parameters:
- {String} name
- The name of the input stream to request.
- {Function} bodyCallback Optional
- The callback to invoke when the body of the requested input stream is received. This callback will be provided a Guacamole.InputStream and its mimetype as its two only arguments. If the onbody handler of this object is overridden, this callback will not be invoked.
Event Detail
onbody(inputStream, mimetype, name)
Called when this object receives the body of a requested input stream.
By default, all objects will invoke the callbacks provided to their
requestInputStream() functions based on the name of the stream
requested. This behavior can be overridden by specifying a different
handler here.
- Parameters:
- {Guacamole.InputStream} inputStream
- The input stream of the received body.
- {String} mimetype
- The mimetype of the data being received.
- {String} name
- The name of the stream whose body has been received.
onundefine()
Called when this object is being undefined. Once undefined, no further
communication involving this object may occur.