<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0-google-v4) on Fri Oct 07 18:14:55 PDT 2011 --> <TITLE> ChannelService </TITLE> <META NAME="date" CONTENT="2011-10-07"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../dev_javadoc.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="ChannelService"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../com/google/appengine/api/channel/ChannelPresence.html" title="class in com.google.appengine.api.channel"><B>PREV CLASS</B></A> <A HREF="../../../../../com/google/appengine/api/channel/ChannelServiceFactory.html" title="class in com.google.appengine.api.channel"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/google/appengine/api/channel/ChannelService.html" target="_top"><B>FRAMES</B></A> <A HREF="ChannelService.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> com.google.appengine.api.channel</FONT> <BR> Interface ChannelService</H2> <HR> <DL> <DT><PRE>public interface <B>ChannelService</B></DL> </PRE> <P> <code>ChannelService</code> allows you to manage manage two-way connections with clients. <P> <P> <HR> <P> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/channel/ChannelService.html#createChannel(java.lang.String)">createChannel</A></B>(java.lang.String clientId)</CODE> <BR> Creates a channel associated with the provided <code>clientId</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../com/google/appengine/api/channel/ChannelMessage.html" title="class in com.google.appengine.api.channel">ChannelMessage</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/channel/ChannelService.html#parseMessage(HttpServletRequest)">parseMessage</A></B>(HttpServletRequest request)</CODE> <BR> Parse the incoming message in <code>request</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../com/google/appengine/api/channel/ChannelPresence.html" title="class in com.google.appengine.api.channel">ChannelPresence</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/channel/ChannelService.html#parsePresence(HttpServletRequest)">parsePresence</A></B>(HttpServletRequest request)</CODE> <BR> Parse the incoming presence in <code>request</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/channel/ChannelService.html#sendMessage(com.google.appengine.api.channel.ChannelMessage)">sendMessage</A></B>(<A HREF="../../../../../com/google/appengine/api/channel/ChannelMessage.html" title="class in com.google.appengine.api.channel">ChannelMessage</A> message)</CODE> <BR> Sends a <A HREF="../../../../../com/google/appengine/api/channel/ChannelMessage.html" title="class in com.google.appengine.api.channel"><CODE>ChannelMessage</CODE></A> to the client.</TD> </TR> </TABLE> <P> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="createChannel(java.lang.String)"><!-- --></A><H3> createChannel</H3> <PRE> java.lang.String <B>createChannel</B>(java.lang.String clientId)</PRE> <DL> <DD>Creates a channel associated with the provided <code>clientId</code>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>clientId</CODE> - A string uniquely identifying the client that will use the returned token to connect to this channel. This string must be fewer than 64 bytes when encoded to UTF-8. <DT><B>Returns:</B><DD>the token the client will use to connect to this channel. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../../com/google/appengine/api/channel/ChannelFailureException.html" title="class in com.google.appengine.api.channel">ChannelFailureException</A></CODE> - if there is an error encountered while communicating with the channel service.</DL> </DD> </DL> <HR> <A NAME="sendMessage(com.google.appengine.api.channel.ChannelMessage)"><!-- --></A><H3> sendMessage</H3> <PRE> void <B>sendMessage</B>(<A HREF="../../../../../com/google/appengine/api/channel/ChannelMessage.html" title="class in com.google.appengine.api.channel">ChannelMessage</A> message)</PRE> <DL> <DD>Sends a <A HREF="../../../../../com/google/appengine/api/channel/ChannelMessage.html" title="class in com.google.appengine.api.channel"><CODE>ChannelMessage</CODE></A> to the client. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>message</CODE> - the message to be sent to all connected clients. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../../com/google/appengine/api/channel/ChannelFailureException.html" title="class in com.google.appengine.api.channel">ChannelFailureException</A></CODE> - if there is an error encountered while communicating with the channel service.</DL> </DD> </DL> <HR> <A NAME="parseMessage(HttpServletRequest)"><!-- --></A><H3> parseMessage</H3> <PRE> <A HREF="../../../../../com/google/appengine/api/channel/ChannelMessage.html" title="class in com.google.appengine.api.channel">ChannelMessage</A> <B>parseMessage</B>(HttpServletRequest request)</PRE> <DL> <DD>Parse the incoming message in <code>request</code>. This method should only be called within a channel webhook. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>request</CODE> - the source HTTP request. <DT><B>Returns:</B><DD>the incoming <A HREF="../../../../../com/google/appengine/api/channel/ChannelMessage.html" title="class in com.google.appengine.api.channel"><CODE>ChannelMessage</CODE></A>. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalStateException</CODE> - if the required HTTP parameters are not present.</DL> </DD> </DL> <HR> <A NAME="parsePresence(HttpServletRequest)"><!-- --></A><H3> parsePresence</H3> <PRE> <A HREF="../../../../../com/google/appengine/api/channel/ChannelPresence.html" title="class in com.google.appengine.api.channel">ChannelPresence</A> <B>parsePresence</B>(HttpServletRequest request) throws java.io.IOException</PRE> <DL> <DD>Parse the incoming presence in <code>request</code>. This method should only be called within a channel presence request handler. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>request</CODE> - the source HTTP request. <DT><B>Returns:</B><DD>the incoming <A HREF="../../../../../com/google/appengine/api/channel/ChannelPresence.html" title="class in com.google.appengine.api.channel"><CODE>ChannelPresence</CODE></A>. <DT><B>Throws:</B> <DD><CODE>java.io.IOException</CODE> - if the MIME body isn't parseable. <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the HTTP request doesn't conform to expectations.</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../com/google/appengine/api/channel/ChannelPresence.html" title="class in com.google.appengine.api.channel"><B>PREV CLASS</B></A> <A HREF="../../../../../com/google/appengine/api/channel/ChannelServiceFactory.html" title="class in com.google.appengine.api.channel"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/google/appengine/api/channel/ChannelService.html" target="_top"><B>FRAMES</B></A> <A HREF="ChannelService.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>