Package org.ff4j.consul
Class ConsulConnection
java.lang.Object
org.ff4j.consul.ConsulConnection
public class ConsulConnection
extends Object
implements org.ff4j.store.kv.KeyValueDriver<String,String>
Wrapping connection to consul to use it in different classes.
Server RPC (Default 8300).
This is used by servers to handle incoming requests from other agents. TCP only.
Serf LAN (Default 8301).
This is used to handle gossip in the LAN. Required by all agents. TCP and UDP.
Serf WAN (Default 8302).
This is used by servers to gossip over the WAN to other servers. TCP and UDP.
CLI RPC (Default 8400).
This is used by all agents to handle RPC from the CLI, but is deprecated in Consul 0.8 and later. TCP only. In Consul 0.8 all CLI commands were changed to use the HTTP API and the RPC interface was completely removed.
HTTP API (Default 8500).
This is used by clients to talk to the HTTP API. TCP only.
DNS Interface (Default 8600).
Used to resolve DNS queries. TCP and UDP.
- Author:
- Cedrick LUNVEN (@clunven)
-
Constructor Summary
ConstructorsConstructorDescriptionDefault.ConsulConnection(com.orbitz.consul.Consul definedConsul) Constructor with existing configuration.ConsulConnection(com.orbitz.consul.Consul definedConsul, ConsulKeyBuilder keyBuilder) Constructor with existing configuration and keyBuilder. -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleancom.orbitz.consul.AgentClientGetter accessor for attribute 'agentClient'.getAuditTrailKey(org.ff4j.audit.Event e) com.orbitz.consul.ConsulGetter accessor for attribute 'consul'.getFeatureKey(String featureName) getFeatureName(String key) com.orbitz.consul.HealthClientGetter accessor for attribute 'healthClient'.getHitCountKey(org.ff4j.audit.Event e) com.orbitz.consul.KeyValueClientGetter accessor for attribute 'keyValueClient'.getMissKey(org.ff4j.audit.Event e) getPropertyKey(String propertyName) getPropertyName(String key) voidvoidregisterFeature(String featureName) voidregisterProperty(String propertyName) voidunregisterFeature(String featureName) voidunregisterProperty(String propertyName)
-
Constructor Details
-
ConsulConnection
public ConsulConnection()Default. -
ConsulConnection
public ConsulConnection(com.orbitz.consul.Consul definedConsul) Constructor with existing configuration.- Parameters:
definedConsul- target consul
-
ConsulConnection
Constructor with existing configuration and keyBuilder.- Parameters:
definedConsul- target consulkeyBuilder- the key builder
-
-
Method Details
-
getConsul
public com.orbitz.consul.Consul getConsul()Getter accessor for attribute 'consul'.- Returns:
- current value of 'consul'
-
getAgentClient
public com.orbitz.consul.AgentClient getAgentClient()Getter accessor for attribute 'agentClient'.- Returns:
- current value of 'agentClient'
-
getHealthClient
public com.orbitz.consul.HealthClient getHealthClient()Getter accessor for attribute 'healthClient'.- Returns:
- current value of 'healthClient'
-
getKeyValueClient
public com.orbitz.consul.KeyValueClient getKeyValueClient()Getter accessor for attribute 'keyValueClient'.- Returns:
- current value of 'keyValueClient'
-
existKey
-
deleteKey
-
getValue
-
putValue
-
getFeatureKey
-
getFeatureName
-
getFeatureList
-
registerFeature
-
unregisterFeature
-
getPropertyKey
-
getPropertyName
-
getPropertyList
-
registerProperty
-
unregisterProperty
-
getHitCountKey
-
getMissKey
-
getAuditTrailKey
-