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

io.servicefabric.cluster.fdetector.FailureDetectorEvent Maven / Gradle / Ivy

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

import static io.servicefabric.cluster.ClusterMemberStatus.SUSPECTED;
import static io.servicefabric.cluster.ClusterMemberStatus.TRUSTED;

import com.google.common.base.Objects;
import io.servicefabric.cluster.ClusterEndpoint;
import io.servicefabric.cluster.ClusterMemberStatus;

/** Tuple class. Contains cluster endpoint and its status. */
public final class FailureDetectorEvent {
	private final ClusterEndpoint endpoint;
	private final ClusterMemberStatus status;

	private FailureDetectorEvent(ClusterEndpoint endpoint, ClusterMemberStatus status) {
		this.endpoint = endpoint;
		this.status = status;
	}

	public static FailureDetectorEvent TRUSTED(ClusterEndpoint endpoint) {
		return new FailureDetectorEvent(endpoint, TRUSTED);
	}

	public static FailureDetectorEvent SUSPECTED(ClusterEndpoint endpoint) {
		return new FailureDetectorEvent(endpoint, SUSPECTED);
	}

	public ClusterEndpoint endpoint() {
		return endpoint;
	}

	public ClusterMemberStatus status() {
		return status;
	}

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy