Package org.kiwiproject.consul
Class Consul
java.lang.Object
org.kiwiproject.consul.Consul
Client for interacting with the Consul HTTP API.
- Author:
- rfast
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault Consul HTTP API host.static final intDefault Consul HTTP API port. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConsul(AgentClient agentClient, HealthClient healthClient, KeyValueClient keyValueClient, CatalogClient catalogClient, StatusClient statusClient, SessionClient sessionClient, EventClient eventClient, PreparedQueryClient preparedQueryClient, CoordinateClient coordinateClient, OperatorClient operatorClient, ExecutorService executorService, okhttp3.ConnectionPool connectionPool, AclClient aclClient, SnapshotClient snapshotClient, okhttp3.OkHttpClient okHttpClient) Package-private constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet the ACL HTTP client.Get the Agent HTTP client.static Consul.Builderbuilder()Creates a newConsul.Builderobject.Get the Catalog HTTP client.Get the Coordinate HTTP client.voiddestroy()Destroys the Object internal state.Get the Event HTTP client.Get the Health HTTP client.booleanCheck whether the internal state has been shut down.Get the Key/Value HTTP client.static ConsulUsed to create a default Consul client.Get the Operator HTTP client.Get the Prepared Query HTTP client.Get the SessionInfo HTTP client.Get the Snapshot HTTP client.Get the Status HTTP client.
-
Field Details
-
DEFAULT_HTTP_HOST
Default Consul HTTP API host.- See Also:
-
DEFAULT_HTTP_PORT
public static final int DEFAULT_HTTP_PORTDefault Consul HTTP API port.- See Also:
-
-
Constructor Details
-
Consul
protected Consul(AgentClient agentClient, HealthClient healthClient, KeyValueClient keyValueClient, CatalogClient catalogClient, StatusClient statusClient, SessionClient sessionClient, EventClient eventClient, PreparedQueryClient preparedQueryClient, CoordinateClient coordinateClient, OperatorClient operatorClient, ExecutorService executorService, okhttp3.ConnectionPool connectionPool, AclClient aclClient, SnapshotClient snapshotClient, okhttp3.OkHttpClient okHttpClient) Package-private constructor.- Parameters:
agentClient- theAgentClienthealthClient- theHealthClientkeyValueClient- theKeyValueClientcatalogClient- theCatalogClientstatusClient- theStatusClientsessionClient- theSessionClienteventClient- theEventClientpreparedQueryClient- thePreparedQueryClientcoordinateClient- theCoordinateClientoperatorClient- theOperatorClientexecutorService- the executor service provided to OkHttpconnectionPool- the OkHttp connection poolaclClient- theAclClientsnapshotClient- theSnapshotClientokHttpClient- theOkHttpClient
-
-
Method Details
-
destroy
public void destroy()Destroys the Object internal state. -
isDestroyed
public boolean isDestroyed()Check whether the internal state has been shut down.- Returns:
- true if
destroy()was called, otherwise false
-
agentClient
Get the Agent HTTP client./v1/agent
- Returns:
- The Agent HTTP client.
-
aclClient
Get the ACL HTTP client./v1/acl
- Returns:
- The ACL HTTP client.
-
catalogClient
Get the Catalog HTTP client./v1/catalog
- Returns:
- The Catalog HTTP client.
-
healthClient
Get the Health HTTP client./v1/health
- Returns:
- The Health HTTP client.
-
keyValueClient
Get the Key/Value HTTP client./v1/kv
- Returns:
- The Key/Value HTTP client.
-
statusClient
Get the Status HTTP client./v1/status
- Returns:
- The Status HTTP client.
-
sessionClient
Get the SessionInfo HTTP client./v1/session
- Returns:
- The SessionInfo HTTP client.
-
eventClient
Get the Event HTTP client./v1/event
- Returns:
- The Event HTTP client.
-
preparedQueryClient
Get the Prepared Query HTTP client./v1/query
- Returns:
- The Prepared Query HTTP client.
-
coordinateClient
Get the Coordinate HTTP client./v1/coordinate
- Returns:
- The Coordinate HTTP client.
-
operatorClient
Get the Operator HTTP client./v1/operator
- Returns:
- The Operator HTTP client.
-
snapshotClient
Get the Snapshot HTTP client./v1/snapshot
- Returns:
- The Snapshot HTTP client.
-
builder
Creates a newConsul.Builderobject.- Returns:
- A new Consul builder.
-
newClient
Used to create a default Consul client.- Returns:
- A default
Consulclient.
-