com.realtime.xmpp
Interface XmppEndpoint

All Known Implementing Classes:
RestartingEndpoint

public interface XmppEndpoint

The most basic attributes of an XMPP end-point.

Version:
1.0 Copyright © 2002 Real Time Entertainment Group, LLC - All rights reserved.
Author:
Mike Prince

Method Summary
 void fastStart()
          Starts the endpoint.
 JID getComponentName()
          Provide the name of this component.
 XmppSession getSession()
          Provide the underlying XMPP session.
 void send(XmppStanza packet)
          Send a packet to the Jabber server.
 void start()
          Starts the endpoint.
 void stop()
          Stop the session and close the stream to the server.
 

Method Detail

getSession

public XmppSession getSession()

Provide the underlying XMPP session. The session might be open or closed.

Returns:
The XMPP session.

fastStart

public void fastStart()
               throws java.io.IOException

Starts the endpoint. Opens the socket and starts XMPP streaming. If you are interested in the XMPP session lifecycle events, then register using getSession().addListener().

NOTE: This is a non-blocking call and will likely return BEFORE the stream is ready to write to. If you want to know when the stream is ready for writing, call getSession().waitForOpen() or write an XmppSessionListener and look for the SESSION_STARTED event.

Throws:
java.io.IOException - Generated when the component could not start.

start

public void start()
           throws java.io.IOException

Starts the endpoint. Opens the socket and starts XMPP streaming. If you are interested in the XMPP session lifecycle events, then register using getSession().addListener().

This is a blocking call and uses getSession().waitForOpen() to wait until the stream has been established. Uses the default XMPP request timeout of 20 seconds.

Throws:
java.io.IOException - Generated when the component could not start.

stop

public void stop()

Stop the session and close the stream to the server. Also disable the sesson restarter.


getComponentName

public JID getComponentName()

Provide the name of this component. This method will only work AFTER a session has been started.

Returns:
The name of this component.

send

public void send(XmppStanza packet)
          throws java.io.IOException

Send a packet to the Jabber server. This method does not wait for a response.

Parameters:
packet - The packet to send.
Throws:
java.io.IOException - Generated when there are problems writing to the stream.


Copyright © 2002,2003 Real Time Entertainment Group, LLC. All Rights Reserved.