<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">&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"><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">&lt;<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a>&gt;</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  &quot;signalling&quot; part : list of client
          identifiers / specific devices etc ...</div>
        <div>- The &quot;core&quot; 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 &quot;core&quot; 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,&#39;Liberation Mono&#39;,Courier,monospace;border:1px solid rgb(221,221,221);border-bottom-left-radius:3px;margin-top:0px!important">
<code style="font-family:Consolas,&#39;Liberation Mono&#39;,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(&quot;lead&quot;, &quot;version=&quot;+leadVersion++); 
Map json = new HashMap();
json.put(&quot;id&quot;, lead.getId());
json.put(&quot;messageType&quot;, &quot;pushed_lead&quot;);
json.put(&quot;name&quot;, lead.getName());
json.put(&quot;location&quot;, lead.getLocation());
json.put(&quot;phone&quot;, lead.getPhoneNumber());
json.put(&quot;simple-push&quot;, categories);
json.put(&quot;sound&quot; ,&quot;default&quot;);
json.put(&quot;alert&quot; ,&quot;A new lead has been created&quot;);</code></pre>
        </div>
        <div><br>
        </div>
        <div>Even the format is open, we could &quot;assist&quot; a bit
          the developer in building the message. For that we have
          different options : </div>
        <div>- Propose a simple Message object containing the
          message &quot;API&quot; :</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,&#39;Liberation Mono&#39;,Courier,monospace;margin-top:15px;border:1px solid rgb(221,221,221);border-bottom-left-radius:3px">
<code style="font-family:Consolas,&#39;Liberation Mono&#39;,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(&quot;jake&quot;,&quot;maria&quot;);
message.enableSound();//by default use &quot;default&quot; or we could do message.enableSound(&quot;boing&quot;)
message.setAlert(&quot;Watch out!);
message.setAttribute(&quot;customAttribute&quot;,&quot;yo&quot;); // custom simple strings
message.setAttribute(&quot;customStructure&quot;,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,&#39;Liberation Mono&#39;,Courier,monospace;margin-top:15px;border:1px solid rgb(221,221,221);border-bottom-left-radius:3px">
<code style="font-family:Consolas,&#39;Liberation Mono&#39;,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(&quot;jake&quot;,&quot;maria&quot;)
  .enableSound()
  .alert(&quot;AAAAHHH!&quot;)
  .attribute(&quot;customAttribute&quot;,&quot;yo&quot;)
  .attribute(&quot;customStructure&quot;,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,&#39;Liberation Mono&#39;,Courier,monospace;margin-top:15px;border:1px solid rgb(221,221,221);border-bottom-left-radius:3px">
<code style="font-family:Consolas,&#39;Liberation Mono&#39;,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">&quot;jake&quot;,&quot;maria&quot;).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&#39;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 &quot;signalling&quot; part
          from the &quot;core&quot; 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>