Object configuration (part 1)
These Liberator configuration items define how Liberator deals with objects.
A Liberator object is a piece of data that Liberator manages on behalf of client applications; for example, a financial instrument such as a DataSource record containing a currency pair. Liberator object types include all the DataSource data types, and data types that are additional to StreamLink, such as the Chat type.
More object-related configuration can be found in Object configuration (part 2), Throttling, and Throttling Configuration.
add-object
add-object
adds an object name to Liberator and defines the object’s characteristics. The object is local to Liberator, which means it’s created in Liberator’s cache. It isn’t updated from any DataSource peers (Integration Adapters or Transformers) unless a) it’s a broadcast object that originates from a peer, or b) it’s a directory object (see DataSource > Directories and Directories below), in which case the data for the subjects subscribed to under that directory is supplied from the relevant peer(s).
Syntax:
add-object name [string] type [integer/string] discard-timeout [integer] flags [integer] no-batching [boolean] only-changed-fields [boolean] purge-age [integer] purge-period [integer] purge-time [integer] record-type3-history-size [integer] throttle-times [array of floats] timestamp-field [string] end-object
Option | Type | Default | Description | ||
---|---|---|---|---|---|
integer |
[See Description] |
The time in seconds for which the Liberator holds on to an object in the directory after the last user stops viewing it. After this time, the object is deleted from the Liberator’s cache and Liberator sends a discard instruction to the supplying DataSource peer to cancel the subscription to the object. This option overrides any settings of the The value defaults to the |
|||
integer |
|
Flags specifying additional characteristics for the object when it is created. Valid values are:
To specify both flags, use the value |
|||
string |
[none] |
The name of the object. For example, |
|||
boolean |
|
When Normally, when an update to a matching object is received, the update message is added to the queue of batched messages, and all messages in the queue are immediately sent to the client. The
|
|||
boolean |
|
This option only applies to record-based data or directories containing record-based data. You only need to consider setting this option if the Integration Adapter that supplies updates for the records of interest doesn’t itself transmit just the changed fields. Normally you’d implement Adapters so that they only transmit update information about record fields that have changed, so you wouldn’t need to set When Where there are many fields that are infrequently updated, the size of the message transferred to client is reduced. However, this feature might require increased server resources and might not be suitable when the majority of fields are frequently updated. Examples: 1) This setting applies to a single record, whose subject is add-object name /B/Record1 type record only-changed-fields TRUE end-object 2) This setting applies to all the records under a single directory called add-object name /Dir1 type directory only-changed-fields TRUE end-object |
|||
integer |
|
This option only applies to directory objects. How old in minutes objects in the directory need to be before they can be removed from Liberator’s cache. Every purge-period minutes past purge-time, Liberator checks its cache to see which of the directory’s objects can be deleted. When When For more about purging directories, see How can I… Control when Liberator purges its object cache. |
|||
integer |
(= |
This option only applies to directory objects. How often in minutes, relative to purge-time, objects in the directory are removed from Liberator’s cache. Every For more about purging directories, see How can I… Control when Liberator purges its object cache. |
|||
integer |
(meaning never purge the directory on a timed basis, so purge-age and purge-period are ignored) |
This option only applies to directory objects. The time when the Liberator is to start purging the objects in the directory by deleting them from its cache. This time is the number of minutes after midnight (local time) on the day the Liberator was started, or if the time’s greater than or equal to At Use this option in conjunction with purge-period and optionally purge-age, to purge directories at regular intervals. For more about this, see How can I… Control when Liberator purges its object cache. |
|||
integer |
Value of |
This option only applies to record objects containing type 3 data (the history of updates to the record). Maximum number of type 3 data updates to keep for this object / object hierarchy. This option overrides (for this object or object hierarchy only) the setting of record-type3-history-size. |
|||
array of floats and strings |
Value of object-throttle-times |
An array of throttle times in seconds that apply to the object defined by this This option overrides the default object throttle time configured by object-throttle-times. The default object throttling time is 1.0 second. To turn off object throttling by default, set object-throttle-off to Acceptable values:
The array must be in ascending order of throttle times. If you use Although this option can accept a series of space-separated throttle times, more than one throttle time is rarely required. Example use: |
|||
string |
No timestamp field is defined for this object |
The name of a field into which Liberator adds a millisecond timestamp to this object for the purposes of latency measurement. The timestamp allows a client application to calculate the time taken for the record represented by the object to be transmitted to it from this Liberator. Liberator only adds the This timestamping facility is independent of, the latency chain timestamps, and it isn’t controlled by the setting of the latency-chain-enable configuration item. This option overrides the global timestamp-field configuration item for this object only. |
|||
string or integer |
[none] |
The object type, as either the object type name or the object type number. For the list of valid values, see Object types and object numbers below. Examples: |
Object types and object numbers
Here’s the list of valid object type names, and their corresponding object numbers, that can be specified in the type option of add-object:
Object type name | Object type number | Description | For more information, See: |
---|---|---|---|
|
Chat object |
||
|
|
Container object |
DataSource Containers |
|
|
Directory object |
DataSource Directories |
|
|
News headline object |
DataSource News headlines and news stories |
|
|
Page object |
DataSource Pages |
|
|
Permission object |
DataSource Permissions |
|
|
Record object |
DataSource Records |
|
|
News story object |
DataSource News headlines and news stories |
Directories
Use add-object
to configure a directory with specific characteristics. For example, to create a directory called /TRADE
, define an add-object
entry with the name option set to /TRADE
and the type option set to directory
, and with the other options set as required. Then define a data service with an include-pattern of ^/TRADE
(see add-data-service). When Liberator users subscribe to /TRADE
they’ll receive objects, under the directory /TRADE
, that a DataSource peer configured for the data service has sent to the Liberator, such as records with the subjects /TRADE/ABC
, /TRADE/DEF
, and so on.
If an object is defined as a directory, all objects that are subsequently subscribed to under that directory inherit the configuration options that were defined in the add-object
for the directory.
See also:
-
Reference: Object configuration (part 2)
-
How can I… Control when Liberator purges its object cache.