See CustomTopicData
.
@Deprecated public abstract class AbstractCustomTopicDataHandler extends Object implements CustomTopicDataHandler
CustomTopicDataHandler
provides
empty implementations of some of the optional methods thus simplifying the
requirements of an implementation class.
setTopicData(CustomTopicData)
is provided as an empty method and
only needs to be overridden if the class wants to keep a reference to the
owning CustomTopicData
.
initialise(TopicMessage)
is provided in a form that will throw an
exception if called and so would need to be overridden if initialisation
from a message was required.
prepare()
is provided as an empty method and only needs to be
overridden if special processing is required at this stage.
update(TopicMessage)
is provided in a form that will throw an
exception if called and so would need to be overridden if update from a
message was required.
Constructor and Description |
---|
AbstractCustomTopicDataHandler()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
initialise(TopicMessage message)
Deprecated.
This is called if
PublishingTopicData.initialise(TopicMessage) is
used. |
void |
prepare()
Deprecated.
This is called when the topic data that specifies the handler is attached
to a topic.
|
void |
setTopicData(CustomTopicData topicData)
Deprecated.
This is called when the data is first created to notify the handler of
the data it is associated with.
|
boolean |
update(TopicMessage message)
Deprecated.
This will be called to update the state of the data from an incoming
delta Message.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
abortUpdate, asString, endUpdate, hasChanges, populateDelta, populateTopicLoad, startUpdate
public AbstractCustomTopicDataHandler()
public void setTopicData(CustomTopicData topicData)
CustomTopicDataHandler
setTopicData
in interface CustomTopicDataHandler
topicData
- the topic datapublic void initialise(TopicMessage message) throws APIException
CustomTopicDataHandler
PublishingTopicData.initialise(TopicMessage)
is
used.
The handler must parse the message and initialise its state accordingly.
This would only be called before the data is attached to a topic.
initialise
in interface CustomTopicDataHandler
message
- the message to initialise fromAPIException
- if unable to initialisepublic void prepare() throws APIException
CustomTopicDataHandler
This may be used to perform initialisation processing, possibly setting the initial state if it has not already been
prepare
in interface CustomTopicDataHandler
APIException
- to notify a failure. If an exception is thrown the
topic will not be createdpublic boolean update(TopicMessage message) throws APIException
CustomTopicDataHandler
This is called as a result of
PublishingTopicData.update(TopicMessage)
being called.
This will be called one or more times after a call to
CustomTopicDataHandler.startUpdate()
. It should apply the update to the currently held
copy of the topic state.
This method must parse the message and update the state accordingly.
update
in interface CustomTopicDataHandler
message
- the incoming message that is to be used to update the
state of the dataAPIException
- may be returned to indicate failure to update the
dataCopyright © 2016 Push Technology Ltd. All Rights Reserved.