Class ConsulConnection

java.lang.Object
org.ff4j.consul.ConsulConnection
All Implemented Interfaces:
org.ff4j.store.kv.KeyValueDriver<String,String>

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 Details

    • ConsulConnection

      public ConsulConnection()
      Default.
    • ConsulConnection

      public ConsulConnection(com.orbitz.consul.Consul definedConsul)
      Constructor with existing configuration.
      Parameters:
      definedConsul - target consul
    • ConsulConnection

      public ConsulConnection(com.orbitz.consul.Consul definedConsul, ConsulKeyBuilder keyBuilder)
      Constructor with existing configuration and keyBuilder.
      Parameters:
      definedConsul - target consul
      keyBuilder - 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

      public boolean existKey(String key)
      Specified by:
      existKey in interface org.ff4j.store.kv.KeyValueDriver<String,String>
    • deleteKey

      public void deleteKey(String key)
      Specified by:
      deleteKey in interface org.ff4j.store.kv.KeyValueDriver<String,String>
    • getValue

      public String getValue(String key)
      Specified by:
      getValue in interface org.ff4j.store.kv.KeyValueDriver<String,String>
    • putValue

      public void putValue(String key, String value)
      Specified by:
      putValue in interface org.ff4j.store.kv.KeyValueDriver<String,String>
    • getFeatureKey

      public String getFeatureKey(String featureName)
      Specified by:
      getFeatureKey in interface org.ff4j.store.kv.KeyValueDriver<String,String>
    • getFeatureName

      public String getFeatureName(String key)
      Specified by:
      getFeatureName in interface org.ff4j.store.kv.KeyValueDriver<String,String>
    • getFeatureList

      public Set<String> getFeatureList()
      Specified by:
      getFeatureList in interface org.ff4j.store.kv.KeyValueDriver<String,String>
    • registerFeature

      public void registerFeature(String featureName)
      Specified by:
      registerFeature in interface org.ff4j.store.kv.KeyValueDriver<String,String>
    • unregisterFeature

      public void unregisterFeature(String featureName)
      Specified by:
      unregisterFeature in interface org.ff4j.store.kv.KeyValueDriver<String,String>
    • getPropertyKey

      public String getPropertyKey(String propertyName)
      Specified by:
      getPropertyKey in interface org.ff4j.store.kv.KeyValueDriver<String,String>
    • getPropertyName

      public String getPropertyName(String key)
      Specified by:
      getPropertyName in interface org.ff4j.store.kv.KeyValueDriver<String,String>
    • getPropertyList

      public Set<String> getPropertyList()
      Specified by:
      getPropertyList in interface org.ff4j.store.kv.KeyValueDriver<String,String>
    • registerProperty

      public void registerProperty(String propertyName)
      Specified by:
      registerProperty in interface org.ff4j.store.kv.KeyValueDriver<String,String>
    • unregisterProperty

      public void unregisterProperty(String propertyName)
      Specified by:
      unregisterProperty in interface org.ff4j.store.kv.KeyValueDriver<String,String>
    • getHitCountKey

      public String getHitCountKey(org.ff4j.audit.Event e)
      Specified by:
      getHitCountKey in interface org.ff4j.store.kv.KeyValueDriver<String,String>
    • getMissKey

      public String getMissKey(org.ff4j.audit.Event e)
      Specified by:
      getMissKey in interface org.ff4j.store.kv.KeyValueDriver<String,String>
    • getAuditTrailKey

      public String getAuditTrailKey(org.ff4j.audit.Event e)
      Specified by:
      getAuditTrailKey in interface org.ff4j.store.kv.KeyValueDriver<String,String>