Search in sources :

Example 1 with MemberAttributeOperationType

use of com.hazelcast.cluster.MemberAttributeOperationType in project hazelcast by hazelcast.

the class ClientMembershipListener method handle.

@Override
public void handle(String uuid, String key, int opType, String value) {
    Collection<Member> members = clusterService.getMemberList();
    for (Member target : members) {
        if (target.getUuid().equals(uuid)) {
            final MemberAttributeOperationType operationType = MemberAttributeOperationType.getValue(opType);
            ((AbstractMember) target).updateAttribute(operationType, key, value);
            MemberAttributeEvent memberAttributeEvent = new MemberAttributeEvent(client.getCluster(), target, operationType, key, value);
            clusterService.fireMemberAttributeEvent(memberAttributeEvent);
            break;
        }
    }
}
Also used : MemberAttributeOperationType(com.hazelcast.cluster.MemberAttributeOperationType) AbstractMember(com.hazelcast.instance.AbstractMember) MemberAttributeEvent(com.hazelcast.core.MemberAttributeEvent) AbstractMember(com.hazelcast.instance.AbstractMember) Member(com.hazelcast.core.Member)

Aggregations

MemberAttributeOperationType (com.hazelcast.cluster.MemberAttributeOperationType)1 Member (com.hazelcast.core.Member)1 MemberAttributeEvent (com.hazelcast.core.MemberAttributeEvent)1 AbstractMember (com.hazelcast.instance.AbstractMember)1