<div dir="ltr">Ok,<div style>Progress will be tracked here <a href="https://issues.jboss.org/browse/AGPUSH-135">https://issues.jboss.org/browse/AGPUSH-135</a></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Jul 2, 2013 at 6:14 PM, 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"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Tue, Jul 2, 2013 at 5:57 PM, Summers Pittman <span dir="ltr"><<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</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 bgcolor="#FFFFFF" text="#000000"><div><div>
<div>On 07/02/2013 09:13 AM, Sebastien Blanc
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi Folks,
<div>As you know we have a Java Sender Library that can
be used by any backend application that want to send messages
to the Unified Message Push Server (<a href="https://github.com/aerogear/aerogear-unified-push-java-client" target="_blank">https://github.com/aerogear/aerogear-unified-push-java-client</a>).</div>
<div>The format is quite open and flexible as
Matthias described it here : <a href="https://gist.github.com/matzew/b21c1404cc093825f0fb" target="_blank">https://gist.github.com/matzew/b21c1404cc093825f0fb</a><br>
</div>
<div>We can divide the creation of a message in 2 main
parts :</div>
<div><br>
</div>
<div>- The "signalling" part : list of client
identifiers / specific devices etc ...</div>
<div>- The "core" message containing actually the
information we want to push</div>
<div><br>
</div>
<div>Both are passed as Map and are finally converted
into JSON. </div>
<div>Here an example of how a "core" message is build :</div>
<div><br>
</div>
<div>
<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;border:1px solid rgb(221,221,221);border-bottom-left-radius:3px;margin-top:0px!important">
<code style="font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:normal;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">Map categories = new HashMap();
categories.put("lead", "version="+leadVersion++);
Map json = new HashMap();
json.put("id", lead.getId());
json.put("messageType", "pushed_lead");
json.put("name", lead.getName());
json.put("location", lead.getLocation());
json.put("phone", lead.getPhoneNumber());
json.put("simple-push", categories);
json.put("sound" ,"default");
json.put("alert" ,"A new lead has been created");</code></pre>
</div>
<div><br>
</div>
<div>Even the format is open, we could "assist" a bit
the developer in building the message. For that we have
different options : </div>
<div>- Propose a simple Message object containing the
message "API" :</div>
<div><br>
</div>
<div>
<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;margin-top:15px;border:1px solid rgb(221,221,221);border-bottom-left-radius:3px">
<code style="font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:normal;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">Message message = new Message();
message.setClientIdentifiers("jake","maria");
message.enableSound();//by default use "default" or we could do message.enableSound("boing")
message.setAlert("Watch out!);
message.setAttribute("customAttribute","yo"); // custom simple strings
message.setAttribute("customStructure",myObject); // passing objects</code></pre>
</div>
<div><br>
</div>
<div>- Propose a Message Builder (following the Builder
Pattern) to propose a more fluent API : </div>
<div><br>
</div>
<div>
<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;margin-top:15px;border:1px solid rgb(221,221,221);border-bottom-left-radius:3px">
<code style="font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:normal;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">Message message = new Message().builder()
.clientIdentifiers("jake","maria")
.enableSound()
.alert("AAAAHHH!")
.attribute("customAttribute","yo")
.attribute("customStructure",myObject)
.build()</code></pre>
</div>
<div><br>
</div>
<div>- Same as above but more DSL focused (not sure
about this one ;) )</div>
<div>
<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;margin-top:15px;border:1px solid rgb(221,221,221);border-bottom-left-radius:3px">
<code style="font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:normal;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">Message message = MessageDSL.to(<span style="background-color:transparent">"jake","maria").withSound() //etc ...</span>
</code></pre>
</div>
<div><br>
</div>
<div>So, beside that we have to discuss what we want
allow to pass to the message API : only Strings and simple
Maps ? Full Objects that will be JSONified ? <br>
</div>
</div>
</blockquote></div></div>
+1 to Strings and Simple Maps. </div></blockquote><div><br></div></div></div><div>+1 on that too.</div><div><br></div><div>See here too :)</div><div><a href="http://developer.android.com/reference/com/google/android/gcm/server/Message.Builder.html#addData(java.lang.String" target="_blank">http://developer.android.com/reference/com/google/android/gcm/server/Message.Builder.html#addData(java.lang.String</a>, java.lang.String)<br>
</div><div class="im"><div><br></div><div> </div><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 bgcolor="#FFFFFF" text="#000000">
JSONIfying full objects can be error
prone/tricky sometimes so -.5 to that.<br>
I don't hate it would rather just not give people that gun to shoot
themselves with so soon ;)</div></blockquote><div><br></div></div><div>I am for Strings and Simple Maps as well</div><div class="im"><div> </div><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 bgcolor="#FFFFFF" text="#000000"><div><br>
<blockquote type="cite">
<div dir="ltr">
<div>
<br>
</div>
<div>Do we want also to separate the "signalling" part
from the "core" part when building a message ? </div>
<div><br>
</div>
<div>Inputs and comments more than welcome !</div>
</div>
</blockquote></div>
I like the Builder. It is very simple, very neutral, and very
exact.<div><br>
<blockquote type="cite">
<div dir="ltr">
<div><br>
</div>
<div>Seb</div>
<div><br>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
aerogear-dev mailing list
<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a></pre>
</blockquote>
<br>
</div></div>
<br>_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br></blockquote></div></div><br><br clear="all"><div class="im"><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>
<br>_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br></blockquote></div><br></div>