Namespace baja.comm
Baja Communications
Defined in: comm.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| 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.
|
- Parameters:
- {Object} bd
- the body of the Comms message.
- {baja.comm.Callback} cb
- the callback handler.
- {Object} options
- Object Literal options.
- Parameters:
- {String} error
- the error message to be logged in the Server.
- 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.
- 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.
- 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.
- 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.
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.
- Parameters:
- {baja.comm.Callback} cb
- Parameters:
- {baja.comm.Callback} cb
- callback handler. If the callback had a batch object originally defined then the network call will be made.
- Parameters:
- {Object} cb Optional
- callback
- Parameters:
- {String} serverHandlerId
- the id of the Server Session Handler to remove from the Server.
- {baja.comm.Callback} the
- callback handler.
- Parameters:
- {baja.Ord} ord
- the ORD to be resolved.
- object
- base Object.
- {Object} cb
- the callback handler.
- {Object} options
- Object Literal options.
- 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).
- Parameters:
- func
- the comm fail error
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.
- 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.