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

org.infinispan.server.configuration.security.SSLConfigurationBuilder Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev05
Show newest version
package org.infinispan.server.configuration.security;

import org.infinispan.commons.configuration.Builder;
import org.infinispan.commons.configuration.Combine;
import org.infinispan.commons.configuration.attributes.AttributeSet;

/**
 * @since 10.0
 */
public class SSLConfigurationBuilder implements Builder {
   private final KeyStoreConfigurationBuilder keyStore;
   private final TrustStoreConfigurationBuilder trustStore;
   private final SSLEngineConfigurationBuilder engine;


   SSLConfigurationBuilder(RealmConfigurationBuilder realmBuilder) {
      this.keyStore = new KeyStoreConfigurationBuilder(realmBuilder);
      this.trustStore = new TrustStoreConfigurationBuilder(realmBuilder);
      this.engine = new SSLEngineConfigurationBuilder(realmBuilder);
   }

   @Override
   public AttributeSet attributes() {
      return AttributeSet.EMPTY;
   }

   public KeyStoreConfigurationBuilder keyStore() {
      return keyStore;
   }

   public TrustStoreConfigurationBuilder trustStore() {
      return trustStore;
   }

   public SSLEngineConfigurationBuilder engine() {
      return engine;
   }

   @Override
   public SSLConfiguration create() {
      return new SSLConfiguration(keyStore.create(), trustStore.create(), engine.create());
   }

   @Override
   public SSLConfigurationBuilder read(SSLConfiguration template, Combine combine) {
      keyStore.read(template.keyStore(), combine);
      trustStore.read(template.trustStore(), combine);
      engine.read(template.engine(), combine);
      return this;
   }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy