Notifications and Autoanalysis
Concepts and methods of the notification system
Avi
Blackmore
Head Programmer/Administrator
2014
Agri ImaGIS Technologies, Inc.
Table of Contents
IntroductionThe Satshot system can store a great deal of information about a customer's operations, as detailed in other sections of this document. Keeping track of the changes to that
data can be daunting. To help with this task, as well as provide a more powerful means of dealing with client-side storage of this data, Satshot now provides the
notifications subsystem, which provides mechanisms for clients to request an update of changed information from the server, without having to refetch known data. This is
more than just a simple logging feature, however; the notifications are intended to be human-readable records, as well as machine-readable updates. Moreover, the
notifications system has subsumed the iCue autoanalysis system, such that iCue jobs and alerts are now represented by notifications.
Notification Categories: What to ReportNotifications are, at base, data structures which represent a set of changes to the information visible to a user. Each notification has a base type, or category, which
represents which area of the user's visible data has changed. These notifications are generated automatically by the Satshot system whenever a change occurs, for each user
who could see the given change and is subscribed to that notification category. Users can opt to subscribe, or not, to each category individually, and assign settings
separately for each category.
An important fact about notifications is that they represent changes as they occur; later changes to the system may make a notification's data about the state of the system
"out of date", though this will be reflected in further notifications later on. For example, if a dataset is created, and then deleted, the fact that the dataset was created
will be reflected in a notification, even though the dataset no longer exists; the deletion will also be part of a notification, however (possibly the same one).
There are, at present, eight categories of notifications:
- groups: Creation of new groups, or changes to group information, fall into this category, as well as changes to a group's privileges or pricing plan, if the group
is a customer group.
- users: Like groups, creation of new users or changes to user information, privileges, and other settings, are considered part of this category.
- regions: This category covers creation of new regions, changes to region information (name and description) or mappings between regions and objects, and deletion of
regions. NOTE: when an object is created (see 'objects' category), the new mapping will show up as an event in this category.
- objects: Creation, update, and deletion of geoobjects, and changes to their access controls. Does not cover changes to the mappings between regions and objects
(that is in the 'regions' category).
- datasets: New datasets, changes to datasets, or removal of datasets. This includes analyses, edited images, vectors of all types, and geotagged photos.
- fielddata: New fielddata records and new mappings between datasets and fielddata.
- financials: Financial transactions of any type are covered by this category.
- icue: Autoanalysis events. This covers both new matches between scenes and boundaries, and completion of autoanalysis jobs.
Notification Modes: When to NotifyGetting notifications of changes is a valuable tool, but if the system were to generate a new notification message every time a change occurred, for "high-level" users who
managed a large number of subgroups and users, this could become an unmanageable load. To deal with this problem, the notification system supports two "modes" of notifying
users. These modes can be set individually for each category of notification.
The first mode, "immediate" mode, is simple: whenever a visible change occurs, the system generates a new notification. If a user creates five new users, they will
receive five new notifications in the "users" category; if they analyze five objects, they will receive five new "datasets" notifications. Each independent operation that
they perform, or other users working with data visible to them perform, generates a new notification. This mode has the advantage of being "real-time", and thus the user's
client program is never out of date. The disadvantage, of course, is the aforementioned overwhelming flood of information for higher-level users.
The other mode available is "digest" mode. In this mode, notifications are generated on a set schedule, with change events collected over an interval and then sent out in
one notification. The digest's interval can be set to daily, weekly, or monthly updates; for each interval, the specific time of day, day of the week, and/or day of the
month for delivery can be set. These settings combine in the following way: time of day is always relevant, whereas if the interval is weekly, the day of week is considered,
while for monthly intervals the day of the month is considered. In any case, when the interval elapses, the changes that have been logged for the given category will be
collected into a notification, and that notification will be made visible to the user. Any changes that occur after that point will be part of a new digest.
Note: because months have different lengths, the delivery date for monthly notifications may be slightly different if the day of month is set to a number that isn't present
in all months: for instance, asking for monthly digests to be delivered on the 31st will have them delivered on the 30th of April, June, September, and November, the 28th of
February in non-leap years (29th in leap years), and the 31st of all other months. Similarly, asking for the 29th will have delivery on the 28th for non-leap years in
February, otherwise on the 29th. Client programs do not need to worry about handling this case, but should inform users in their documentation.
Working With NotificationsNotifications are retrieved using the method get_notifications(). This method returns all of the notifications fitting the given criteria. Notifications do not
change once retrieved, so a client can feel free to cache this information. An exception is if the server was informed that the notification was viewed (however a client
chooses to define "viewing") or deleted (hidden) using the method update_notifications(). In that case, the changes will be reflected in the notification record on
the server, and the client may wish to refetch the given notification (possibly with reduced information via the "attribspec" facility).
(That said, these changes are not very significant: in the former case, the viewing time of a notification is mostly of use for clients anyway, and the server-side value is
only significant if multiple client programs are working with the same user's notifications, and in the latter case, the notification set to hidden will not be visible to
other clients working with the same user's notifications, and so the client that set the given notification to be hidden can just delete the local copy, or however the client
programmer wishes to handle this).
At present, users may only see and work with their own notifications.
Users can view their notification settings with get_my_user_info(), and change them with update_user_info(). The settings include the categories subscribed,
the notification mode, the digest interval and delivery time (only relevant for digest mode, but set in any case), and whether or not the user wishes to receive an email for
this category of notification.
iCue Notifications and AutoanalysisWith the release of this new notification subsystem, the autoanalysis subsystem has been subsumed into it. Autoanalysis jobs are now part of notifications, and are available
as part of "match" records, which are created when a scene is matched against a set of boundaries. Match records are persistent, and jobs can be "spawned" from them at any
time, allowing users to rerun automated analysis on the same match as many times as they wish. When jobs run to completion, this also generates notifications, which contain
"completion" records that provide the analysis data. This mechanism means that it is no longer necessary to retrieve jobs explicitly, or expose those jobs to users through a
client's user interface.
When new scenes are added to the Satshot archive, a new match for each scene will automatically be created for users who are subscribed to boundaries within the given scene,
and that match record will either trigger a new notification, or be added to an existing digest, as appropriate for the user's settings. If the user wishes to search the
existing archive for matches, however, the client can call search_and_prepare_autoanalysis_matches_and_jobs(), which will generate a new notification with matches and jobs
for each of the given scenes and boundaries. Or, if they wish to take existing matches and prepare new jobs for them, clients can call
prepare_new_autoanalysis_jobs_from_matches().
Jobs are approved to run using approve_autoanalysis_jobs(), and deleted using clear_autoanalysis_jobs(), regardless of which method was used to create them.
Once the jobs complete, the completion records in the generated notification provide the ids and info on the new analyses, which can be reloaded using
reload_multiple_saved_analyses(), and the resulting images exported, or further processed using any of the other facilities provided by the API.
Autoanalysis PresetsThe settings used for autoanalysis jobs by the iCue processor are retrieved from user account information. These presets are available in a call to
get_my_user_info(), and can be set via update_user_info(). Presets include analysis types, mode, number of zones, and color table to use. These presets will be
used automatically for every job, unless overridden by the client software. Client software writers should feel free to present an interface to users to allow them to
override the settings for a particular job when approving it, but should NOT override settings for jobs without user interaction and approval. Client programs should also provide
an interface to modify the user's presets.
Method ReferenceNotification settings and retrieval:
| Prev |
Up |
Next |
| Fielddata Records |
Understanding and Using the Satshot Services API, Version 2 |
Attributed CLUs |
|
|