當前位置: 首頁>>代碼示例>>Java>>正文


Java Member類代碼示例

本文整理匯總了Java中com.ecwid.consul.v1.agent.model.Member的典型用法代碼示例。如果您正苦於以下問題:Java Member類的具體用法?Java Member怎麽用?Java Member使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Member類屬於com.ecwid.consul.v1.agent.model包,在下文中一共展示了Member類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getAgentMembers

import com.ecwid.consul.v1.agent.model.Member; //導入依賴的package包/類
@Override
public Response<List<Member>> getAgentMembers() {
	RawResponse rawResponse = rawClient.makeGetRequest("/v1/agent/members");

	if (rawResponse.getStatusCode() == 200) {
		List<Member> members = GsonFactory.getGson().fromJson(rawResponse.getContent(), new TypeToken<List<Member>>() {
		}.getType());
		return new Response<List<Member>>(members, rawResponse);
	} else {
		throw new OperationException(rawResponse);
	}
}
 
開發者ID:flyaruu,項目名稱:tasman,代碼行數:13,代碼來源:AgentConsulClient.java

示例2: getAliveAgents

import com.ecwid.consul.v1.agent.model.Member; //導入依賴的package包/類
public List<Member> getAliveAgents() {
	List<Member> members = client.getAgentMembers().getValue();
	List<Member> liveMembers = new ArrayList<>(members.size());
	for (Member peer : members) {
		if (peer.getStatus() == ALIVE_STATUS) {
			liveMembers.add(peer);
		}
	}
	return liveMembers;
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-consul,代碼行數:11,代碼來源:FilteringAgentClient.java

示例3: getAliveAgentsAddresses

import com.ecwid.consul.v1.agent.model.Member; //導入依賴的package包/類
public Set<String> getAliveAgentsAddresses() {
	Set<String> addresses = new HashSet<>();
	for (Member server : getAliveAgents()) {
		addresses.add(server.getAddress());
	}
	return addresses;
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-consul,代碼行數:8,代碼來源:FilteringAgentClient.java

示例4: createMembers

import com.ecwid.consul.v1.agent.model.Member; //導入依賴的package包/類
private List<Member> createMembers() {
    List<Member> members = new ArrayList<>();
    for (int i = 0; i <= serverNumber / 254; i++) {
        int subAddress = Integer.min(254, serverNumber - i * 254);
        for (int j = 1; j <= subAddress; j++) {
            Member member = new Member();
            member.setAddress("192.168." + i + '.' + j);
            member.setStatus(ALIVE_STATUS);
            member.setName("consul-" + i + '-' + j);
            members.add(member);
        }
    }
    return members;
}
 
開發者ID:hortonworks,項目名稱:cloudbreak,代碼行數:15,代碼來源:ConsulMemberResponse.java

示例5: getAgentMembers

import com.ecwid.consul.v1.agent.model.Member; //導入依賴的package包/類
@Override
public Response<List<Member>> getAgentMembers() {
	return wrapped.getAgentMembers();
}
 
開發者ID:flyaruu,項目名稱:tasman,代碼行數:5,代碼來源:ConsulOSGiClient.java

示例6: getAgentMembers

import com.ecwid.consul.v1.agent.model.Member; //導入依賴的package包/類
@Override
public Response<List<Member>> getAgentMembers() {
	return agentClient.getAgentMembers();
}
 
開發者ID:flyaruu,項目名稱:tasman,代碼行數:5,代碼來源:ConsulClient.java

示例7: getAgentMembers

import com.ecwid.consul.v1.agent.model.Member; //導入依賴的package包/類
public Response<List<Member>> getAgentMembers(); 
開發者ID:flyaruu,項目名稱:tasman,代碼行數:2,代碼來源:AgentClient.java


注:本文中的com.ecwid.consul.v1.agent.model.Member類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。