package stroom.node.impl;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import stroom.config.common.DbConfig;
import stroom.config.common.HasDbConfig;
import stroom.util.config.annotations.ReadOnly;
import stroom.util.shared.AbstractConfig;

import javax.inject.Singleton;
import javax.validation.constraints.NotNull;

@Singleton
public class NodeConfig extends AbstractConfig implements HasDbConfig {
    public static final String PROP_NAME_NAME = "name";
    public static final String PROP_NAME_STATUS = "status";

    private DbConfig dbConfig = new DbConfig();
    private String nodeName = "tba";
    private StatusConfig statusConfig = new StatusConfig();

    @JsonProperty("db")
    public DbConfig getDbConfig() {
        return dbConfig;
    }

    public void setDbConfig(final DbConfig dbConfig) {
        this.dbConfig = dbConfig;
    }

    @NotNull
    @ReadOnly
    @JsonPropertyDescription("Should only be set per node in the application YAML config file")
    @JsonProperty(PROP_NAME_NAME)
    public String getNodeName() {
        return nodeName;
    }

    public void setNodeName(final String nodeName) {
        this.nodeName = nodeName;
    }

    @JsonProperty(PROP_NAME_STATUS)
    public StatusConfig getStatusConfig() {
        return statusConfig;
    }

    public void setStatusConfig(final StatusConfig statusConfig) {
        this.statusConfig = statusConfig;
    }

    @Override
    public String toString() {
        return "NodeConfig{" +
                "nodeName='" + nodeName + '\'' +
                '}';
    }
}

@@ -24,127 +24,8 @@
 l;%0A%0A
-import com.fasterxml.jackson.annotation.JsonProperty;%0Aimport com.fasterxml.jackson.annotation.JsonPropertyDescription;%0A
 impo
@@ -190,16 +190,136 @@
 onfig;%0A%0A
+import com.fasterxml.jackson.annotation.JsonProperty;%0Aimport com.fasterxml.jackson.annotation.JsonPropertyDescription;%0A%0A
 import j
@@ -639,45 +639,8 @@
 ();%0A
-    private String nodeName = %22tba%22;%0A
     
@@ -696,16 +696,54 @@
 fig();%0A%0A
+    private String nodeName = %22tba%22;%0A%0A
     @Jso
@@ -978,16 +978,85 @@
 ription(
+%22The name of the node to identify it in the cluster. %22 +%0A            
 %22Should 

Improve prop description in NodeConfig