Cisco Cisco MediaSense Release 9.0(1) Developer's Guide

Page of 136
The expected sequence is that the client application can request a list of “pruned” sessions. It may then display the metadata of interest from
those sessions. Finally the user can select one or more of the pruned sessions to be deleted.
The first step can be done with a query like: “Find all sessions whose pruned status is “true” that were started in the last two days.” Like
always, use a reasonable time window to make the query scalable. Since the pruning uses an age based mechanism, you will want to look at
least a day prior to today. If this is not being done on a daily basis, you may want to limit the time window to about a day. This will depend
upon traffic at the site. You don’t want the query returning more than about 100 sessions at a time. This may require some testing.
The client should then repeat this operation for each prior day until you have searched back to the last day you previously performed this
operation. The client may then present the list to the user and ask that he select the sessions to be deleted (possibly giving a “delete all”
option as well). The client will then use the deleteSessions method of the API to submit a job to delete the selected sessions. There is no
scalability issue in this case as the deleteSessions method serializes the deletion of each session.
In order to monitor the progress of the deletions, the client should use the event mechanism. As each session is deleted, a session event will
be generated with an event type of “deleted”.
Examples for getSessions
Example 1
Query: Get all sessions where ( ( tagName = "foo" and sessionStartDate is between Nov 2, 2010 21:21:40 & Nov 3, 2010 21:21:40 ) or (
deviceRef = "1000" and sessionState = "active" ) )
HTTP POST:
https://10.194.118.1:8440/ora/queryService/query/getSessions
Headers:
Content-Type: application/json
JSESSIONID: <the jsessionId received from a signIn request>
Body:
 
102