Search in sources :

Example 1 with HazelcastClusterNodeInfo

use of org.jivesoftware.openfire.plugin.util.cluster.HazelcastClusterNodeInfo in project Openfire by igniterealtime.

the class ClusteredCacheFactory method getClusterNodeInfo.

public ClusterNodeInfo getClusterNodeInfo(byte[] nodeID) {
    if (cluster == null) {
        return null;
    }
    ClusterNodeInfo result = null;
    Member member = getMember(nodeID);
    if (member != null) {
        result = new HazelcastClusterNodeInfo(member, cluster.getClusterTime());
    }
    return result;
}
Also used : HazelcastClusterNodeInfo(org.jivesoftware.openfire.plugin.util.cluster.HazelcastClusterNodeInfo) ClusterNodeInfo(org.jivesoftware.openfire.cluster.ClusterNodeInfo) Member(com.hazelcast.core.Member) HazelcastClusterNodeInfo(org.jivesoftware.openfire.plugin.util.cluster.HazelcastClusterNodeInfo)

Example 2 with HazelcastClusterNodeInfo

use of org.jivesoftware.openfire.plugin.util.cluster.HazelcastClusterNodeInfo in project Openfire by igniterealtime.

the class ClusterListener method memberAdded.

public void memberAdded(MembershipEvent event) {
    // local member only
    if (event.getMember().localMember()) {
        // We left and re-joined the cluster
        joinCluster();
    } else {
        nodePresences.put(NodeID.getInstance(StringUtils.getBytes(event.getMember().getUuid())), new ConcurrentHashMap<String, Collection<String>>());
        // Trigger event that a new node has joined the cluster
        ClusterManager.fireJoinedCluster(StringUtils.getBytes(event.getMember().getUuid()), true);
    }
    clusterNodesInfo.put(event.getMember().getUuid(), new HazelcastClusterNodeInfo(event.getMember(), cluster.getClusterTime()));
}
Also used : Collection(java.util.Collection) HazelcastClusterNodeInfo(org.jivesoftware.openfire.plugin.util.cluster.HazelcastClusterNodeInfo)

Example 3 with HazelcastClusterNodeInfo

use of org.jivesoftware.openfire.plugin.util.cluster.HazelcastClusterNodeInfo in project Openfire by igniterealtime.

the class ClusterListener method memberAttributeChanged.

@Override
public void memberAttributeChanged(MemberAttributeEvent event) {
    ClusterNodeInfo priorNodeInfo = clusterNodesInfo.get(event.getMember().getUuid());
    clusterNodesInfo.put(event.getMember().getUuid(), new HazelcastClusterNodeInfo(event.getMember(), priorNodeInfo.getJoinedTime()));
}
Also used : HazelcastClusterNodeInfo(org.jivesoftware.openfire.plugin.util.cluster.HazelcastClusterNodeInfo) ClusterNodeInfo(org.jivesoftware.openfire.cluster.ClusterNodeInfo) HazelcastClusterNodeInfo(org.jivesoftware.openfire.plugin.util.cluster.HazelcastClusterNodeInfo)

Aggregations

HazelcastClusterNodeInfo (org.jivesoftware.openfire.plugin.util.cluster.HazelcastClusterNodeInfo)3 ClusterNodeInfo (org.jivesoftware.openfire.cluster.ClusterNodeInfo)2 Member (com.hazelcast.core.Member)1 Collection (java.util.Collection)1