tigase.jaxmpp.core.client
Class JaxmppCore

java.lang.Object
  extended by tigase.jaxmpp.core.client.JaxmppCore

public abstract class JaxmppCore
extends Object

Base abstract class for implementation platform-specific jaxmpp clients.

Events:
Connected : JaxmppEvent ()
Fires when client is fully connected.
Disconnected : JaxmppEvent ()
Fires when client disconnects.


Nested Class Summary
static class JaxmppCore.JaxmppEvent
           
 
Field Summary
static String AUTOADD_STANZA_ID_KEY
           
static EventType Connected
           
protected  Connector connector
           
static EventType Disconnected
           
protected  Logger log
           
protected  XmppModulesManager modulesManager
           
protected  Observable observable
           
protected  Processor processor
           
protected  Listener<ResourceBinderModule.ResourceBindEvent> resourceBindListener
           
protected  XmppSessionLogic sessionLogic
           
protected  AbstractSessionObject sessionObject
           
protected  Listener<Connector.ConnectorEvent> stanzaReceivedListener
           
protected  Listener<Connector.ConnectorEvent> streamErrorListener
           
protected  Listener<Connector.ConnectorEvent> streamTerminateListener
           
protected  PacketWriter writer
           
 
Constructor Summary
JaxmppCore(SessionObject sessionObject)
           
 
Method Summary
 void addListener(EventType eventType, Listener<?> listener)
           
 void addListener(Listener<?> listener)
           
 Chat createChat(JID jid)
           
abstract  void disconnect()
           
abstract
<T extends ConnectionConfiguration>
T
getConnectionConfiguration()
          Returns configurator.
 Connector getConnector()
           
<T extends XmppModule>
T
getModule(Class<T> moduleClass)
          Return module implementation by module class.
 XmppModulesManager getModulesManager()
           
 PresenceStore getPresence()
           
 UserProperties getProperties()
           
 RosterStore getRoster()
           
 SessionObject getSessionObject()
           
 boolean isConnected()
           
 boolean isSecure()
           
 void keepalive()
          Whitespace ping.
abstract  void login()
           
protected  void modulesInit()
           
protected abstract  void onException(JaxmppException e)
           
protected abstract  void onResourceBinded(ResourceBinderModule.ResourceBindEvent be)
           
protected abstract  void onStanzaReceived(Element stanza)
           
protected abstract  void onStreamError(Connector.ConnectorEvent be)
           
protected abstract  void onStreamTerminated(Connector.ConnectorEvent be)
           
 void removeAllListeners()
           
 void removeListener(EventType eventType, Listener<? extends BaseEvent> connectorListener)
           
 void removeListener(Listener<?> listener)
           
 void send(Stanza stanza)
           
 void send(Stanza stanza, AsyncCallback asyncCallback)
           
 void send(Stanza stanza, Long timeout, AsyncCallback asyncCallback)
           
 void sendMessage(JID toJID, String subject, String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTOADD_STANZA_ID_KEY

public static final String AUTOADD_STANZA_ID_KEY
See Also:
Constant Field Values

Connected

public static final EventType Connected

Disconnected

public static final EventType Disconnected

connector

protected Connector connector

log

protected final Logger log

modulesManager

protected final XmppModulesManager modulesManager

observable

protected final Observable observable

processor

protected Processor processor

resourceBindListener

protected final Listener<ResourceBinderModule.ResourceBindEvent> resourceBindListener

sessionLogic

protected XmppSessionLogic sessionLogic

sessionObject

protected final AbstractSessionObject sessionObject

stanzaReceivedListener

protected final Listener<Connector.ConnectorEvent> stanzaReceivedListener

streamErrorListener

protected final Listener<Connector.ConnectorEvent> streamErrorListener

streamTerminateListener

protected final Listener<Connector.ConnectorEvent> streamTerminateListener

writer

protected final PacketWriter writer
Constructor Detail

JaxmppCore

public JaxmppCore(SessionObject sessionObject)
Method Detail

addListener

public void addListener(EventType eventType,
                        Listener<?> listener)

addListener

public void addListener(Listener<?> listener)

createChat

public Chat createChat(JID jid)
                throws JaxmppException
Throws:
JaxmppException

disconnect

public abstract void disconnect()
                         throws JaxmppException
Throws:
JaxmppException

getConnectionConfiguration

public abstract <T extends ConnectionConfiguration> T getConnectionConfiguration()
Returns configurator. This wrapper for SessionObject.

Returns:
configuration

getConnector

public Connector getConnector()

getModule

public <T extends XmppModule> T getModule(Class<T> moduleClass)
Return module implementation by module class. This method calls XmppModulesManager.getModule(Class).

Parameters:
moduleClass - module class
Returns:
module implementation

getModulesManager

public XmppModulesManager getModulesManager()

getPresence

public PresenceStore getPresence()

getProperties

public UserProperties getProperties()

getRoster

public RosterStore getRoster()

getSessionObject

public SessionObject getSessionObject()

isConnected

public boolean isConnected()

isSecure

public boolean isSecure()

keepalive

public void keepalive()
               throws JaxmppException
Whitespace ping.

Throws:
JaxmppException

login

public abstract void login()
                    throws JaxmppException
Throws:
JaxmppException

modulesInit

protected void modulesInit()

onException

protected abstract void onException(JaxmppException e)
                             throws JaxmppException
Throws:
JaxmppException

onResourceBinded

protected abstract void onResourceBinded(ResourceBinderModule.ResourceBindEvent be)
                                  throws JaxmppException
Throws:
JaxmppException

onStanzaReceived

protected abstract void onStanzaReceived(Element stanza)
                                  throws JaxmppException
Throws:
JaxmppException

onStreamError

protected abstract void onStreamError(Connector.ConnectorEvent be)
                               throws JaxmppException
Throws:
JaxmppException

onStreamTerminated

protected abstract void onStreamTerminated(Connector.ConnectorEvent be)
                                    throws JaxmppException
Throws:
JaxmppException

removeAllListeners

public void removeAllListeners()

removeListener

public void removeListener(EventType eventType,
                           Listener<? extends BaseEvent> connectorListener)

removeListener

public void removeListener(Listener<?> listener)

send

public void send(Stanza stanza)
          throws XMLException,
                 JaxmppException
Throws:
XMLException
JaxmppException

send

public void send(Stanza stanza,
                 AsyncCallback asyncCallback)
          throws XMLException,
                 JaxmppException
Throws:
XMLException
JaxmppException

send

public void send(Stanza stanza,
                 Long timeout,
                 AsyncCallback asyncCallback)
          throws JaxmppException
Throws:
JaxmppException

sendMessage

public void sendMessage(JID toJID,
                        String subject,
                        String message)
                 throws XMLException,
                        JaxmppException
Throws:
XMLException
JaxmppException


Copyright © 2006-2012 Tigase. All Rights Reserved.