public interface RecordMessage extends Message
Base interface for all Record messages.
You do not need to implement this interface. Instead use one of its derived interfaces:
Objects implementing these interfaces cannot be instantiated directly, but can be constructed
using the MessageFactory
that is available on the
Publisher
interface.
Modifier and Type | Method and Description |
---|---|
void |
addLatencyChainPoint(java.lang.String pointName,
long milliseconds)
Adds a latency chain point
|
void |
clearFields()
Removes all the fields previously added to this
RecordMessage |
boolean |
containsField(java.lang.String fieldName)
Determines whether the message contains the specified field
|
java.lang.String |
getField(java.lang.String fieldName)
Gets the value of the specified field.
|
java.util.List<Field> |
getFields()
Gets the fields within this
RecordMessage . |
void |
removeField(java.lang.String fieldName)
Removes all occurrences of the given field from this
RecordMessage . |
void |
setField(java.lang.String fieldName,
java.lang.String value)
Sets a field value.
|
void |
setInitialLatencyChainTime(long milliseconds)
Starts a latency chain if enabled using the latencyChainManager configuration option.
|
getSubject, isImage, setImage
void clearFields()
RecordMessage
boolean containsField(java.lang.String fieldName)
fieldName
- Name of the field.true
if the message contains the field, otherwise, false
.java.util.List<Field> getFields()
RecordMessage
.void setField(java.lang.String fieldName, java.lang.String value)
Sets a field value.
If the field does not exist in this RecordMessage
, the field is added to it.
Otherwise the existing occurrence of the field is updated to the new value
.
fieldName
- The name of the field.value
- The new value of the field.java.lang.IllegalArgumentException
- Raised when the fieldName
is not defined in the Fields configuration
file.java.lang.String getField(java.lang.String fieldName)
Gets the value of the specified field. If the field does not exist in this
RecordMessage
, null
is returned.
fieldName
- The name of the field to get.fieldName
, or null if there is no
such field in this RecordMessage
.java.lang.IllegalArgumentException
- Raised when the fieldName
is not defined in the Fields configuration
file.void removeField(java.lang.String fieldName)
RecordMessage
.fieldName
- The name of the field to remove.void setInitialLatencyChainTime(long milliseconds)
Starts a latency chain if enabled using the latencyChainManager configuration option.
milliseconds
- The first time in the latency chain in milliseconds since midnight, January 1, 1970
UTC. This could be: the time the data was created; the time the data entered the
DataSource adaptor; or the time the data entered the DataSource API. The time is of
the same form as the value of System.currentTimeMillis()
.java.lang.IllegalStateException
- Raised when called twice on the same RecordMessage
instance.void addLatencyChainPoint(java.lang.String pointName, long milliseconds)
Adds a latency chain point
pointName
- The name associated with the latency measurement.milliseconds
- The timestamp in milliseconds since midnight, January 1, 1970
UTC. The time is of the same form as the value of System.currentTimeMillis()
.java.lang.IllegalStateException
- Raised when the initial timestamp has not be initialised.Please send bug reports and comments to Caplin support