But, as said on the first email, there is no spec right now...<div><br></div><div>BUT..., yes - that&#39;s the idea behind the _abstract_ notifier API.<br><br><div class="gmail_quote">On Fri, Feb 22, 2013 at 6:56 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"><br><br><div class="gmail_quote"><div class="im">On Fri, Feb 22, 2013 at 6:53 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 bgcolor="#FFFFFF" text="#000000">
    <div>So, in theory, would I be able to<br>
      <br>
      1) Define a message channel (boats)<br></div></div></blockquote><div><br></div></div><div>a &#39;pipe&#39; :) to a server, yes. Publishing from client works. and receicing msgs on that channel works too </div><div class="im">
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"><div>
      2) Define a series of systems which implement that channel
      (websocket, GCM, carrier pigeon)<br></div></div></blockquote><div><br></div></div><div>this is just &#39;js&#39; client api... so... there will be only SockJS (websocket and legacy fallbacks). No GCM/APNs receiving in JS land (pure mobile web).</div>
<div class="im">
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"><div>
      3) Have AG Auto negotiate systems. (When the app is up use a
      websocket system, when it background use GCM, and when the network
      is down scan QR codes off pigeons)<br></div></div></blockquote><div><br></div></div><div>I guess anwser to 2) makes sense here ?</div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div bgcolor="#FFFFFF" text="#000000"><div>
      <br>
      ?<span><font color="#888888"><br>
      <br>
      Summers</font></span><div><div><br>
      <br>
      <br>
      On 02/21/2013 12:38 PM, Matthias Wessendorf wrote:<br>
    </div></div></div>
    <blockquote type="cite"><div><div>
      <p style="margin-right:0px;margin-bottom:15px;margin-left:0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px;margin-top:0px!important">Hello!</p>
      <p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px">Today,
        I had a brief chat with Kris about a potential AeroGear <em>Notifier</em> Client
        API...</p>
      <p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px">The
        basic idea is to <em>wrap</em> messaging APIs (e.g. Stomp.js,
        Vertx&#39;s eventbus or Socket.io/Engine.io) behind a common client
        &#39;interface&#39;.</p>
      <p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px">Basically
        the AeroGear-Notifier should be able to <em>connect</em> to a
        messaging system in order to <em>subscribe</em> to a channel to
        reveice messages from that channel. The AG-Notifier is also able
        to <em>publish</em> messages to ANY channel. Of course,<em>unsubscribe</em> and <em>disconnect</em> are
        required too...</p>
      <p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px">Sure...
        the above is not (YET) really a <em>SPEC</em>, but it&#39;s
        start.... the JS API of the AG-Notifier (DRAFT 0.0.1) could
        looks like this:</p>
      <div style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;padding:0px;border:0px">
        <pre style="font-size:13px;line-height:19px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;word-wrap:break-word;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<span style="color:rgb(153,153,136);font-style:italic">/**</span>
<span style="color:rgb(153,153,136);font-style:italic"> * Connects to a given URL. The callback is invoked after a connection has been established. In case of an error, an Error</span>
<span style="color:rgb(153,153,136);font-style:italic"> * object will be passed to the callback</span>
<span style="color:rgb(153,153,136);font-style:italic"> */</span>
<span>AeroGear</span><span>.</span><span>Notifier</span><span>.</span><span>connect</span><span>(</span><span style="color:rgb(0,134,179)">String</span> <span>url</span><span>,</span> <span style="font-weight:bold">function</span> <span>callback</span><span>);</span>

<span style="color:rgb(153,153,136);font-style:italic">/**</span>
<span style="color:rgb(153,153,136);font-style:italic"> * Tears down the connection. The callback is invoked after a connection has been closed. In case of an error, an</span>
<span style="color:rgb(153,153,136);font-style:italic"> * Error object will be passed to the callback</span>
<span style="color:rgb(153,153,136);font-style:italic"> */</span>
<span>AeroGear</span><span>.</span><span>Notifier</span><span>.</span><span>disconnect</span><span>(</span><span style="font-weight:bold">function</span> <span>callback</span><span>);</span>

<span style="color:rgb(153,153,136);font-style:italic">/**</span>
<span style="color:rgb(153,153,136);font-style:italic"> * Subscribes to a channel. The callback function is invoked for every message, received on the given channel.</span>
<span style="color:rgb(153,153,136);font-style:italic"> */</span>
<span>AeroGear</span><span>.</span><span>Notifier</span><span>.</span><span>subscribe</span><span>(</span><span style="color:rgb(0,134,179)">String</span> <span>channel</span><span>,</span> <span style="font-weight:bold">function</span> <span>callback</span><span>);</span>

<span style="color:rgb(153,153,136);font-style:italic">/**</span>
<span style="color:rgb(153,153,136);font-style:italic"> * Removes the subscription of the given channel.</span>
<span style="color:rgb(153,153,136);font-style:italic"> */</span>
<span>AeroGear</span><span>.</span><span>Notifier</span><span>.</span><span>unsubscribe</span><span>(</span><span style="color:rgb(0,134,179)">String</span> <span>channel</span><span>);</span>

<span style="color:rgb(153,153,136);font-style:italic">/**</span>
<span style="color:rgb(153,153,136);font-style:italic"> * Publishes a message to a given channel</span>
<span style="color:rgb(153,153,136);font-style:italic"> */</span>
<span>AeroGear</span><span>.</span><span>Notifier</span><span>.</span><span>publish</span><span>(</span><span style="color:rgb(0,134,179)">String</span> <span>channel</span><span>,</span> <span style="color:rgb(0,134,179)">Object</span> <span>message</span><span>);</span>
</pre>
      </div>
      <p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px">Perhaps
        a <em>STATE-MASHINE</em> would be nice as well:</p>
      <div style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;padding:0px;border:0px">
        <pre style="font-size:13px;line-height:19px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;word-wrap:break-word;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<span>AeroGear</span><span>.</span><span>Notifier</span><span>.</span><span>CONNECTING</span> <span style="font-weight:bold">=</span> <span style="color:rgb(0,153,153)">0</span><span>;</span>
<span>AeroGear</span><span>.</span><span>Notifier</span><span>.</span><span>OPEN</span> <span style="font-weight:bold">=</span> <span style="color:rgb(0,153,153)">1</span><span>;</span>
<span>AeroGear</span><span>.</span><span>Notifier</span><span>.</span><span>CLOSING</span> <span style="font-weight:bold">=</span> <span style="color:rgb(0,153,153)">2</span><span>;</span>
<span>AeroGear</span><span>.</span><span>Notifier</span><span>.</span><span>CLOSED</span> <span style="font-weight:bold">=</span> <span style="color:rgb(0,153,153)">3</span><span>;</span>
</pre>
      </div>
      <h2 style="margin:20px 0px 10px;padding:0px;font-size:24px;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(204,204,204);font-family:Helvetica,arial,freesans,clean,sans-serif"><a name="13d030ceac90fc03_13d030a70ff9bb01_implementation-of-the-adapters" href="https://gist.github.com/matzew/bd4f3c41e1114c225eb1#implementation-of-the-adapters" style="color:rgb(65,131,196);text-decoration:initial;display:block;padding-left:30px" target="_blank"></a>Implementation
        of the Adapters</h2>
      <p style="margin-top:0px;margin-right:0px;margin-left:0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px;margin-bottom:0px!important">The
        different adapter implementations will be done separately: <code>ag-notifier-vertx.js</code>...</p>
      <p style="margin-top:0px;margin-right:0px;margin-left:0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px;margin-bottom:0px!important"><br>
      </p>
      <p style="margin-top:0px;margin-right:0px;margin-left:0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px;margin-bottom:0px!important"><br>
      </p>
      <p style="margin-top:0px;margin-right:0px;margin-left:0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px;margin-bottom:0px!important">Thoughts
        ?</p>
      <p style="margin-top:0px;margin-right:0px;margin-left:0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px;margin-bottom:0px!important"><br>
      </p>
      <p style="margin-top:0px;margin-right:0px;margin-left:0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px;margin-bottom:0px!important"><br>
      </p>
      <p style="margin-top:0px;margin-right:0px;margin-left:0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px;margin-bottom:0px!important"><br>
      </p>
      <br>
      -- <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><br>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><div><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>
    </div></blockquote>
    <br>
  </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></div><div class="HOEnZb"><div class="h5"><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></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>