This topic type will be removed in a future release
@Deprecated public interface PagedRecordTopicData extends PagedTopicData, TopicDataWithMetadata
PagedTopicData
where each line of the page is defined as a
Record
.
All records must have the same metadata
which can be created
using
MetadataFactory.newRecordMetadata(String)
.
An instance of this type of data can be created using
TopicDataFactory.newPagedRecordData(MRecord)
.
PagedTopicData.Duplicates
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
List<Record> lines)
Deprecated.
Add (insert) one or more lines to the data at the specified index.
|
void |
add(int index,
Record line)
Deprecated.
Add (insert) a line to the data at the specified index.
|
void |
add(List<Record> lines)
Deprecated.
Add one or more lines to the data.
|
int |
add(Record line)
Deprecated.
Add a line to the data.
|
void |
add(TopicMessage message)
Deprecated.
Adds data from a message.
|
Record |
get(int index)
Deprecated.
Get the value of the line at the specified index.
|
Record |
get(Record line)
Deprecated.
Get the value of the line that matches the specified Record.
|
Comparator<Record> |
getComparator()
Deprecated.
If the data is
ordered then this will return the
comparator is use for ordering. |
List<Record> |
getLines()
Deprecated.
Returns the current values of all lines.
|
List<Record> |
getLines(int from,
int to)
Deprecated.
Returns the current values of all lines in a specified range.
|
List<Record> |
getLines(Record line)
Deprecated.
Returns the current values of all lines that match a specified line.
|
MRecord |
getMetadata()
Deprecated.
Returns the metadata that defines each line of the data.
|
Record |
remove(Record record)
Deprecated.
Removed the line that matches the supplied record from the data.
|
boolean |
update(int index,
Record line)
Deprecated.
Update the line at the specified index with a given value.
|
boolean |
update(Record line)
Deprecated.
Update the line that matches the specified Record with the specified
line.
|
getDuplicatesPolicy, getNumberOfLines, isOrdered, isPagedRecord, isPagedString, remove, setDuplicatesPolicy
getDeltaEncoding, getLoadEncoding, getLoadMessage, getLoadMessage, getTopic, getType, hasSubscribers, isCommand, isLockedByCurrentThread, isPaged, isPublishing, isRouting, isService, lock, setDeltaEncoding, setLoadEncoding, unlock
getMetadataNode, isMetadataMandatory, setMetadataNode
MRecord getMetadata()
Comparator<Record> getComparator()
ordered
then this will return the
comparator is use for ordering.void add(TopicMessage message) throws TimeoutException, APIException
It is assumed that the message comprises one or more Records, each
defining a line of data. This is then effectively the same as a call to
add(List)
(and therefore cannot be used for ordered
data).
message
- the Message to parse the data from.TimeoutException
- if the lock
timeout
period for the Topic has been exceeded whilst waiting to
obtain a lock on the data.APIException
- if add fails.int add(Record line) throws TimeoutException, APIException
If the data is ordered
then the line will be
inserted in the correct position according to the comparator
. If the data is not ordered then the line is added to the end
of the data.
If the data is not locked at the point of calling then it will be locked for the duration of the call.
line
- the line to addTimeoutException
- if the lock
timeout
period for the Topic has been exceeded whilst waiting to
obtain a lock on the dataAPIException
- if adding of line to data failed.void add(int index, Record line) throws TimeoutException, APIException
This may only be used for data that is not ordered
.
If called for ordered data then an exception will occur.
If the data is not locked at the point of calling then it will be locked for the duration of the call.
index
- the index (first is 0).line
- the line to add.TimeoutException
- if the lock
timeout
period for the Topic has been exceeded whilst waiting to
obtain a lock on the data.APIException
- if adding the line of data failed. This will occur
if this method is called for ordered data.void add(List<Record> lines) throws TimeoutException, APIException
For data that is not ordered
then the lines will be
added to the end of the data in a single operation. If this method is
called for ordered data then an exception will occur. To add many lines
to ordered data it is necessary to make repeated calls to
add(Record)
.
If the data is not locked at the point of calling then it will be locked for the duration of the call.
lines
- the lines to add.TimeoutException
- if the lock
timeout
period for the Topic has been exceeded whilst waiting to
obtain a lock on the data.APIException
- if adding lines failed.void add(int index, List<Record> lines) throws TimeoutException, APIException
This may only be used for data that is not ordered
.
If called for ordered data then an exception will occur.
If the data is not locked at the point of calling then it will be locked for the duration of the call.
index
- the index (first is 0) to add lines at.lines
- the lines to add.TimeoutException
- if the lock
timeout
period for the Topic has been exceeded whilst waiting to
obtain a lock on the data.APIException
- if adding of lines failed. This will occur if this
method is called for ordered data.boolean update(int index, Record line) throws TimeoutException, APIException
If the data is not ordered
then the line at the
specified index is replaced by the specified line. This method may not be
used for ordered data - instead use PagedTopicData.remove(int, int)
followed by
add(Record)
.
If the data is not locked at the point of calling then it will be locked for the duration of the call.
index
- the index of the line to updateline
- the new value. Specifying a value of null will remove the
line.TimeoutException
- if the lock
timeout
period for the Topic has been exceeded whilst waiting to
obtain a lock on the data.APIException
- if update failed.boolean update(Record line) throws TimeoutException, APIException
This method may only be used for ordered
data. If
called for unordered data then an exception will be thrown.
This is functionally equivalent to calling remove(Record)
followed by add(Record)
in the same update block.
line
- the record that is used to locate the line to be removed and
that will be added as a new line.TimeoutException
- if the lock
timeout
period for the Topic has been exceeded whilst waiting to
obtain a lock on the data.APIException
- if update failed. This will occur if this method is
called for unordered data.Record remove(Record record) throws TimeoutException, APIException
The comparator
for the data is used to locate an
existing line within the data. If there is more than one line that would
match then the line located will be located according to the
duplicates policy
, either the first one or
the last one.
record
- the record to be used to locate the line to remove. This
does not have to be a full match for the line to remove, only a
match using the comparator.TimeoutException
- if the lock
timeout
period for the Topic has been exceeded whilst waiting to
obtain a lock on the data.APIException
- if unable to remove the line. This will occur if
this method is called for unordered data.Record get(int index)
Note that this returns the value at the index at the current point in time which may change unless the data is currently locked.
index
- the index (first is 0).Record get(Record line) throws APIException
This may only be called for ordered
data.
The getComparator()
is used to locate a match in the current
data. If there is more than one match then the line returned will be
selected according to the duplicates
policy
, either the first or the last.
line
- the line to use to locate an existing line.APIException
- if this is called for unordered data.List<Record> getLines()
Note that this returns a snapshot of the data at the current point in time which may change unless the data is currently locked.
List<Record> getLines(Record line) throws APIException
This may only be called for ordered
data.
The getComparator()
is used to locate all matches in the current
data. If the duplicates policy indicates that duplicates are not allowed
then this could only return a single line.
line
- the line to use to locate existing lines according to the
comparator
.APIException
- if this is called for unordered data.List<Record> getLines(int from, int to)
Note that this returns a snapshot of the data at the current point in time which may change unless the data is currently locked.
from
- the index of the first line to return. If this is negative
then 0 is assumed.to
- the index of the last line to return. If this is negative then
values to the end are returned. If this is less than the from
value then the from value is assumed.Copyright © 2016 Push Technology Ltd. All Rights Reserved.