Search in sources :

Example 6 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);
            Object result = doSynchronousClusterTask(task);
            initialized = result != null && (Boolean) result ? 1 : 0;
        }
    }
    return initialized == 1;
}
Also used : ClusterTask(org.jivesoftware.util.cache.ClusterTask) Presence(org.xmpp.packet.Presence)

Example 7 with ClusterTask

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

the class RemoteOutgoingServerSession method isUsingServerDialback.

public boolean isUsingServerDialback() {
    if (usingServerDialback == -1) {
        ClusterTask task = getRemoteSessionTask(RemoteSessionTask.Operation.isUsingServerDialback);
        usingServerDialback = (Boolean) doSynchronousClusterTask(task) ? 1 : 0;
    }
    return usingServerDialback == 1;
}
Also used : ClusterTask(org.jivesoftware.util.cache.ClusterTask)

Example 8 with ClusterTask

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

the class RemoteSession method getCreationDate.

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

Example 9 with ClusterTask

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

the class RemoteSession method getNumClientPackets.

public long getNumClientPackets() {
    ClusterTask task = getRemoteSessionTask(RemoteSessionTask.Operation.getNumClientPackets);
    final Object clusterTaskResult = doSynchronousClusterTask(task);
    return clusterTaskResult == null ? -1 : (Long) clusterTaskResult;
}
Also used : ClusterTask(org.jivesoftware.util.cache.ClusterTask)

Example 10 with ClusterTask

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

the class RemoteSession method isSecure.

public boolean isSecure() {
    ClusterTask task = getRemoteSessionTask(RemoteSessionTask.Operation.isSecure);
    final Object clusterTaskResult = doSynchronousClusterTask(task);
    return clusterTaskResult == null ? false : (Boolean) clusterTaskResult;
}
Also used : ClusterTask(org.jivesoftware.util.cache.ClusterTask)

Aggregations

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