com.yahoo.container.core.ContainerHttpConfig Maven / Gradle / Ivy
/**
* This file is generated from a config definition file.
* ------------ D O N O T E D I T ! ------------
*/
package com.yahoo.container.core;
import java.util.*;
import java.nio.file.Path;
import edu.umd.cs.findbugs.annotations.NonNull;
import com.yahoo.config.*;
/**
* This class represents the root node of container-http
*
* Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
*/
public final class ContainerHttpConfig extends ConfigInstance {
public final static String CONFIG_DEF_MD5 = "8f8828b39d8db2a02d1aaabce266993c";
public final static String CONFIG_DEF_NAME = "container-http";
public final static String CONFIG_DEF_NAMESPACE = "container.core";
public final static String CONFIG_DEF_VERSION = "";
public final static String[] CONFIG_DEF_SCHEMA = {
"namespace=container.core",
"hostResponseHeaderKey string default=\"\""
};
public static String getDefMd5() { return CONFIG_DEF_MD5; }
public static String getDefName() { return CONFIG_DEF_NAME; }
public static String getDefNamespace() { return CONFIG_DEF_NAMESPACE; }
public static String getDefVersion() { return CONFIG_DEF_VERSION; }
public interface Producer extends ConfigInstance.Producer {
void getConfig(Builder builder);
}
public static class Builder implements ConfigInstance.Builder {
private Set __uninitialized = new HashSet();
private String hostResponseHeaderKey = null;
public Builder() { }
public Builder(ContainerHttpConfig config) {
hostResponseHeaderKey(config.hostResponseHeaderKey());
}
private Builder override(Builder __superior) {
if (__superior.hostResponseHeaderKey != null)
hostResponseHeaderKey(__superior.hostResponseHeaderKey);
return this;
}
public Builder hostResponseHeaderKey(String __value) {
if (__value == null) throw new IllegalArgumentException("Null value is not allowed.");
hostResponseHeaderKey = __value;
return this;
}
@java.lang.Override
public final boolean dispatchGetConfig(ConfigInstance.Producer producer) {
if (producer instanceof Producer) {
((Producer)producer).getConfig(this);
return true;
}
return false;
}
@java.lang.Override
public final String getDefMd5() { return CONFIG_DEF_MD5; }
@java.lang.Override
public final String getDefName() { return CONFIG_DEF_NAME; }
@java.lang.Override
public final String getDefNamespace() { return CONFIG_DEF_NAMESPACE; }
}
// If non-empty, handlers should emit a header containing this string as key and the local host name as value
private final StringNode hostResponseHeaderKey;
public ContainerHttpConfig(Builder builder) {
this(builder, true);
}
private ContainerHttpConfig(Builder builder, boolean throwIfUninitialized) {
if (throwIfUninitialized && ! builder.__uninitialized.isEmpty())
throw new IllegalArgumentException("The following builder parameters for " +
"container-http must be initialized: " + builder.__uninitialized);
hostResponseHeaderKey = (builder.hostResponseHeaderKey == null) ?
new StringNode("") : new StringNode(builder.hostResponseHeaderKey);
}
/**
* @return container-http.hostResponseHeaderKey
*/
public String hostResponseHeaderKey() {
return hostResponseHeaderKey.value();
}
private ChangesRequiringRestart getChangesRequiringRestart(ContainerHttpConfig newConfig) {
ChangesRequiringRestart changes = new ChangesRequiringRestart("container-http");
return changes;
}
private static boolean containsFieldsFlaggedWithRestart() {
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy