use of com.navercorp.pinpoint.rpc.cluster.Role in project pinpoint by naver.
the class PinpointClientHandshaker method getClusterOption.
private ClusterOption getClusterOption(Map handshakeResponse) {
if (handshakeResponse == Collections.EMPTY_MAP) {
return ClusterOption.DISABLE_CLUSTER_OPTION;
}
Map cluster = (Map) handshakeResponse.get(ControlHandshakeResponsePacket.CLUSTER);
if (cluster == null) {
return ClusterOption.DISABLE_CLUSTER_OPTION;
}
String id = MapUtils.getString(cluster, "id", "");
List<Role> roles = getRoles((List) cluster.get("roles"));
if (StringUtils.isEmpty(id)) {
return ClusterOption.DISABLE_CLUSTER_OPTION;
} else {
return new ClusterOption(true, id, roles);
}
}
Aggregations