Attributes | Name and Description |
---|---|
|
caplin.services.testing.RecordStub(String subject, Object initialFieldData, Array generators)
Created by caplin.services.testing.MessageServiceStub as a representation of a record that can be subscribed to. |
Attributes | Name and Description |
---|---|
<static>
|
caplin.services.testing.RecordStub.EVENTS
A map of events that this class may trigger. |
Attributes | Name and Description |
---|---|
|
void
addDataGenerator(caplin.workbench.model.DataGenerator generatorToAdd)
Adds a caplin.workbench.model.DataGenerator to this record, which will then be used to auto-generate data updates, using the record's initial values as seeds. |
|
void
clearUpdateInterval()
Stops this record from providing automatic updates. |
|
Map
getFieldData()
Gets a map of all the record's fields and their values. |
|
Number
getPausedSubscriptionCount()
Returns the number of paused subscriptions there are for this record. |
|
caplin.services.messaging.SubscriptionStatus
getStatus()
Gets the current status of the record. |
|
String
getSubject()
Gets the subject that maps to this record. |
|
Number
getSubscriptionCount()
Returns the number of subscriptions there are for this record. |
|
void
removeDataGenerator(caplin.workbench.model.DataGenerator generatorToRemove)
|
|
void
setErrorType(@link caplin.services.messaging.SubscriptionError errorType)
Sets the error type of this record, and then informs all listeners of the change. |
|
void
setFieldData(Map dataUpdates)
Sets new values for fields on this record, and then informs all subscribers of the change. |
|
void
setStatus(caplin.services.messaging.SubscriptionStatus status)
Sets the status of the record {@see caplin.services.messaging.SubscriptionStatus}. |
|
void
setUpdateInterval(Number intervalPeriod)
Sets the update rate of generated data for this record {@see caplin.services.testing.RecordStub#addDataGenerator}. |
►
caplin.services.testing.RecordStub(String subject, Object initialFieldData, Array generators)
Created by caplin.services.testing.MessageServiceStub as a representation of a record that can be subscribed to. Used to send updated field data to subscribers, and to monitor the number of subscriptions made for the record's subject.
This class uses emitr.
String | subject | The subject for this record |
Object | initialFieldData | Data fields that will be sent to component when it subscribes. If provided, these will also be editable by user in workbench tool. |
Array | generators | List of data generators. |
►
<static>
caplin.services.testing.RecordStub.EVENTS
A map of events that this class may trigger.
Contains the following events:
{Map} | updatedFields | A map of field names to their new values. |
caplin.services.testing.RecordStub | record | The record stub that fired the event. |
caplin.services.messaging.SubscriptionError | type | The error type. |
►
void
addDataGenerator(caplin.workbench.model.DataGenerator generatorToAdd)
Adds a caplin.workbench.model.DataGenerator to this record, which will then be used to auto-generate data updates, using the record's initial values as seeds. The update rate can be set using caplin.services.testing.RecordStub#setUpdateInterval.
caplin.workbench.model.DataGenerator | generatorToAdd | The data generator that should be used to generate auto updates for this record. |
►
void
clearUpdateInterval()
Stops this record from providing automatic updates.
►
Map
getFieldData()
Gets a map of all the record's fields and their values.
►
Number
getPausedSubscriptionCount()
Returns the number of paused subscriptions there are for this record.
►
caplin.services.messaging.SubscriptionStatus
getStatus()
Gets the current status of the record.
►
String
getSubject()
Gets the subject that maps to this record.
►
Number
getSubscriptionCount()
Returns the number of subscriptions there are for this record. This includes both active and paused subscriptions.
►
void
removeDataGenerator(caplin.workbench.model.DataGenerator generatorToRemove)
caplin.workbench.model.DataGenerator | generatorToRemove | The data generator that should no longer be used to generate auto updates for this record. |
►
void
setErrorType(@link caplin.services.messaging.SubscriptionError errorType)
Sets the error type of this record, and then informs all listeners of the change.
@link caplin.services.messaging.SubscriptionError | errorType | The type of error that this record is in. |
►
void
setFieldData(Map dataUpdates)
Sets new values for fields on this record, and then informs all subscribers of the change.
Map | dataUpdates | A map of new field values. |
►
void
setStatus(caplin.services.messaging.SubscriptionStatus status)
Sets the status of the record {@see caplin.services.messaging.SubscriptionStatus}.
caplin.services.messaging.SubscriptionStatus | status | The new status of this record. |
►
void
setUpdateInterval(Number intervalPeriod)
Sets the update rate of generated data for this record {@see caplin.services.testing.RecordStub#addDataGenerator}.
Number | intervalPeriod | The time in milliseconds between auto-generated data updates for this record. |