tigase.jaxmpp.core.client

## Class AbstractSessionObject

- java.lang.Object
- - tigase.jaxmpp.core.client.AbstractSessionObject

- All Implemented Interfaces:
    SessionObject, UserProperties, EventBusAware
  Direct Known Subclasses:
    GwtSessionObject, J2SESessionObject

      public abstract class AbstractSessionObject
      extends Object
      implements SessionObject, EventBusAware

  Default representation of SessionObject

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AbstractSessionObject.Entry`

    - ### Nested classes/interfaces inherited from interface tigase.jaxmpp.core.client.SessionObject

      `SessionObject.ClearedHandler, SessionObject.Scope`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Logger` | `log`
    `protected Map<String,AbstractSessionObject.Entry>` | `properties`

    - ### Fields inherited from interface tigase.jaxmpp.core.client.SessionObject

      `DOMAIN_NAME, NICKNAME, PASSWORD, RESOURCE, SERVER_NAME, USER_BARE_JID`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractSessionObject()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addClearedHandler(SessionObject.ClearedHandler handler)`
    `void` | `clear()` Reset state.
    `void` | `clear(SessionObject.Scope... scopes)` Reset state.
    `void` | `clear(Set<SessionObject.Scope> scopes)`
    `EventBus` | `getEventBus()`
    `<T> T` | `getProperty(SessionObject.Scope scope, String key)`
    `<T> T` | `getProperty(String key)` Returns property
    `BareJID` | `getUserBareJid()` Returns users JID
    `<T> T` | `getUserProperty(String key)` Get user property.
    `void` | `removeClearedHandler(SessionObject.ClearedHandler handler)`
    `void` | `setEventBus(EventBus eventBus)`
    `SessionObject` | `setProperty(SessionObject.Scope scope, String key, Object value)` Set property in given scope.
    `SessionObject` | `setProperty(String key, Object value)` Set property in session scope.
    `UserProperties` | `setUserProperty(String key, Object value)` Set user property.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### log

          protected final Logger log

    - #### properties

          protected Map<String,AbstractSessionObject.Entry> properties

  - ### Constructor Detail

    - #### AbstractSessionObject

          protected AbstractSessionObject()

  - ### Method Detail

    - #### addClearedHandler

          public void addClearedHandler(SessionObject.ClearedHandler handler)

    - #### clear

          public void clear()
                     throws JaxmppException

      Reset state. Clears all properties stored by modules, roster and presence store. Users properties are keeped.
      Specified by:
        `clear` in interface `SessionObject`
      Throws:
        `JaxmppException`

    - #### clear

          public void clear(SessionObject.Scope... scopes)
                     throws JaxmppException

      Reset state. Clears given properties stored by modules. Roster and presence store will be cleared if SessionObject.Scope.session is in parameters.
      Specified by:
        `clear` in interface `SessionObject`
      Throws:
        `JaxmppException`

    - #### clear

          public void clear(Set<SessionObject.Scope> scopes)
                     throws JaxmppException

      Throws:
        `JaxmppException`

    - #### getEventBus

          public EventBus getEventBus()

    - #### setEventBus

          public void setEventBus(EventBus eventBus)

      Specified by:
        `setEventBus` in interface `EventBusAware`

    - #### getProperty

          public <T> T getProperty(SessionObject.Scope scope,
                                   String key)

    - #### getProperty

          public <T> T getProperty(String key)

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

    - #### 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.

    - #### removeClearedHandler

          public void removeClearedHandler(SessionObject.ClearedHandler handler)

    - #### setProperty

          public SessionObject setProperty(SessionObject.Scope scope,
                                           String key,
                                           Object value)

      Description copied from interface: `SessionObject`
      Set property in given scope.
      Specified by:
        `setProperty` in interface `SessionObject`
      Parameters:
        `scope` - scope of property
        `key` - property name
        `value` - property value. `null` to unset property.
      Returns:
        instance of `this` SessionObject

    - #### setProperty

          public SessionObject setProperty(String key,
                                           Object value)

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

    - #### 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

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2006–2019 Tigase. All rights reserved.