All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.servicefabric.cluster.ClusterMembershipData Maven / Gradle / Ivy

There is a newer version: 0.0.4
Show newest version
package io.servicefabric.cluster;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.google.common.base.Objects;
import io.protostuff.Tag;

/** DTO class. Contains a snapshot of cluster members and cluster identifier. */
public final class ClusterMembershipData {
	/** A 'snapshot' of cluster members. */
	@Tag(1)
	private List membership = new ArrayList<>();
	/** Sort of cluster identifier. Only makes sense at cluster membership SYNC/SYNC_ACK transitions. */
	@Tag(2)
	private String syncGroup;

	ClusterMembershipData(Collection membership, String syncGroup) {
		this.membership = new ArrayList<>(membership);
		this.syncGroup = syncGroup;
	}

	Collection getMembership() {
		return new ArrayList<>(membership);
	}

	String getSyncGroup() {
		return syncGroup;
	}

	@Override
	public String toString() {
		return Objects.toStringHelper(this)
				.add("membership", membership)
				.add("syncGroup", syncGroup)
				.toString();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy