Search in sources :

Example 1 with ClusterTask

use of org.jivesoftware.util.cache.ClusterTask in project Openfire by igniterealtime.

the class RemoteClientSession method isInitialized.

public boolean isInitialized() {
    if (initialized == -1) {
        Presence presence = getPresence();
        if (presence != null && presence.isAvailable()) {
            // Optimization to avoid making a remote call
            initialized = 1;
        } else {
            ClusterTask task = getRemoteSessionTask(RemoteSessionTask.Operation.isInitialized);
            initialized = (Boolean) doSynchronousClusterTask(task) ? 1 : 0;
        }
    }
    return initialized == 1;
}
Also used : ClusterTask(org.jivesoftware.util.cache.ClusterTask) Presence(org.xmpp.packet.Presence)

Example 2 with ClusterTask

use of org.jivesoftware.util.cache.ClusterTask in project Openfire by igniterealtime.

the class RemoteSession method getServerName.

public String getServerName() {
    if (serverName == null) {
        ClusterTask task = getRemoteSessionTask(RemoteSessionTask.Operation.getServerName);
        serverName = (String) doSynchronousClusterTask(task);
    }
    return serverName;
}
Also used : ClusterTask(org.jivesoftware.util.cache.ClusterTask)

Example 3 with ClusterTask

use of org.jivesoftware.util.cache.ClusterTask in project Openfire by igniterealtime.

the class RemoteSession method getHostAddress.

public String getHostAddress() throws UnknownHostException {
    if (hostAddress == null) {
        ClusterTask task = getRemoteSessionTask(RemoteSessionTask.Operation.getHostAddress);
        hostAddress = (String) doSynchronousClusterTask(task);
    }
    return hostAddress;
}
Also used : ClusterTask(org.jivesoftware.util.cache.ClusterTask)

Example 4 with ClusterTask

use of org.jivesoftware.util.cache.ClusterTask in project Openfire by igniterealtime.

the class RemoteSession method getHostName.

public String getHostName() throws UnknownHostException {
    if (hostName == null) {
        ClusterTask task = getRemoteSessionTask(RemoteSessionTask.Operation.getHostName);
        hostName = (String) doSynchronousClusterTask(task);
    }
    return hostName;
}
Also used : ClusterTask(org.jivesoftware.util.cache.ClusterTask)

Example 5 with ClusterTask

use of org.jivesoftware.util.cache.ClusterTask in project Openfire by igniterealtime.

the class RemoteSession method getStreamID.

public StreamID getStreamID() {
    // Get it once and cache it since it never changes
    if (streamID == null) {
        ClusterTask task = getRemoteSessionTask(RemoteSessionTask.Operation.getStreamID);
        streamID = (StreamID) doSynchronousClusterTask(task);
    }
    return streamID;
}
Also used : ClusterTask(org.jivesoftware.util.cache.ClusterTask)

Aggregations

ClusterTask (org.jivesoftware.util.cache.ClusterTask)21 Presence (org.xmpp.packet.Presence)2