Apama 10.3 | Apama Capital Markets Foundation Documentation | Capital Markets Foundation | Analytics | Using the position service framework | Implementing custom position trackers | Actions custom trackers must implement
 
Actions custom trackers must implement
In your custom position tracker, you must create an instance of PSTrackerInterface and use it to implement the following actions. When you register your custom position tracker with the position service manager, you pass this interface object as one of the arguments. The position service manager will use this object to communicate with your custom position tracker. See ApamaDoc for details about the parameters required by each of these actions.
The actions your custom tracker must implement are:
*createInstance() – The position service manager calls this action for every new subscription request. Your custom position tracker must determine whether this subscription is the same as an existing subscription. If there is no matching subscription then your application must create a new instance of your custom tracker and return the subscription Id for the new tracker instance. If there is a matching subscription then your custom tracker can use the existing instance of the tracker and so return the Id for the existing matching subscription. This lets your tracker use the same tracker instance for multiple subscriptions. After creating a new tracker instance or determining that a suitable one already exists, your custom tracker must call the completion callback action, which provides the subscription Id and an indication of success or failure. The mechanism and criteria to determine whether a requested subscription is a duplicate of an existing subscription is user-defined.
*deleteInstance() – The position service manager calls this action when it receives an unsubscribe request and there is only one subscription remaining for that tracker instance. Your custom tracker must delete the specified custom tracker instance and then call the completion callback action, which indicates success or failure.
*deleteAllInstances() – The position service manager calls this action when deletion of all custom tracker instances is required. For example, your application is shutting down and you want to clean up state information held by each custom tracker instance. Your custom tracker must delete all tracker instances and then call the completion callback action, which indicates success or failure.
*positionExternallyReset() - The position service manager calls this action when there is a request to manually set the position being tracked to zero. Your custom tracker must set the specified subscription's position to zero and call the completion callback action, which indicates success or failure.
*positionExternallyUpdated() - The position service manager calls this action when there is a request to manually adjust the position being tracked by a relative or absolute amount. Parameters to this action include the amount of the position change and whether the position should be set to this amount (absolute) or this amount should be added to the current position (relative). There is also a parameter that can contain any additional configuration required to adjust the position. Your custom tracker must update the particular subscription's position as specified and call the completion callback action, which indicates success or failure.
See also Sample code for implementing a custom position tracker.

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.