Methods
(async) guarded_dynamic_asset_handler(asset, body, transmision_headers) → {Array}
This method calls the method guarded_kindof_asset_handler with the reference to the GeneralDynamic instance
in the member variable dynamics.
Parameters:
| Name | Type | Description |
|---|---|---|
asset |
string | |
body |
object | |
transmision_headers |
object |
- Source:
Returns:
- a tupple really, that has: 1) the status code, 2) the JSON response, 3) possibly data or boolean (false for not in use)
- Type
- Array
(async) guarded_kindof_asset_handler(asset, body, transmision_headers, fetcher) → {Array}
This method provide the same logic for both dynamic and static data. The only difference between a request for dynamic and static data, is that the fetcher method is on the static or dynamic instance. So, this method takes the fetcher as a paremeter.
For both dynamic and static mime data, the session managers' guard is called. And, if the request passes the guard, then the asset can be processed in the sense that a token object will be made for it by the session manager. The transition object will specify whether or not the mime data will be cached and sent after a seconday transaction or if it will be sent right away.
If the secondary action is used, the transition object components that are to be used by the requester (client) are sent along with the repsonse object.
Parameters:
| Name | Type | Description |
|---|---|---|
asset |
string | |
body |
object | |
transmision_headers |
object | |
fetcher |
function |
- Source:
Returns:
- a tupple really, that has: 1) the status code, 2) the JSON response, 3) possibly data or boolean (false for not in use)
- Type
- Array
(async) guarded_secondary_asset_handler(body) → {Array}
When the transition object returned from the session manager's process_asset method requires the secondary_action,
it sets up the transition object in cache with the anticipation that this method will be called in response to
another request from the client tied to the current session and the transition token set on the transition object by process_asset.
This method will only operation if the request's body object has a recognizable token field. Given the token, the cached transition object can be retrieved from the cache. Once it is in hand, the data from the body object and the cached can transtion are passed to the application's matching methods to see if the body data passed tests allowing the request to gain access to previously produced data.
For the mime type handlers, key_mime_type_transition can be used to see if the requested mime type is supported by the application.
Given the tests pass, the data field of the cached transition is accessed to get the data that will be provided to the requesting client.
Parameters:
| Name | Type | Description |
|---|---|---|
body |
object |
- Source:
Returns:
- a tupple really, that has: 1) the status code, 2) the JSON response, 3) possibly data or boolean (false for not in use)
- Type
- Array
(async) guarded_static_asset_handler(asset, body, transmision_headers) → {Array}
This method calls the method guarded_kindof_asset_handler with the reference to the GeneralStatic instance
in the member variable statics.
Parameters:
| Name | Type | Description |
|---|---|---|
asset |
string | |
body |
object | |
transmision_headers |
object |
- Source:
Returns:
- a tupple really, that has: 1) the status code, 2) the JSON response, 3) possibly data or boolean (false for not in use)
- Type
- Array
(async) static_asset_handler(asset, body, transmision_headers) → {Array}
This method sends the request body into session manager's guard_static to check access.
Then, if access is allowed, this method calls upon the statics module to get the object.
The statics module returns an object that should mention the mime type of the data along with the data. The object returned must have two fields:
mime_type- the kind of media being returnedstring- the media being returned in string format
The application must understand the relationship between the client and the server in how data delivered as a string should be processed for use.
Parameters:
| Name | Type | Description |
|---|---|---|
asset |
string | an identifier of the asset requested |
body |
object | data relating to the user session and other data useful in finding the asset and establishing access |
transmision_headers |
object |
- Source:
Returns:
- a tupple really, that has: 1) the status code, 2) the JSON response, 3) possibly data or boolean (false for not in use)
- Type
- Array