Search in sources :

Example 1 with ClientSessionInfo

use of org.jivesoftware.openfire.session.ClientSessionInfo in project Openfire by igniterealtime.

the class RemoteClientSession method getActiveList.

public PrivacyList getActiveList() {
    Cache<String, ClientSessionInfo> cache = SessionManager.getInstance().getSessionInfoCache();
    ClientSessionInfo sessionInfo = cache.get(getAddress().toString());
    if (sessionInfo != null && sessionInfo.getActiveList() != null) {
        return PrivacyListManager.getInstance().getPrivacyList(address.getNode(), sessionInfo.getActiveList());
    }
    return null;
}
Also used : ClientSessionInfo(org.jivesoftware.openfire.session.ClientSessionInfo)

Example 2 with ClientSessionInfo

use of org.jivesoftware.openfire.session.ClientSessionInfo in project Openfire by igniterealtime.

the class RemoteClientSession method isOfflineFloodStopped.

public boolean isOfflineFloodStopped() {
    Cache<String, ClientSessionInfo> cache = SessionManager.getInstance().getSessionInfoCache();
    ClientSessionInfo sessionInfo = cache.get(getAddress().toString());
    return sessionInfo != null && sessionInfo.isOfflineFloodStopped();
}
Also used : ClientSessionInfo(org.jivesoftware.openfire.session.ClientSessionInfo)

Example 3 with ClientSessionInfo

use of org.jivesoftware.openfire.session.ClientSessionInfo in project Openfire by igniterealtime.

the class RemoteClientSession method getDefaultList.

public PrivacyList getDefaultList() {
    Cache<String, ClientSessionInfo> cache = SessionManager.getInstance().getSessionInfoCache();
    ClientSessionInfo sessionInfo = cache.get(getAddress().toString());
    if (sessionInfo != null && sessionInfo.getDefaultList() != null) {
        return PrivacyListManager.getInstance().getPrivacyList(address.getNode(), sessionInfo.getDefaultList());
    }
    return null;
}
Also used : ClientSessionInfo(org.jivesoftware.openfire.session.ClientSessionInfo)

Example 4 with ClientSessionInfo

use of org.jivesoftware.openfire.session.ClientSessionInfo in project Openfire by igniterealtime.

the class SessionManager method addSession.

/**
     * Add a new session to be managed. The session has been authenticated and resource
     * binding has been done.
     *
     * @param session the session that was authenticated.
     */
public void addSession(LocalClientSession session) {
    // Add session to the routing table (routing table will know session is not available yet)
    routingTable.addClientRoute(session.getAddress(), session);
    // Remove the pre-Authenticated session but remember to use the temporary ID as the key
    localSessionManager.getPreAuthenticatedSessions().remove(session.getStreamID().toString());
    SessionEventDispatcher.EventType event = session.getAuthToken().isAnonymous() ? SessionEventDispatcher.EventType.anonymous_session_created : SessionEventDispatcher.EventType.session_created;
    // Fire session created event.
    SessionEventDispatcher.dispatchEvent(session, event);
    if (ClusterManager.isClusteringStarted()) {
        // Track information about the session and share it with other cluster nodes
        sessionInfoCache.put(session.getAddress().toString(), new ClientSessionInfo(session));
    }
}
Also used : SessionEventDispatcher(org.jivesoftware.openfire.event.SessionEventDispatcher) ClientSessionInfo(org.jivesoftware.openfire.session.ClientSessionInfo)

Example 5 with ClientSessionInfo

use of org.jivesoftware.openfire.session.ClientSessionInfo in project Openfire by igniterealtime.

the class RemoteClientSession method isOfflineFloodStopped.

public boolean isOfflineFloodStopped() {
    Cache<String, ClientSessionInfo> cache = SessionManager.getInstance().getSessionInfoCache();
    ClientSessionInfo sessionInfo = cache.get(getAddress().toString());
    return sessionInfo != null && sessionInfo.isOfflineFloodStopped();
}
Also used : ClientSessionInfo(org.jivesoftware.openfire.session.ClientSessionInfo)

Aggregations

ClientSessionInfo (org.jivesoftware.openfire.session.ClientSessionInfo)9 SessionEventDispatcher (org.jivesoftware.openfire.event.SessionEventDispatcher)1 Presence (org.xmpp.packet.Presence)1