All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.hotrod.configuration.ClusterConfiguration Maven / Gradle / Ivy

package org.infinispan.hotrod.configuration;

import java.util.List;

import org.infinispan.commons.configuration.attributes.AttributeDefinition;
import org.infinispan.commons.configuration.attributes.AttributeSet;
import org.infinispan.commons.configuration.attributes.ConfigurationElement;

/**
 * @since 14.0
 */
public class ClusterConfiguration extends ConfigurationElement {
   static final AttributeDefinition NAME = AttributeDefinition.builder("name", null, String.class).build();
   // default intelligence is "null" to use the client intelligence defined globally
   static final AttributeDefinition CLIENT_INTELLIGENCE = AttributeDefinition.builder("client_intelligence", null, ClientIntelligence.class).build();
   static final AttributeDefinition SNI_HOSTNAME = AttributeDefinition.builder("sni-hostname", null, String.class).build();

   static AttributeSet attributeDefinitionSet() {
      return new AttributeSet(ClusterConfiguration.class, NAME, CLIENT_INTELLIGENCE, SNI_HOSTNAME);
   }

   private final List servers;

   ClusterConfiguration(AttributeSet attributes, List servers) {
      super("cluster", attributes);
      this.servers = servers;
   }

   public List getServers() {
      return servers;
   }

   public String getClusterName() {
      return attributes.attribute(NAME).get();
   }

   public ClientIntelligence getClientIntelligence() {
      return attributes.attribute(CLIENT_INTELLIGENCE).get();
   }

   public String sniHostName() {
      return attributes.attribute(SNI_HOSTNAME).get();
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy