Class Index | File Index

Classes


Namespace baja.comm

Baja Communications
Defined in: comm.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
<private> <static>  
baja.comm.cursor(bd, cb, options)
Resolve Cursor data for a Collection (or Table).
<private> <static>  
baja.comm.error(error)
Make a network call with the specified error.
<private> <static>  
baja.comm.getConcreteTypes(typeSpec, cb)
Makes a network call for getting concrete Type information.
<private> <static>  
baja.comm.lex(module, cb, async)
Makes a network call loading Lexicon information.
<private> <static>  
baja.comm.loadContract(typeSpec, cb, async)
Makes a network call for loading Contract information.
<private> <static>  
baja.comm.loadTypes(types, encodeContracts, cb, async)
Makes a network call for loading Type information.
<private> <static>  
baja.comm.makeServerHandler(serverHandlerId, serverHandlerTypeSpec, serverHandlerArg, eventHandler, cb, makeInBatch)
Make a Server Session Handler on the Server.
<private> <static>  
baja.comm.makeServerSession(cb)
Makes the ServerSession.
<private> <static>  
baja.comm.navFile(cb)
Makes a network call for the nav file.
<private> <static>  
baja.comm.poll(cb)
Polls the ServerSession for Changes.
<private> <static>  
baja.comm.reconnect()
Attempts a reconnection
<private> <static>  
baja.comm.removeServerHandler(serverHandlerId, the)
Remove a Server Session Handler from the Server.
<private> <static>  
baja.comm.resolve(ord, object, cb, options)
Resolve an ORD.
<private> <static>  
baja.comm.serverHandlerCall(serverHandlerId, serverHandlerKey, serverHandlerArg, cb, makeInBatch)
Make an RPC call to the Server Session Handler on the Server.
<static>  
baja.comm.setCommFailCallback(func)
Set the comm fail function that gets called when the communications layer of BajaScript fails.
<private> <static>  
baja.comm.start(obj)
Start the Comms Engine.
<private> <static>  
baja.comm.stop(obj)
Stop the Comms Engine.
Namespace Detail
baja.comm
Method Detail
<private> <static> baja.comm.cursor(bd, cb, options)
Resolve Cursor data for a Collection (or Table).
Parameters:
{Object} bd
the body of the Comms message.
{baja.comm.Callback} cb
the callback handler.
{Object} options
Object Literal options.

<private> <static> baja.comm.error(error)
Make a network call with the specified error. This will Log the error in the Server.
Parameters:
{String} error
the error message to be logged in the Server.

<private> <static> baja.comm.getConcreteTypes(typeSpec, cb)
Makes a network call for getting concrete Type information.
Parameters:
{String} typeSpec
the TypeSpec used for querying the concrete types.
{baja.comm.Callback} cb
the callback handler. If the callback had a batch object originally defined then the network call will be made.

<private> <static> baja.comm.lex(module, cb, async)
Makes a network call loading Lexicon information.
Parameters:
{String} module
the module name of the lexicon.
{baja.comm.Callback} cb
callback handler. If the callback had a batch object originally defined then the network call will be made.
{Boolean} async
true if this network should be made asynchronously.

<private> <static> baja.comm.loadContract(typeSpec, cb, async)
Makes a network call for loading Contract information.
Parameters:
{String} typeSpec
the TypeSpec the Contract information is going to be fetched for.
{baja.comm.Callback} cb
callback handler. If the callback had a batch object originally defined then the network call will be made.
{Boolean} async
true if this network should be made asynchronously.

<private> <static> baja.comm.loadTypes(types, encodeContracts, cb, async)
Makes a network call for loading Type information.
Parameters:
{String|Array} types
the TypeSpecs needed to be resolved.
{Boolean} encodeContracts
encode Contracts for the given Types.
{baja.comm.Callback} cb
callback handler. If the callback had a batch object originally defined then the network call will be made.
{Boolean} async
true if this network should be made asynchronously.

<private> <static> baja.comm.makeServerHandler(serverHandlerId, serverHandlerTypeSpec, serverHandlerArg, eventHandler, cb, makeInBatch)
Make a Server Session Handler on the Server.

A Server Session represents the session between a BajaScript Client and the Server. Components can be created and mounted under the Server's Server Session. These are called Server Session Handler Components. Server Session Handler Components provide an architecture for Session based Components that can receive requests and responses. A Server Session Handler can also dispatch events to a BajaScript client for further processing. A good example of a Server Session Handler is the local Component Space BajaScript is connected too. The Server Session Handler API represents a useful abstract layer for other Space subsystems to be plugged into (i.e. Virtual Component Spaces).

Currently, the Server Session API is considered to be private and should only be used by Tridium framework developers.

Parameters:
{String} serverHandlerId
a unique String that will identify the Server Session Handler under the Server Session.
{String} serverHandlerTypeSpec
the type spec (moduleName:typeName) of the Server Session Handler that will be mounted under the Server Session.
serverHandlerArg
an initial argument to be passed into the Server Session Handler when it's created. This argument will be encoded to standard JSON.
{Function} eventHandler
an event handler callback function that will be called when any events are dispatched from the Server Session Handler.
{baja.comm.Callback} cb
the callback handler.
{Boolean} makeInBatch Optional
set to true if the batch being used has the make present (hence the server session creation is part of this network call.

<private> <static> baja.comm.makeServerSession(cb)
Makes the ServerSession.
Parameters:
{baja.comm.Callback} cb

<private> <static> baja.comm.navFile(cb)
Makes a network call for the nav file.
Parameters:
{baja.comm.Callback} cb
callback handler. If the callback had a batch object originally defined then the network call will be made.

<private> <static> baja.comm.poll(cb)
Polls the ServerSession for Changes.
Parameters:
{Object} cb Optional
callback

<private> <static> baja.comm.reconnect()
Attempts a reconnection

<private> <static> baja.comm.removeServerHandler(serverHandlerId, the)
Remove a Server Session Handler from the Server.
Parameters:
{String} serverHandlerId
the id of the Server Session Handler to remove from the Server.
{baja.comm.Callback} the
callback handler.
See:
baja.comm.makeServerHandler

<private> <static> baja.comm.resolve(ord, object, cb, options)
Resolve an ORD.
Parameters:
{baja.Ord} ord
the ORD to be resolved.
object
base Object.
{Object} cb
the callback handler.
{Object} options
Object Literal options.

<private> <static> baja.comm.serverHandlerCall(serverHandlerId, serverHandlerKey, serverHandlerArg, cb, makeInBatch)
Make an RPC call to the Server Session Handler on the Server.
Parameters:
{String} serverHandlerId
the id of the Server Session Handler.
{String} serverHandlerKey
the key of the request handler to invoke on the Server Session Handler.
serverHandlerArg
the argument to pass into the request handler invoked on the Server Session Handler. This argument is encoded to JSON.
{baja.comm.Callback} cb
the callback handler.
{Boolean} makeInBatch Optional
set to true if the batch being used has the make present (hence the server session creation is part of this network call).
See:
baja.comm.makeServerHandler

<static> baja.comm.setCommFailCallback(func)
Set the comm fail function that gets called when the communications layer of BajaScript fails.
Parameters:
func
the comm fail error

<private> <static> baja.comm.start(obj)
Start the Comms Engine.

This is called to start BajaScript.

Parameters:
{Object} obj
the Object Literal for the method's arguments.
{Function} obj.started Optional
function called once BajaScript has started.
{Array} obj.typeSpecs Optional
an array of type specs (moduleName:typeName) to import on start up. This will import both Type and Contract information.
{Function} obj.commFail Optional
function called if the BOX communications fail.
{Boolean} obj.navFile Optional
if true, this will load the nav file for the user on start up.

<private> <static> baja.comm.stop(obj)
Stop the Comms Engine.
Parameters:
{Object} obj
the Object Literal for the method's arguments.
{Function} obj.stopped Optional
function to invoke after the comms have stopped.
{Function} obj.preStop Optional
function to invoke just before the comms have stopped.

Documentation generated by JsDoc Toolkit 2.3.2