<div dir="ltr"><p style="margin:15px 0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:14px;line-height:22px">Forget that.......</p><p style="margin:15px 0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:14px;line-height:22px">
For very device requires the following data:<br></p><ul style="margin:15px 0px;padding:0px 0px 0px 30px;border:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:14px;line-height:22px">
<li style="margin:0px;padding:0px;border:0px">token</li><li style="margin:0px;padding:0px;border:0px">os</li><li style="margin:0px;padding:0px;border:0px">type</li><li style="margin:0px;padding:0px;border:0px">version (of the OS)</li>
</ul><p style="margin:15px 0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:14px;line-height:22px">But... sometimes folks may want to store more (e.g. geo location data, username etc)...</p>
<p style="margin:15px 0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:14px;line-height:22px">Business related data should be stored in the &quot;business database&quot;, but to bridge between these worlds, the following (optional) attribute is needed:</p>
<ul style="margin:15px 0px;padding:0px 0px 0px 30px;border:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:14px;line-height:22px"><li style="margin:0px;padding:0px;border:0px">identifier</li>
</ul><div style><font color="#333333" face="Helvetica, arial, freesans, clean, sans-serif"><span style="font-size:14px;line-height:22px">That&#39;s all - everything else is app specific and should NOT be stored in the database that stores the tokens. </span></font></div>
<div style><font color="#333333" face="Helvetica, arial, freesans, clean, sans-serif"><span style="font-size:14px;line-height:22px"><br></span></font></div><div style><font color="#333333" face="Helvetica, arial, freesans, clean, sans-serif"><span style="font-size:14px;line-height:22px"><br>
</span></font></div><div style><font color="#333333" face="Helvetica, arial, freesans, clean, sans-serif"><span style="font-size:14px;line-height:22px">I guess you would also never store the salary in there (if the push server would back a mobile HR app :))</span></font></div>
<div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 17, 2013 at 12:24 PM, Matthias Wessendorf <span dir="ltr">&lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">on a side note... since the data the device sends to the &quot;push server&quot; / &quot;registration database&quot;, may differ (from case to case)...</span><div>

<span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">I think having a flexible (read: schemaless) database for the &quot;model&quot; would be good...</span><br>

</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">On Wed, Apr 17, 2013 at 10:39 AM, Matthias Wessendorf <span dir="ltr">&lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt;</span> wrote:<br>

</div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p style="line-height:20px;margin-right:0px;font-size:13.63636302947998px;margin-left:0px;margin-bottom:15px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px!important">

Hi folks!</p>
<p style="line-height:20px;margin-right:0px;font-size:13.63636302947998px;margin-left:0px;margin-bottom:15px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px!important"><span style="font-size:13.63636302947998px">As discussed a few times, we have the following &quot;high-level&quot; construct of data (required for push):</span><br>


</p><ul style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px;padding:0px 0px 0px 30px"><li>PushApplication (&quot;HR Mobile&quot;)</li>
<li>MobileApplication (&quot;HR for iPhone&quot;, &quot;HR for iPad&quot;, &quot;HR for Android&quot;)</li><li>Installation (&quot;Matthias uses iPhone HR&quot;, &quot;Matthias uses Android HR&quot;, &quot;Bruno uses iPad HR&quot;)</li>


</ul><p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">(More details <a href="https://gist.github.com/matzew/6012edf62d1915689a67" style="color:rgb(65,131,196);text-decoration:none" target="_blank">here</a>)</p>


<h3 style="font-size:18px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:20px 0px 10px;padding:0px"><a name="13e17868aba8876e_13e172633a1d77c9_data-per-installation-per-device" href="https://gist.github.com/matzew/04346e212e317d976532#data-per-installation-per-device" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-left:30px" target="_blank"></a>Data per installation per device</h3>


<p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:0px 0px 15px">Now, thinking about what to store for an actual device gives you lot&#39;s of choices. For instance, Helios/Orbiter stores a lot of information in the &quot;device&quot; database (e.g. (current) Location Data, Locale etc).</p>


<p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">Like you can see here:</p><p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">


<a href="https://raw.github.com/helios-framework/helios.io/assets/helios-screenshot.png" style="color:rgb(65,131,196);text-decoration:none" target="_blank"><img src="https://raw.github.com/helios-framework/helios.io/assets/helios-screenshot.png" alt="Helios Web UI Screenshot" style="border:0px;max-width:100%"></a></p>


<p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">All the information is really app specific (e.g. not every app needs to know the current location...); (A side-note... our client SDK should be flexible to store what ever the application requires...)</p>


<h4 style="font-size:16px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:20px 0px 10px;padding:0px"><a name="13e17868aba8876e_13e172633a1d77c9_mandatory-data" href="https://gist.github.com/matzew/04346e212e317d976532#mandatory-data" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-left:30px" target="_blank"></a>Mandatory Data</h4>


<p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:0px 0px 15px">Regardless of what data is desired or not, the following is the minimum that needs to be stored:</p>


<ul style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px;padding:0px 0px 0px 30px"><li>Device Token (generated by the PushNetwork (e.g. APNs, GCM) - used to identify the device with the actual Network, so that it can send a message to that device)</li>


<li>OS and Device Type (we need to store if this is an installation of the iPad version, the iPhone version or the Android version (to use the above HR example))</li><li>OS Version (the version, never hurts)</li></ul><p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">


This is the minimum of data, required to store in our &quot;device registration&quot; database;</p><p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">


As discussed in <a href="https://issues.jboss.org/browse/AEROGEAR-1101" style="color:rgb(65,131,196);text-decoration:none" target="_blank">AEROGEAR-1101</a>, I would like to store the above &quot;device&quot; data, using the Picketlink IDM (Actually the entire data base (PushApplication, MobileApplication and Installation(&quot;device&quot;)).</p>


<h3 style="font-size:18px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:20px 0px 10px;padding:0px"><a name="13e17868aba8876e_13e172633a1d77c9_user-data-" href="https://gist.github.com/matzew/04346e212e317d976532#user-data-" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-left:30px" target="_blank"></a>User Data ?</h3>


<p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:0px 0px 15px">Now... you might wonder if there isn&#39;t any user data required ..... Well, that is also up to the application and how works.</p>


<p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">Overall, I see the following two common application models, suppored by the <em>Push Server</em>:</p>


<ul style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px;padding:0px 0px 0px 30px"><li>device has a user (a known user in an Application (e.g. Marketing) Databases)</li>


<li>device has <em style="margin-top:0px">NO</em> user (no need to have a user for the app)</li></ul><h5 style="line-height:20px;font-size:14px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:20px 0px 10px;padding:0px">


<a name="13e17868aba8876e_13e172633a1d77c9_user-required" href="https://gist.github.com/matzew/04346e212e317d976532#user-required" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-left:30px" target="_blank"></a>User required</h5>

<p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:0px 0px 15px">
This would be an app, that requires an account, before it can be used on the device (e.g. something twitter). For applications like that, a user is required, otherwise hard to send a Push Notification to a specific user (e.g. &quot;You have new tweets&quot;) ( <em>Also twitter works only with a user, on their &quot;application backend/database&quot;</em> )</p>


<h5 style="line-height:20px;font-size:14px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:20px 0px 10px;padding:0px"><a name="13e17868aba8876e_13e172633a1d77c9_no-user-concept-on-the-backend" href="https://gist.github.com/matzew/04346e212e317d976532#no-user-concept-on-the-backend" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-left:30px" target="_blank"></a>No User concept, on the backend</h5>


<p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:0px 0px 15px">That&#39;s a (very) simple app. Think <em>Sports App</em>. The app displays &quot;sport news&quot; (fetched via HTTP, when the app is opened). A installed application can also receive &quot;broadcasts messages&quot;.</p>


<p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px"><strong>Scenario:</strong> You download the app in the app store, install it, use it; When ever the backend thinks it needs to send Notifications (eg. &quot;New score 3:1 at Germany - Brazil&quot;), it simply uses the token and submits the message to the actual Push Network. For applications like this, the backend does not need a user;</p>


<h3 style="font-size:18px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:20px 0px 10px;padding:0px"><a name="13e17868aba8876e_13e172633a1d77c9_application-with-user-required" href="https://gist.github.com/matzew/04346e212e317d976532#application-with-user-required" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-left:30px" target="_blank"></a>Application with User required</h3>


<p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:0px 0px 15px">Now, let&#39;s comeback to the apps, where a user is required, in the backend. Somehow the business backend (e.g. HR system) needs to identify a certain user (and their devices), so that it can &quot;submit&quot; Push Notification jobs.</p>


<p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">Bruno, Shane (from Picketlink) and I talked already to store something like a unique ID (e.g. user-id, login-name or user-name) in the &quot;Device&quot; Table (per device):</p>


<pre style="background-color:rgb(248,248,248);border-top-left-radius:3px;margin-bottom:15px;padding:6px 10px;line-height:19px;border-top-right-radius:3px;font-size:13px;overflow:auto;border-bottom-right-radius:3px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;word-wrap:break-word;margin-top:15px;border:1px solid rgb(204,204,204);border-bottom-left-radius:3px">
<code style="font-size:12px;line-height:normal;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;margin:0px;padding:0px;border:none;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">TOKEN     |     user      |       DEVICE-TYPE    |    OS-VERSION
_________________________________________________________________________
823ssar   |  abstractj    |         Android      |     Android4.x.y.blah
1234456   |  mwessend     |         iPad         |     iOS4.0.1
ghh2712   |  mwessend     |         iPhone       |     iOS6.1.2
</code></pre><p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">Doing so, we can use that &quot;unique ID&quot; to <em>bridge</em> between the actual &quot;application database&quot; and the stored informations about the device(s), stored in the <em>push-server-database</em>; per user!</p>


<p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px"><strong>NOTE</strong> Since the Push Server (and the &quot;device database&quot;) is a standalone server (access via HTTP / Java Library), the real (business) backend (e.g. HR App), can than say:</p>


<p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px"><em>Send message X to to following users</em> (a list of unique user IDs would be send to the push server, so that the Push Server submit these messages to the actual Push-Networks (ANPs/GCM)so that Apple and Google (for iOS/Android) can deliver the actual notification to the client/device.</p>


<h5 style="line-height:20px;font-size:14px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:20px 0px 10px;padding:0px"><a name="13e17868aba8876e_13e172633a1d77c9_client-sdk" href="https://gist.github.com/matzew/04346e212e317d976532#client-sdk" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-left:30px" target="_blank"></a>Client SDK</h5>


<p style="line-height:20px;margin-right:0px;font-size:13.63636302947998px;margin-left:0px;margin-bottom:0px!important;font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px">Again, As said above, we should (and will) offer hooks to have a convenient way to register the unique ID, together with the token,OS,version etc. <strong>BUT</strong> <em>that is not that important here... ;-)</em></p>


<p style="line-height:20px;margin-right:0px;font-size:13.63636302947998px;margin-left:0px;margin-bottom:0px!important;font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px"><em><br></em></p>
<p style="line-height:20px;margin-right:0px;font-size:13.63636302947998px;margin-left:0px;margin-bottom:0px!important;font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px"><em>Thoughts?</em></p><span><font color="#888888">
<p style="line-height:20px;margin-right:0px;font-size:13.63636302947998px;margin-left:0px;margin-bottom:0px!important;font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px"><em><br></em></p>
<p style="line-height:20px;margin-right:0px;font-size:13.63636302947998px;margin-left:0px;margin-bottom:0px!important;font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px"><em><br></em></p>
<div><br></div>-- <br>Matthias Wessendorf <br><br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>


twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a>
</font></span></div>
</blockquote></div></div></div><div><div class="h5"><br><br clear="all"><div><br></div>-- <br>Matthias Wessendorf <br><br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>
sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a>
</div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Matthias Wessendorf <br><br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a>
</div>