Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright (C) 2015 Matt Christiansen ([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.nikore.consul.v1;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.core.JsonProcessingException;
import net.nikore.consul.v1.acl.AclClient;
import net.nikore.consul.v1.acl.AclConsulClient;
import net.nikore.consul.v1.acl.model.Acl;
import net.nikore.consul.v1.acl.model.NewAcl;
import net.nikore.consul.v1.acl.model.UpdateAcl;
import net.nikore.consul.v1.agent.AgentClient;
import net.nikore.consul.v1.agent.AgentConsulClient;
import net.nikore.consul.v1.agent.model.Member;
import net.nikore.consul.v1.agent.model.NewCheck;
import net.nikore.consul.v1.agent.model.NewService;
import net.nikore.consul.v1.agent.model.Self;
import net.nikore.consul.v1.agent.model.Service;
import net.nikore.consul.v1.catalog.CatalogClient;
import net.nikore.consul.v1.catalog.CatalogConsulClient;
import net.nikore.consul.v1.catalog.model.CatalogDeregistration;
import net.nikore.consul.v1.catalog.model.CatalogNode;
import net.nikore.consul.v1.catalog.model.CatalogRegistration;
import net.nikore.consul.v1.catalog.model.CatalogService;
import net.nikore.consul.v1.catalog.model.Node;
import net.nikore.consul.v1.event.EventClient;
import net.nikore.consul.v1.event.EventConsulClient;
import net.nikore.consul.v1.event.model.Event;
import net.nikore.consul.v1.event.model.EventParams;
import net.nikore.consul.v1.health.HealthClient;
import net.nikore.consul.v1.health.HealthConsulClient;
import net.nikore.consul.v1.health.model.HealthService;
import net.nikore.consul.v1.kv.KeyValueClient;
import net.nikore.consul.v1.kv.KeyValueConsulClient;
import net.nikore.consul.v1.kv.model.GetBinaryValue;
import net.nikore.consul.v1.kv.model.GetValue;
import net.nikore.consul.v1.health.model.Check;
import net.nikore.consul.v1.kv.model.PutParams;
import net.nikore.consul.v1.session.SessionClient;
import net.nikore.consul.v1.session.SessionConsulClient;
import net.nikore.consul.v1.session.model.NewSession;
import net.nikore.consul.v1.session.model.Session;
import net.nikore.consul.v1.status.StatusClient;
import net.nikore.consul.v1.status.StatusConsulClient;
public final class ConsulClient implements AclClient, AgentClient, CatalogClient, EventClient, HealthClient, KeyValueClient, SessionClient, StatusClient {
private final AclClient aclClient;
private final AgentClient agentClient;
private final CatalogClient catalogClient;
private final EventClient eventClient;
private final HealthClient healthClient;
private final KeyValueClient keyValueClient;
private final SessionClient sessionClient;
private final StatusClient statusClient;
public ConsulClient(ConsulRawClient rawClient) {
aclClient = new AclConsulClient(rawClient);
agentClient = new AgentConsulClient(rawClient);
catalogClient = new CatalogConsulClient(rawClient);
eventClient = new EventConsulClient(rawClient);
healthClient = new HealthConsulClient(rawClient);
keyValueClient = new KeyValueConsulClient(rawClient);
sessionClient = new SessionConsulClient(rawClient);
statusClient = new StatusConsulClient(rawClient);
}
public ConsulClient() {
this(new ConsulRawClient());
}
public ConsulClient(String agentHost) {
this(new ConsulRawClient(agentHost));
}
public ConsulClient(String agentHost, int agentPort) {
this(new ConsulRawClient(agentHost, agentPort));
}
@Override
public Response aclCreate(NewAcl newAcl, String token) throws IOException {
return aclClient.aclCreate(newAcl, token);
}
@Override
public Response aclUpdate(UpdateAcl updateAcl, String token) throws JsonProcessingException {
return aclClient.aclUpdate(updateAcl, token);
}
@Override
public Response aclDestroy(String aclId, String token) {
return aclClient.aclDestroy(aclId, token);
}
@Override
public Response getAcl(String id) throws IOException {
return aclClient.getAcl(id);
}
@Override
public Response aclClone(String aclId, String token) throws IOException {
return aclClient.aclClone(aclId, token);
}
@Override
public Response> getAclList(String token) throws IOException {
return aclClient.getAclList(token);
}
@Override
public Response