@Deprecated public interface PagedTopicData extends CommandTopicData
Such data is conceptually made up of 'lines'. The content of each line will
depend upon the type (e.g. PagedRecordTopicData
has one
Record
per line). Lines of
data may be added, removed or updated at any time. Each Client that uses the
Topic may then have a 'paged' view of the data. A Client will indicate the
number of lines per page it wishes to have in its view. The Client may then
request any page of the available data and will be notified when the data
changes (specifically the page it currently has selected).
Lines within the data may be unordered or ordered. If ordered then the
ordering is enforced by a supplied Comparator. When ordered the addition of
multiple lines is treated as multiple single additions and therefore may be
less efficient. When data is ordered the
duplicates policy
determines how
lines that are determined to be equal using the comparator are handled.
Special message types and formats are used for handling such a Topic and so
at the Client end messages are not handled in the normal way. In the Java
Client API the use of such a Topic is enabled by the use of a
PagedTopicHandler
.
All updates done to Paged data (add, update remove etc) commit the change
immediately. In order to prevent changes to the data from other threads
whilst manipulating it then the
Topic Lock
should
be acquired.
Modifier and Type | Interface and Description |
---|---|
static class |
PagedTopicData.Duplicates
Deprecated.
Specifies the Duplicates handling policy when operating in
ordered mode. |
Modifier and Type | Method and Description |
---|---|
PagedTopicData.Duplicates |
getDuplicatesPolicy()
Deprecated.
Returns the duplicates policy.
|
int |
getNumberOfLines()
Deprecated.
Returns the current number of lines within the data.
|
boolean |
isOrdered()
Deprecated.
Indicates whether the lines within the data are maintained in a sorted
order according to a specified Comparator.
|
boolean |
isPagedRecord()
Deprecated.
Indicates whether this is type
PagedRecordTopicData . |
boolean |
isPagedString()
Deprecated.
Indicates whether this is type
PagedStringTopicData . |
int |
remove(int index,
int number)
Deprecated.
Removes one or more lines from the data.
|
void |
setDuplicatesPolicy(PagedTopicData.Duplicates policy)
Deprecated.
Set the duplicates policy for
ordered data. |
getDeltaEncoding, getLoadEncoding, getLoadMessage, getLoadMessage, getTopic, getType, hasSubscribers, isCommand, isLockedByCurrentThread, isPaged, isPublishing, isRouting, isService, lock, setDeltaEncoding, setLoadEncoding, unlock
boolean isPagedRecord()
PagedRecordTopicData
.boolean isPagedString()
PagedStringTopicData
.int getNumberOfLines()
This returns the number of lines at the point when the method is called which may change unless the data is currently locked.
int remove(int index, int number) throws TimeoutException
If the data is not currently locked then it will be locked for the duration of the call.
index
- the first index to remove. If this is negative then 0 is
assumed. If this is beyond the last line then no lines are
removed.number
- the number of lines to remove. If this is negative or more
than the number of lines after the specified index then all lines
to the end are removed.TimeoutException
- if the lock
timeout
period for the Topic has been exceeded whilst waiting to
obtain a lock on the data.boolean isOrdered()
void setDuplicatesPolicy(PagedTopicData.Duplicates policy) throws APIException
ordered
data.
This only has meaning for ordered data, if called for unordered data then it is ignored.
This must be called before the data is attached to a topic.
If not explicitly called then PagedTopicData.Duplicates.NOT_ALLOWED
is assumed.
policy
- the duplicates policyAPIException
- if unable to set the policyPagedTopicData.Duplicates getDuplicatesPolicy()
The policy is only relevant for ordered
data.
setDuplicatesPolicy(Duplicates)
Copyright © 2016 Push Technology Ltd. All Rights Reserved.