The first time any user obtains a push-subscription for an application, UA server automatically creates a local agent to monitor the application for changes.The nature of the agent depends on application settings:
If the application has a non-Real Time Content Cache Interval set (the example in the Mobile Application Development Tutorial shows a 15 minute interval), the agent is created with a schedule to re-execute the application and look for changes at the same interval, and the agent starts immediately.
If the Content Cache Interval is left as Real Time (the default), the agent is created, but is left in the Stopped state.
The local agent looks the same as any agent created in Mobile Web Studio. You can edit them, start and stop them, and view their logs. Agents are described in the Unwired Accelerator Development Guide, but this section provides information that pertains to push agents.
Viewing push agents
From Mobile Web Studio, select Automate | Agents from the left pane.
Select Ready (or Stopped) from Agent Manager | Status in the middle the middle pane. The agents are listed in the right pane. Agent details include:
Name – the application name,
such as poll-employeeSales
.
Details
Owner – the application owner, such as masuper
.
Last Run – the date and time the agent last ran.
Last result– the result of the last agent run.
Next run – the date and time of the next scheduled run for the agent.
Right-click an agent in the right pane, such as poll-employeeSales, and select Edit. The Agent Builder window displays.
The Agent Builder works just as described in Unwired Accelerator Development Manager. Of special interest for push agents:
Schedule tab If the “Recurrence” setting should match the “Content Cache Interval” if it was set for the mobile application.
Action tab For the “Deliver” action, select the action and click Edit. The Action Details window displays. You can see details about how the agent runs:
Description – the description you entered.
Destination Viewer
User List Adapter – if an auto-filled adapter
is used, such as region
, select “push-registered
users” from the drop-down list. This enables UA server
to detect changes at the personalized content level for each subscribed
user.
Using the “push-registered users” user-list
feature can cause performance problems with the UA server if the
frequency of the agent is low, or the number of users is large.
Sybase recommends not using push subscriptions for applications
that use autofill adapters to personalize the application. That
way the agent can just execute the application once each time it
runs, in the context of a “default” user, and
generate notifications to all subscribers as data changes.
Destination set – Trash Can indicates that when the agent runs, the results are discarded.
Portlet set
Make modifications and click OK to save and exit, or click cancel to exit.
From Agent Builder, click Close to save the changes.
Each time the agent executes, the agent retrieves a list of all the users who are subscribed for push notifications on the application, and will execute the application as each of the users in turn, at each point checking to see if the data has changed since the last time. Whenever the data has changed, UA sends a notification only to those users who are monitoring for changes.