<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 <<a href="mailto:scm.blanc@gmail.com">scm.blanc@gmail.com</a>> 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"><<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a>></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. I wouldn't worry about code duplication (IN THIS ONE NARROW INSTANCE) too much.<br></blockquote><div style="">A groovy Script ?Sure ;) </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)"> </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 <<a href="mailto:scm.blanc@gmail.com" target="_blank">scm.blanc@gmail.com</a><br></div><div class="im">
<mailto:<a href="mailto:scm.blanc@gmail.com" target="_blank">scm.blanc@gmail.com</a>>> wrote:<br>
<br>
Ok,<br>
Progress will be tracked here<br>
<a href="https://issues.jboss.org/browse/AGPUSH-135" target="_blank">https://issues.jboss.org/<u></u>browse/AGPUSH-135</a><br>
<br>
<br>
On Tue, Jul 2, 2013 at 6:14 PM, Matthias Wessendorf<br></div><div class="im">
<<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a> <mailto:<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>>> wrote:<br>
<br>
<br>
<br>
<br>
On Tue, Jul 2, 2013 at 5:57 PM, Summers Pittman<br></div><div><div class="h5">
<<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a> <mailto:<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a>>> wrote:<br>
<br>
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">
Hi Folks,<br>
As you know we have a Java Sender Library that can be<br>
used by any backend application that want to send<br>
messages to the Unified Message Push Server<br>
(<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>
The format is quite open and flexible as<br>
Matthias described it here :<br>
<a href="https://gist.github.com/matzew/b21c1404cc093825f0fb" target="_blank">https://gist.github.com/<u></u>matzew/b21c1404cc093825f0fb</a><br>
We can divide the creation of a message in 2 main parts :<br>
<br>
- The "signalling" part : list of client identifiers /<br>
specific devices etc ...<br>
- The "core" message containing actually the information<br>
we want to push<br>
<br>
Both are passed as Map and are finally converted into JSON.<br>
Here an example of how a "core" message is build :<br>
<br>
|Map categories = new HashMap();<br>
categories.put("lead", "version="+leadVersion++);<br>
Map json = new HashMap();<br>
json.put("id", lead.getId());<br>
json.put("messageType", "pushed_lead");<br>
json.put("name", lead.getName());<br>
json.put("location", lead.getLocation());<br>
json.put("phone", lead.getPhoneNumber());<br>
json.put("simple-push", categories);<br>
json.put("sound" ,"default");<br>
json.put("alert" ,"A new lead has been created");|<br>
<br>
Even the format is open, we could "assist" a bit<br>
the developer in building the message. For that we have<br>
different options :<br>
- Propose a simple Message object containing the message<br>
"API" :<br>
<br>
|Message message = new Message();<br>
message.setClientIdentifiers("<u></u>jake","maria");<br>
message.enableSound();//by default use "default" or we could do message.enableSound("boing")<br>
message.setAlert("Watch out!);<br>
message.setAttribute("<u></u>customAttribute","yo"); // custom simple strings<br>
message.setAttribute("<u></u>customStructure",myObject); // passing objects|<br>
<br>
- Propose a Message Builder (following the Builder<br>
Pattern) to propose a more fluent API :<br>
<br>
|Message message = new Message().builder()<br>
.clientIdentifiers("jake","<u></u>maria")<br>
.enableSound()<br>
.alert("AAAAHHH!")<br>
.attribute("customAttribute","<u></u>yo")<br>
.attribute("customStructure",<u></u>myObject)<br>
.build()|<br>
<br>
- Same as above but more DSL focused (not sure about this<br>
one ;) )<br>
|Message message = MessageDSL.to("jake","maria").<u></u>withSound() //etc ...<br>
<br>
<br>
|<br>
<br>
So, beside that we have to discuss what we want allow to<br>
pass to the message API : only Strings and simple Maps ?<br>
Full Objects that will be JSONified ?<br>
</blockquote>
+1 to Strings and Simple Maps.<br>
<br>
<br>
+1 on that too.<br>
<br>
See here too :)<br>
<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>
java.lang.String)<br>
<br>
JSONIfying full objects can be error prone/tricky<br>
sometimes so -.5 to that.<br>
I don't hate it would rather just not give people that gun<br>
to shoot themselves with so soon ;)<br>
<br>
<br>
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>
Do we want also to separate the "signalling" part from<br>
the "core" part when building a message ?<br>
<br>
Inputs and comments more than welcome !<br>
</blockquote>
I like the Builder. It is very simple, very neutral, and<br>
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>
Seb<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
aerogear-dev mailing list<br></div></div>
<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.<u></u>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>
</blockquote><div class="im">
<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></div>
<mailto:<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.<u></u>jboss.org</a>><div class="im"><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>
<br>
<br>
<br>
<br>
--<br>
Matthias Wessendorf<br>
<br>
blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.<u></u>wordpress.com/</a><br>
sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/<u></u>mwessendorf</a><br>
twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a><br>
<br>
______________________________<u></u>_________________<br>
aerogear-dev mailing list<br></div>
<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.<u></u>jboss.org</a>><div class="im">
<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>
<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>