Hemi JavaScript Framework
Hemi.data.io
Description
The Data IO service is used to broker data requests with configured data providers. The built-in interchange format is loosely modelled on the Account Manager 4 Data and Group object model, but the implementation is open for any object type.
Class Index
static Hemi.data.io.service
version 3.1.9
Static implementation of the hemi.data.io.proxy.serviceImpl class.
Hemi.data.io.serviceImpl
version 3.1.9
The Data IO proxy service marshals custom protocol requests through Data IO providers.
Index
Method Index
- virtual _handle_change_bus: Update the proxied bus type from the "iobus" transaction.
- public buildMatcher (internal): Builds the expression matcher for custom protocols.
- public isProxied: Tests whether a URI pattern may be proxied based on a custom protocol.
- public isProxyProtocol: Tests whether a URI pattern matches a registered protocol proxy.
- public proxyXml (internal): Proxies an XML URI Request to the registered provider for the matching protocol. TODO: Instrument async handling to proxy async Data IO response through XML Async Response.
- public register (internal): Links a provider to a custom protocol proxy.
- public setAutoChangeBus: Specify whether the proxy service should change the current bus based on the "iobus" transaction.
- public setBusType: Specify the current bus the proxy service should use.
- public stripProxyProtocol: Specify the current bus the proxy service should use.
- public unregister (internal): Delinks a provider from a custom protocol proxy.
Methods
_handle_change_bus
Update the proxied bus type from the "iobus" transaction. Method is virtual and can be overridden.
Syntax
void _handle_change_bus(
oService, oPacket
)
Parameters
- oService as TransactionService : The service handling this channel.
- oPacket as TransactionPacket : The packet being served.
buildMatcher
Builds the expression matcher for custom protocols.
Syntax
void buildMatcher(
)
isProxied
Tests whether a URI pattern may be proxied based on a custom protocol.
Syntax
bProxied = isProxied(
sUri, iBusType
)
Parameters
- sUri as String : A URI pattern.
- iBusType as int (optional): The bus type to use when determining proxy applicability.
Returns
bProxied as bit: Bit indicating the provided URI pattern matches a registered protocol proxy.
isProxyProtocol
Tests whether a URI pattern matches a registered protocol proxy.
Syntax
bProxied = isProxyProtocol(
sUri
)
Parameters
- sUri as String : A URI pattern.
Returns
bProxied as bit: Bit indicating the provided URI pattern matches a registered protocol proxy.
proxyXml
Proxies an XML URI Request to the registered provider for the matching protocol. TODO: Instrument async handling to proxy async Data IO response through XML Async Response.
Syntax
oXml = proxyXml(
sPath, h, bAsync, sId, bPost, vData, c, t
)
Parameters
- sPath as String : The URI to an XML/Text/JSON Resource decorated with the proxy protocol.
- h as function (optional): Handler invoked for asynchronous requests.
- bAsync as bit : Bit indicating wether the request is asynchronous. Currently limited to synchronous; async requests will be ignored.
- sId as String : Identifier associated with the request.
- bPost as bit : Bit indicating wether the request should be made via HTTP POST.
- vData as variant : Data to be included as the POST payload, such as an XMLDocument, text, or JSON structure.
- c as boolean (optional): Bit indicating whether the response should be cached.
- t as int (optional): Int indicating whether the request and response as text (1) or JSON (2) instead of XML (0).
Returns
oXml as HemiXML: Returns an internal XML construct.
register
Links a provider to a custom protocol proxy.
Syntax
bUnregistered = register(
oProvider
)
Parameters
- oProvider as ProviderStruct : Internal Provider Structure
Returns
bUnregistered as bit: Bit indicating the provider was registered as providing a custom protocol proxy.
setAutoChangeBus
Specify whether the proxy service should change the current bus based on the "iobus" transaction.
Syntax
void setAutoChangeBus(
bAuto
)
Parameters
- bAuto as bit : Bit indicating whether the proxy bus should track with the "iobus" transaction.
setBusType
Specify the current bus the proxy service should use.
Syntax
void setBusType(
iType
)
Parameters
- iType as BUSTYPE : The current bus.
stripProxyProtocol
Specify the current bus the proxy service should use.
Syntax
void stripProxyProtocol(
sUri
)
Parameters
- sUri as BUSTYPE : The current bus.
unregister
Delinks a provider from a custom protocol proxy.
Syntax
bUnregistered = unregister(
oProvider
)
Parameters
- oProvider as ProviderStruct : Internal Provider Structure
Returns
bUnregistered as bit: Bit indicating the provider was unregistered as providing a proxy.
[ Hemi JavaScript Framework - Stephen W. Cote, 2002 - 2011. ]