<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">+1 for builder i don't think for now we need to separate message content from signalling<div>As per whether we should support Object for message input that could be JSONnified. Those objects will have to be implement an interface/protocol.</div><div>Could be nice though</div><div><br></div><div>Corinne</div><div><div><div>On Jul 3, 2013, at 3:45 PM, Sebastien Blanc &lt;<a href="mailto:scm.blanc@gmail.com">scm.blanc@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 3, 2013 at 3:41 PM, Summers Pittman <span dir="ltr">&lt;<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Wed 03 Jul 2013 09:15:24 AM EDT, Sebastien Blanc wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Speaking more about implementation details , do you think this is a<br>
good approach (don't like very much the code duplication between the<br>
builder and the object but like the result)<br>
<a href="http://javarevisited.blogspot.fr/2012/06/builder-design-pattern-in-java-example.html" target="_blank">http://javarevisited.blogspot.<u></u>fr/2012/06/builder-design-<u></u>pattern-in-java-example.html</a><br>
?<br>
</blockquote></div>
Just a script to generate the builder and constructor from the fields in the class. &nbsp;I wouldn't worry about code duplication (IN THIS ONE NARROW INSTANCE) too much.<br></blockquote><div style="">A groovy Script ?Sure ;)&nbsp;</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><span style="color:rgb(34,34,34)">&nbsp;</span><br></div></blockquote></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
On Wed, Jul 3, 2013 at 10:10 AM, Sebastien Blanc &lt;<a href="mailto:scm.blanc@gmail.com" target="_blank">scm.blanc@gmail.com</a><br></div><div class="im">
&lt;mailto:<a href="mailto:scm.blanc@gmail.com" target="_blank">scm.blanc@gmail.com</a>&gt;&gt; wrote:<br>
<br>
&nbsp; &nbsp; Ok,<br>
&nbsp; &nbsp; Progress will be tracked here<br>
&nbsp; &nbsp; <a href="https://issues.jboss.org/browse/AGPUSH-135" target="_blank">https://issues.jboss.org/<u></u>browse/AGPUSH-135</a><br>
<br>
<br>
&nbsp; &nbsp; On Tue, Jul 2, 2013 at 6:14 PM, Matthias Wessendorf<br></div><div class="im">
&nbsp; &nbsp; &lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a> &lt;mailto:<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt;&gt; wrote:<br>
<br>
<br>
<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; On Tue, Jul 2, 2013 at 5:57 PM, Summers Pittman<br></div><div><div class="h5">
&nbsp; &nbsp; &nbsp; &nbsp; &lt;<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a> &lt;mailto:<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a>&gt;&gt; wrote:<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; On 07/02/2013 09:13 AM, Sebastien Blanc wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Hi Folks,<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; As you know we have a Java Sender Library that can be<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; used by any backend application that want to send<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; messages to the Unified Message Push Server<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (<a href="https://github.com/aerogear/aerogear-unified-push-java-client" target="_blank">https://github.com/aerogear/<u></u>aerogear-unified-push-java-<u></u>client</a>).<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; The format is quite open and flexible as<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Matthias described it here :<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="https://gist.github.com/matzew/b21c1404cc093825f0fb" target="_blank">https://gist.github.com/<u></u>matzew/b21c1404cc093825f0fb</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; We can divide the creation of a message in 2 main parts :<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - The &nbsp;"signalling" part : list of client identifiers /<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; specific devices etc ...<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - The "core" message containing actually the information<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; we want to push<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Both are passed as Map and are finally converted into JSON.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Here an example of how a "core" message is build :<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |Map categories = new HashMap();<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; categories.put("lead", "version="+leadVersion++);<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Map json = new HashMap();<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; json.put("id", lead.getId());<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; json.put("messageType", "pushed_lead");<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; json.put("name", lead.getName());<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; json.put("location", lead.getLocation());<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; json.put("phone", lead.getPhoneNumber());<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; json.put("simple-push", categories);<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; json.put("sound" ,"default");<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; json.put("alert" ,"A new lead has been created");|<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Even the format is open, we could "assist" a bit<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the developer in building the message. For that we have<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; different options :<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Propose a simple Message object containing the message<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "API" :<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |Message message = new Message();<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message.setClientIdentifiers("<u></u>jake","maria");<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message.enableSound();//by default use "default" or we could do message.enableSound("boing")<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message.setAlert("Watch out!);<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message.setAttribute("<u></u>customAttribute","yo"); // custom simple strings<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message.setAttribute("<u></u>customStructure",myObject); // passing objects|<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Propose a Message Builder (following the Builder<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Pattern) to propose a more fluent API :<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |Message message = new Message().builder()<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.clientIdentifiers("jake","<u></u>maria")<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.enableSound()<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.alert("AAAAHHH!")<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.attribute("customAttribute","<u></u>yo")<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.attribute("customStructure",<u></u>myObject)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.build()|<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Same as above but more DSL focused (not sure about this<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; one ;) )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |Message message = MessageDSL.to("jake","maria").<u></u>withSound() //etc ...<br>
<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; So, beside that we have to discuss what we want allow to<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pass to the message API : only Strings and simple Maps ?<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Full Objects that will be JSONified ?<br>
</blockquote>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; +1 to Strings and Simple Maps.<br>
<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; +1 on that too.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; See here too :)<br>
&nbsp; &nbsp; &nbsp; &nbsp; <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/<u></u>reference/com/google/android/<u></u>gcm/server/Message.Builder.<u></u>html#addData(java.lang.String</a>,<br>

&nbsp; &nbsp; &nbsp; &nbsp; java.lang.String)<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JSONIfying full objects can be error prone/tricky<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sometimes so -.5 to that.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I don't hate it would rather just not give people that gun<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; to shoot themselves with so soon ;)<br>
<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; I am for Strings and Simple Maps as well<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Do we want also to separate the "signalling" part from<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the "core" part when building a message ?<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Inputs and comments more than welcome !<br>
</blockquote>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I like the Builder. &nbsp;It is very simple, very neutral, and<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; very exact.<br>
<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Seb<br>
<br>
<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ______________________________<u></u>_________________<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aerogear-dev mailing list<br></div></div>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a> &nbsp;&lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.<u></u>jboss.org</a>&gt;<br>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/<u></u>mailman/listinfo/aerogear-dev</a><br>
</blockquote><div class="im">
<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ______________________________<u></u>_________________<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aerogear-dev mailing list<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a><br></div>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.<u></u>jboss.org</a>&gt;<div class="im"><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/<u></u>mailman/listinfo/aerogear-dev</a><br>
<br>
<br>
<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; --<br>
&nbsp; &nbsp; &nbsp; &nbsp; Matthias Wessendorf<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.<u></u>wordpress.com/</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/<u></u>mwessendorf</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a><br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; ______________________________<u></u>_________________<br>
&nbsp; &nbsp; &nbsp; &nbsp; aerogear-dev mailing list<br></div>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.<u></u>jboss.org</a>&gt;<div class="im">
<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/<u></u>mailman/listinfo/aerogear-dev</a><br>
<br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<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/<u></u>mailman/listinfo/aerogear-dev</a><br>
</div></blockquote>
<br>
<br>
</blockquote></div><br></div></div>
_______________________________________________<br>aerogear-dev mailing list<br><a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/aerogear-dev</blockquote></div><br></div></body></html>