<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">java.lang.Object</A>
<IMGSRC="../../../resources/inherit.gif"ALT="extended by "><B>com.mxgraph.sharing.mxSession</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B><DD><AHREF="../../../com/mxgraph/sharing/mxSharedState.mxDiagramChangeListener.html"title="interface in com.mxgraph.sharing">mxSharedState.mxDiagramChangeListener</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>mxSession</B><DT>extends <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A><DT>implements <AHREF="../../../com/mxgraph/sharing/mxSharedState.mxDiagramChangeListener.html"title="interface in com.mxgraph.sharing">mxSharedState.mxDiagramChangeListener</A></DL>
</PRE>
<P>
Implements a session that may be attached to a shared diagram. The session
contains a synchronized buffer which is used to hold the pending edits which
are to be sent to a specific client. The update mechnism between the server
and the client uses HTTP requests (polling). The request is kept on the server
for an amount of time or wakes up / returns immediately if the buffer is no
<CODE>protected <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/StringBuffer.html?is-external=true"title="class or interface in java.lang">StringBuffer</A></CODE></FONT></TD>
<CODE>protected <AHREF="../../../com/mxgraph/sharing/mxSharedState.html"title="class in com.mxgraph.sharing">mxSharedState</A></CODE></FONT></TD>
<CODE>protected <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/sharing/mxSession.html#mxSession(java.lang.String, com.mxgraph.sharing.mxSharedState)">mxSession</A></B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A> id,
<AHREF="../../../com/mxgraph/sharing/mxSharedState.html"title="class in com.mxgraph.sharing">mxSharedState</A> diagram)</CODE>
<BR>
Constructs a new session with the given ID.</TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/sharing/mxSession.html#diagramChanged(java.lang.Object, java.lang.String)">diagramChanged</A></B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> sender,
<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A> edits)</CODE>
<BR>
Fires when the shared diagram was changed.</TD>
<CODE> <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A></CODE></FONT></TD>
<CODE> <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A></CODE></FONT></TD>
<CODE> <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A></CODE></FONT></TD>
<CODE> <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A></CODE></FONT></TD>
<CODE> <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/sharing/mxSession.html#receive(org.w3c.dom.Node)">receive</A></B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true"title="class or interface in org.w3c.dom">Node</A> message)</CODE>
<BR>
Posts the change represented by the given XML string to the shared diagram.</TD>
<THALIGN="left"><B>Methods inherited from class java.lang.<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TRBGCOLOR="white"CLASS="TableRowColor">
<TD><CODE><AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()"title="class or interface in java.lang">clone</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)"title="class or interface in java.lang">equals</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()"title="class or interface in java.lang">finalize</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()"title="class or interface in java.lang">getClass</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()"title="class or interface in java.lang">hashCode</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()"title="class or interface in java.lang">notify</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()"title="class or interface in java.lang">notifyAll</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()"title="class or interface in java.lang">toString</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()"title="class or interface in java.lang">wait</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)"title="class or interface in java.lang">wait</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)"title="class or interface in java.lang">wait</A></CODE></TD>
protected <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A><B>id</B></PRE>
<DL>
<DD>Holds the session ID.
<P>
<DL>
</DL>
</DL>
<HR>
<ANAME="diagram"><!----></A><H3>
diagram</H3>
<PRE>
protected <AHREF="../../../com/mxgraph/sharing/mxSharedState.html"title="class in com.mxgraph.sharing">mxSharedState</A><B>diagram</B></PRE>
<DL>
<DD>Reference to the shared diagram.
<P>
<DL>
</DL>
</DL>
<HR>
<ANAME="buffer"><!----></A><H3>
buffer</H3>
<PRE>
protected <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/StringBuffer.html?is-external=true"title="class or interface in java.lang">StringBuffer</A><B>buffer</B></PRE>
public <B>mxSession</B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A> id,
<AHREF="../../../com/mxgraph/sharing/mxSharedState.html"title="class in com.mxgraph.sharing">mxSharedState</A> diagram)</PRE>
<DL>
<DD>Constructs a new session with the given ID.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - Specifies the session ID to be used.<DD><CODE>diagram</CODE> - Reference to the shared diagram.</DL>
public <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A><B>getId</B>()</PRE>
<DL>
<DD>Returns the session ID.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<ANAME="init()"><!----></A><H3>
init</H3>
<PRE>
public <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A><B>init</B>()</PRE>
<DL>
<DD>Initializes the session buffer and returns a string that represents the
state of the session.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>Returns the initial state of the session.</DL>
</DD>
</DL>
<HR>
<ANAME="getInitialMessage()"><!----></A><H3>
getInitialMessage</H3>
<PRE>
public <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A><B>getInitialMessage</B>()</PRE>
<DL>
<DD>Returns an XML string that represents the current state of the session
and the shared diagram. A globally unique ID is used as the session's
namespace, which is used on the client side to prefix IDs of newly
public void <B>receive</B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true"title="class or interface in org.w3c.dom">Node</A> message)</PRE>
<DL>
<DD>Posts the change represented by the given XML string to the shared diagram.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>message</CODE> - XML that represents the change.</DL>
</DD>
</DL>
<HR>
<ANAME="poll()"><!----></A><H3>
poll</H3>
<PRE>
public <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A><B>poll</B>()
throws <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/InterruptedException.html?is-external=true"title="class or interface in java.lang">InterruptedException</A></PRE>
<DL>
<DD>Returns the changes received by other sessions for the shared diagram.
The method returns an empty XML node if no change was received within
10 seconds.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>Returns a string representing the changes to the shared diagram.
<DT><B>Throws:</B>
<DD><CODE><AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/InterruptedException.html?is-external=true"title="class or interface in java.lang">InterruptedException</A></CODE></DL>
</DD>
</DL>
<HR>
<ANAME="poll(long)"><!----></A><H3>
poll</H3>
<PRE>
public <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A><B>poll</B>(long timeout)
throws <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/InterruptedException.html?is-external=true"title="class or interface in java.lang">InterruptedException</A></PRE>
<DL>
<DD>Returns the changes received by other sessions for the shared diagram.
The method returns an empty XML node if no change was received within
the given timeout.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>timeout</CODE> - Time in milliseconds to wait for changes.
<DT><B>Returns:</B><DD>Returns a string representing the changes to the shared diagram.
<DT><B>Throws:</B>
<DD><CODE><AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/InterruptedException.html?is-external=true"title="class or interface in java.lang">InterruptedException</A></CODE></DL>
public void <B>diagramChanged</B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> sender,
<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A> edits)</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><AHREF="../../../com/mxgraph/sharing/mxSharedState.mxDiagramChangeListener.html#diagramChanged(java.lang.Object, java.lang.String)">mxSharedState.mxDiagramChangeListener</A></CODE></B></DD>
<DD>Fires when the shared diagram was changed.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><AHREF="../../../com/mxgraph/sharing/mxSharedState.mxDiagramChangeListener.html#diagramChanged(java.lang.Object, java.lang.String)">diagramChanged</A></CODE> in interface <CODE><AHREF="../../../com/mxgraph/sharing/mxSharedState.mxDiagramChangeListener.html"title="interface in com.mxgraph.sharing">mxSharedState.mxDiagramChangeListener</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>sender</CODE> - Session where the change was received from.<DD><CODE>edits</CODE> - String that represents the edits.</DL>
</DD>
</DL>
<HR>
<ANAME="inactiveTimeMillis()"><!----></A><H3>
inactiveTimeMillis</H3>
<PRE>
public long <B>inactiveTimeMillis</B>()</PRE>
<DL>
<DD>Returns the number of milliseconds this session has been inactive.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<ANAME="destroy()"><!----></A><H3>
destroy</H3>
<PRE>
public void <B>destroy</B>()</PRE>
<DL>
<DD>Destroys the session and removes its listener from the shared diagram.