The endpoint profile is a structured data set of an arbitrary complexity that describes the endpoint's characteristics. The endpoint profile is used to classify endpoints into endpoint groups. The profile is comprised of the service part and the custom part. The service part is identical across the applications and is used by Kaa internally for its functions. The custom part is defined by the application developer and is unique to application.
The endpoint profile is initially generated at the stage of a new endpoint registration. The profile values are specified by the client developer using Kaa EP SDK. The endpoint profile can be updated in run time as a result of a change in the client's operating conditions or user's actions. In this case, the endpoint membership in the endpoint groups is re-evaluated and updated to match the new profile.
The endpoint profile is unidirectionally synchronized, and thus should not be considered as a means to temporarily store client data in the server. There is no way for the endpoint to retrieve the profile information back from the server. At the moment of its start the client must fill in the current endpoint profile with the up-to-date data. It is the responsibility of the client code to generate or read the profile data. The endpoint SDK does not persist the profile information across the client reboots. However, it detects profile data changes and submits the new data to the server with a profile update.
The custom part of the endpoint profile is based on a specific Avro-based profile schema created by the Kaa developer. The schema defines the data structure to be used across multiple endpoints, while the profile itself specifies the value of each field in this structure for the individual endpoint - its unique characteristics.
The profile data structure is defined with the Apache Avro schema format. Profile schema supports all of Avro features: primitive types, complex types, arrays, maps, etc.
Profile schemas are maintained within the application scope. Every new schema has its own version so that it can be distinguished from the previous ones. Once created, profile schema must be configured into the Kaa server (which does not require any system downtime). Multiple schema versions and endpoint profiles created upon those schemas can coexist within a single application. To update a client to a newer schema version, it is necessary to regenerate the EP SDK and recompile the client application.
Here is a simple example of the profile schema definition:
An example profile that adheres to the schema above would be something like:
Such schema structure allows filtering the endpoints by the owner's country (to show only USA news), or city (to push weather notifications only for the specified city) or age (to apply age restrictions). One could also filter based on one (or several) of his hobbies (to push football scores for those whose hobby list contains "football").
Endpoint profile update
When the profile information changes as a result of the client operation or user's actions, it is the client implementation responsibility to update the profile via the EP SDK API calls. EP SDK detects profile changes by comparing the new profile hash against the previously persisted one. Should there be a change, the EP profile management module passes it to the Operations server. Operations server updates the EP profile information in the database and revises the EP groups membership.
The service part of the endpoint profile is used by Kaa internally for its functions and contain the following information:
|Endpoint Public Key||Public key that is used for security purposes in order to validate endpoint requests|
|Profile Hash||Hash of custom profile part that is used to validate all endpoint requests|
|Configuration Hash||Hash of endpoint configuration that is used to validate endpoint configuration requests|
|Version info||Version Info object includes versions of profile, configuration and notification schemes, as long as versions of event class families.|
|Server Key Hash||Hash of server that was used during last endpoint request|