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

org.infinispan.server.resp.configuration.RespAuthenticationConfiguration Maven / Gradle / Ivy

The newest version!
package org.infinispan.server.resp.configuration;

import org.infinispan.commons.configuration.attributes.AttributeDefinition;
import org.infinispan.commons.configuration.attributes.AttributeSet;
import org.infinispan.commons.configuration.attributes.ConfigurationElement;
import org.infinispan.server.core.configuration.AuthenticationConfiguration;
import org.infinispan.server.resp.authentication.RespAuthenticator;

/**
 * RespAuthenticationConfiguration.
 *
 * @author Tristan Tarrant
 * @since 14.0
 */
public class RespAuthenticationConfiguration extends ConfigurationElement implements AuthenticationConfiguration {
   public static final AttributeDefinition SECURITY_REALM = AttributeDefinition.builder("security-realm", null, String.class).immutable().build();

   private final boolean enabled;
   private final RespAuthenticator authenticator;

   public static AttributeSet attributeDefinitionSet() {
      return new AttributeSet(RespAuthenticationConfiguration.class, SECURITY_REALM);
   }

   RespAuthenticationConfiguration(AttributeSet attributes, RespAuthenticator authenticator, boolean enabled) {
      super("authentication", attributes);
      this.enabled = enabled;
      this.authenticator = authenticator;
   }

   public boolean enabled() {
      return enabled;
   }

   public RespAuthenticator authenticator() {
      return authenticator;
   }

   public String securityRealm() {
      return attributes.attribute(SECURITY_REALM).get();
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy