<div dir="ltr">I think... one problem with using an (simple) Agent is, that the login name is really required (otherwise I get NPE)<div><br></div><div><br></div><div style>Note that the "client identifier" is only optional (see cases where user is not required)</div>
<div style><br></div><div style><a href="https://github.com/matzew/IDM-tests/blob/master/src/main/java/org/aerogear/connectivity/api/MobileInstallationAgent.java#L35">https://github.com/matzew/IDM-tests/blob/master/src/main/java/org/aerogear/connectivity/api/MobileInstallationAgent.java#L35</a><br>
</div><div style><br></div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 18, 2013 at 8:37 AM, Matthias Wessendorf <span dir="ltr"><<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, as mentioned in <a href="https://issues.jboss.org/browse/AEROGEAR-1101" style="color:rgb(65,131,196);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:14px;line-height:20px;text-decoration:none" target="_blank">AEROGEAR-1101</a> we are looking into using the IDM for storing the "data model";<div>
<br><div>I created some hacky/ugly project to start playing with IDM for my "device installations"<br></div><div><br></div><div><a href="https://github.com/matzew/IDM-tests" target="_blank">https://github.com/matzew/IDM-tests</a><br>
</div><div><br></div><div><br></div><div>I am having a custom "agent" there,.... however I see the point (by Shane on PL's IRC channel) that perhaps the Agent is not right, since the device CAN (see my other email) have a reference to a user (in that case the device would be just an "add-on" / "extension" of the user).</div>
<div><br></div><div>Also, besides the device data, we should/need to store the "application abstraction" model (see other email) in the IDM as well Like:</div><div><br></div><div>One PushApp (HR mobile) has two mobile apps (HR-iOS, HR-Android) each of the mobile apps has "installed" apps (bruno uses iOS version, on his iPad; I use android on my other Tablet)<br>
</div><div><br></div><div>Greetings,</div><div>Matthias</div><div><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 17, 2013 at 10:39 AM, Matthias Wessendorf <span dir="ltr"><<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style: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 "high-level" 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 ("HR Mobile")</li>
<li>MobileApplication ("HR for iPhone", "HR for iPad", "HR for Android")</li><li>Installation ("Matthias uses iPhone HR", "Matthias uses Android HR", "Bruno uses iPad HR")</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="13e1bdcc9dea857d_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's of choices. For instance, Helios/Orbiter stores a lot of information in the "device" 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="13e1bdcc9dea857d_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 "device registration" 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 "device" data, using the Picketlink IDM (Actually the entire data base (PushApplication, MobileApplication and Installation("device")).</p>
<h3 style="font-size:18px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:20px 0px 10px;padding:0px"><a name="13e1bdcc9dea857d_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'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="13e1bdcc9dea857d_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. "You have new tweets") ( <em>Also twitter works only with a user, on their "application backend/database"</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="13e1bdcc9dea857d_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's a (very) simple app. Think <em>Sports App</em>. The app displays "sport news" (fetched via HTTP, when the app is opened). A installed application can also receive "broadcasts messages".</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. "New score 3:1 at Germany - Brazil"), 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="13e1bdcc9dea857d_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'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 "submit" 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 "Device" 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,'Liberation Mono',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,'Liberation Mono',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 "unique ID" to <em>bridge</em> between the actual "application database" 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 "device database") 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="13e1bdcc9dea857d_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;font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px;margin-bottom:0px!important">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;font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px;margin-bottom:0px!important"><em><br></em></p>
<p style="line-height:20px;margin-right:0px;font-size:13.63636302947998px;margin-left:0px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px;margin-bottom:0px!important"><em>Thoughts?</em></p><span><font color="#888888">
<p style="line-height:20px;margin-right:0px;font-size:13.63636302947998px;margin-left:0px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px;margin-bottom:0px!important"><em><br></em></p>
<p style="line-height:20px;margin-right:0px;font-size:13.63636302947998px;margin-left:0px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px;margin-bottom:0px!important"><em><br></em></p><span class="HOEnZb"><font color="#888888">
<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></font></span></div><span class="HOEnZb"><font color="#888888">
</font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><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>
</font></span></div></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>