com::mxgraph::mxSession Class Reference

Implements a session that may be attached to a shared diagram. More...

List of all members.

Public Member Functions

 mxSession (string id, mxSharedDiagram diagram)
 Constructs a new session with the given ID.
string Init ()
 Initializes the session buffer and returns a string that represents the state of the session.
string GetInitialMessage ()
 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 created cells.
void Receive (XmlNode message)
 Posts the change represented by the given XML string to the shared diagram.
string Poll ()
 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.
string Poll (int timeout)
 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.
void DiagramChanged (Object sender, string xml)
 Invoked when the shared diagram has changed.
long InactiveTimeMillis ()
 Returns the number of milliseconds this session has been inactive.
void Destroy ()
 Destroys the session and removes its listener from the shared diagram.

Static Public Attributes

static int DEFAULT_TIMEOUT = 10000
 Default timeout is 10000 ms.

Protected Attributes

string id
 Holds the session ID.
mxSharedDiagram diagram
 Reference to the shared diagram.
StringBuilder buffer = new StringBuilder()
 Holds the send buffer for this session.
long lastTimeMillis = 0
 Holds the last active time millis.

Properties

string Id [get]
 Returns the session ID.

Detailed Description

Implements a session that may be attached to a shared diagram.


Constructor & Destructor Documentation

com::mxgraph::mxSession::mxSession ( string  id,
mxSharedDiagram  diagram 
) [inline]

Constructs a new session with the given ID.

Parameters:
id Specifies the session ID to be used.
diagram Reference to the shared diagram.

Member Function Documentation

void com::mxgraph::mxSession::Destroy (  )  [inline]

Destroys the session and removes its listener from the shared diagram.

void com::mxgraph::mxSession::DiagramChanged ( Object  sender,
string  xml 
) [inline]

Invoked when the shared diagram has changed.

Parameters:
sender Session where the change was received from.
xml XML string that represents the change.
string com::mxgraph::mxSession::GetInitialMessage (  )  [inline]

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 created cells.

long com::mxgraph::mxSession::InactiveTimeMillis (  )  [inline]

Returns the number of milliseconds this session has been inactive.

string com::mxgraph::mxSession::Init (  )  [inline]

Initializes the session buffer and returns a string that represents the state of the session.

Returns:
Returns the initial state of the session.
string com::mxgraph::mxSession::Poll ( int  timeout  )  [inline]

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.

Parameters:
timeout Time in milliseconds to wait for changes.
Returns:
Returns a string representing the changes to the shared diagram.
string com::mxgraph::mxSession::Poll (  )  [inline]

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.

Returns:
Returns a string representing the changes to the shared diagram.
void com::mxgraph::mxSession::Receive ( XmlNode  message  )  [inline]

Posts the change represented by the given XML string to the shared diagram.

Parameters:
xml XML string that represents the change.

Member Data Documentation

StringBuilder com::mxgraph::mxSession::buffer = new StringBuilder() [protected]

Holds the send buffer for this session.

Default timeout is 10000 ms.

Reference to the shared diagram.

string com::mxgraph::mxSession::id [protected]

Holds the session ID.

Holds the last active time millis.


Property Documentation

string com::mxgraph::mxSession::Id [get]

Returns the session ID.


The documentation for this class was generated from the following file:
Generated on Mon Oct 29 20:11:49 2012 for mxGraph by  doxygen 1.6.3