tigase.jaxmpp.core.client
Class AbstractSessionObject

java.lang.Object
  extended by tigase.jaxmpp.core.client.AbstractSessionObject
All Implemented Interfaces:
SessionObject, UserProperties

public abstract class AbstractSessionObject
extends Object
implements SessionObject

Default representation of SessionObject


Field Summary
protected  Logger log
           
protected  PresenceStore presence
           
protected  Map<String,Object> properties
           
protected  ResponseManager responseManager
           
protected  RosterStore roster
           
protected  Element streamFeatures
           
protected  Map<String,Object> userProperties
           
 
Fields inherited from interface tigase.jaxmpp.core.client.SessionObject
DOMAIN_NAME, NICKNAME, PASSWORD, RESOURCE, SERVER_NAME, USER_BARE_JID
 
Constructor Summary
protected AbstractSessionObject()
           
 
Method Summary
 void checkHandlersTimeout()
          Method for process stanzas without response.
 void clear()
          Reset state.
 JID getBindedJid()
          Returns users JID binded on server.
 PresenceStore getPresence()
          Returns Store of known presences.
<T> T
getProperty(String key)
          Returns property
 Runnable getResponseHandler(Element element, PacketWriter writer)
          
 RosterStore getRoster()
          Returns roster store
 Element getStreamFeatures()
          Returns XMPP Stream features
 BareJID getUserBareJid()
          Returns users JID
<T> T
getUserProperty(String key)
          Get user property.
 String registerResponseHandler(Element stanza, Long timeout, AsyncCallback callback)
           
 SessionObject setProperty(String key, Object value)
          Set property.
 void setStreamFeatures(Element element)
          Set XMPP Stream features
 UserProperties setUserProperty(String key, Object value)
          Set user property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final Logger log

presence

protected PresenceStore presence

properties

protected Map<String,Object> properties

responseManager

protected ResponseManager responseManager

roster

protected RosterStore roster

streamFeatures

protected Element streamFeatures

userProperties

protected Map<String,Object> userProperties
Constructor Detail

AbstractSessionObject

protected AbstractSessionObject()
Method Detail

checkHandlersTimeout

public void checkHandlersTimeout()
                          throws JaxmppException
Method for process stanzas without response.

Specified by:
checkHandlersTimeout in interface SessionObject
Throws:
JaxmppException

clear

public void clear()
           throws JaxmppException
Reset state. Clears all properties stored by modules. Users properties are keeped.

Specified by:
clear in interface SessionObject
Throws:
JaxmppException

getBindedJid

public JID getBindedJid()
Returns users JID binded on server.

Specified by:
getBindedJid in interface SessionObject
Returns:
Jabber ID

getPresence

public PresenceStore getPresence()
Returns Store of known presences.

Specified by:
getPresence in interface SessionObject
Returns:
presence store

getProperty

public <T> T getProperty(String key)
Returns property

Specified by:
getProperty in interface SessionObject
Parameters:
key - property name
Returns:
property

getResponseHandler

public Runnable getResponseHandler(Element element,
                                   PacketWriter writer)
                            throws JaxmppException

Throws:
JaxmppException

getRoster

public RosterStore getRoster()
Returns roster store

Specified by:
getRoster in interface SessionObject
Returns:
roster

getStreamFeatures

public Element getStreamFeatures()
Returns XMPP Stream features

Specified by:
getStreamFeatures in interface SessionObject
Returns:
element with features

getUserBareJid

public BareJID getUserBareJid()
Returns users JID

Specified by:
getUserBareJid in interface SessionObject
Returns:

getUserProperty

public <T> T getUserProperty(String key)
Get user property.

Specified by:
getUserProperty in interface UserProperties
Parameters:
key - property name
Returns:
property or null if property isn't set.

registerResponseHandler

public String registerResponseHandler(Element stanza,
                                      Long timeout,
                                      AsyncCallback callback)
                               throws XMLException
Throws:
XMLException

setProperty

public SessionObject setProperty(String key,
                                 Object value)
Set property.

Specified by:
setProperty in interface SessionObject
Parameters:
key - property name
value - property value. null to unset property.
Returns:
instance of this SessionObject

setStreamFeatures

public void setStreamFeatures(Element element)
Set XMPP Stream features

Specified by:
setStreamFeatures in interface SessionObject
Parameters:
element - element contains features

setUserProperty

public UserProperties setUserProperty(String key,
                                      Object value)
Set user property.

Specified by:
setUserProperty in interface UserProperties
Parameters:
key - property name
value - property value. null to unset property
Returns:
instance of this UserProperties


Copyright © 2006-2012 Tigase. All Rights Reserved.