This topic type will be removed in a future release
@Deprecated public interface PagedStringTopicData extends PagedTopicData
PagedTopicData
where each line of the page is defined as a
String.
An instance of this type of data can be created using
TopicDataFactory.newPagedStringData()
PagedTopicData.Duplicates
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
List<String> lines)
Deprecated.
Add (insert) one or more lines to the data at the specified index.
|
void |
add(int index,
String line)
Deprecated.
Add (insert) a line to the data at the specified index.
|
void |
add(List<String> lines)
Deprecated.
Add one or more lines to the end of the data.
|
int |
add(String line)
Deprecated.
Add a line to the data.
|
void |
add(TopicMessage message)
Deprecated.
Add data from a message.
|
String |
get(int index)
Deprecated.
Get the value of the line at the specified index.
|
String |
get(String line)
Deprecated.
Get the value of the line that matches the specified string.
|
Comparator<String> |
getComparator()
Deprecated.
If the data is
ordered then this returns the
comparator in use for ordering. |
List<String> |
getLines()
Deprecated.
Returns the current values of all lines.
|
List<String> |
getLines(int from,
int to)
Deprecated.
Returns the current values of all lines in a specified range.
|
List<String> |
getLines(String line)
Deprecated.
Returns the current values of all lines that match a specified line.
|
String |
remove(String line)
Deprecated.
Removed the line that matches the supplied string from the data.
|
boolean |
update(int index,
String value)
Deprecated.
Update the line at the specified index with a given value.
|
boolean |
update(String line)
Deprecated.
Update the line that matches the specified String 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
Comparator<String> getComparator()
ordered
then this returns the
comparator in use for ordering.void add(TopicMessage message) throws TimeoutException, APIException
It is assumed that the message comprises one or more fields, 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(String 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 data.APIException
- if adding of line to data failed.void add(int index, String 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.void add(List<String> 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(String)
.
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<String> 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.boolean update(int index, String value) 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(String)
.
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 updatevalue
- 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(String 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(String)
followed by add(String)
in the same update block.
line
- the string 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.String remove(String line) 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
, first or last.
line
- the string 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.String 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).String get(String 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
, first or last.
line
- the line to use to locate an existing line.APIException
- if this is called for unordered data.List<String> 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<String> getLines(String 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 does not allow duplicates 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<String> 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.