func (pm *IntegerParameterRange) Start() interface{} {
	return pm.start
}
Integer parameter range method
package config
import (
	"fmt"
	"errors"
	"io/ioutil"
	"net"
	"reflect"
	"strconv"
	"strings"
	"github.com/hashicorp/hcl"
	"gopkg.in/yaml.v2"
)
type ConfigNode interface {
	Convert() (interface{}, error)
}
type Storable interface {
	Store()
}
type SignalConfigurationParameterNode struct {
	HeartbeatInterval string `yaml:"heartbeatInterval"`
	MissingHbAllowed  string `yaml:"missingHbAllowed"`
	MaxRetransmit     string `yaml:"maxRetransmit"`
	AckTimeout        string `yaml:"ackTimeout"`
	AckRandomFactor   string `yaml:"ackRandomFactor"`
	HeartbeatIntervalIdle string `yaml:"heartbeatIntervalIdle"`
	MissingHbAllowedIdle  string `yaml:"missingHbAllowedIdle"`
	MaxRetransmitIdle     string `yaml:"maxRetransmitIdle"`
	AckTimeoutIdle        string `yaml:"ackTimeoutIdle"`
	AckRandomFactorIdle   string `yaml:"ackRandomFactorIdle"`
}
type DefaultSignalConfigurationNode struct {
	HeartbeatInterval string `yaml:"heartbeatInterval"`
	MissingHbAllowed  string `yaml:"missingHbAllowed"`
	MaxRetransmit     string `yaml:"maxRetransmit"`
	AckTimeout        string `yaml:"ackTimeout"`
	AckRandomFactor   string `yaml:"ackRandomFactor"`
	HeartbeatIntervalIdle string `yaml:"heartbeatIntervalIdle"`
	MissingHbAllowedIdle  string `yaml:"missingHbAllowedIdle"`
	MaxRetransmitIdle     string `yaml:"maxRetransmitIdle"`
	AckTimeoutIdle        string `yaml:"ackTimeoutIdle"`
	AckRandomFactorIdle   string `yaml:"ackRandomFactorIdle"`
}
type TelemetryConfigurationParameterNode struct {
	MeasurementInterval       string `yaml:"measurementInterval"`
	MeasurementSample         string `yaml:"measurementSample"`
	LowPercentile             string `yaml:"lowPercentile"`
	MidPercentile             string `yaml:"midPercentile"`
	HighPercentile            string `yaml:"highPercentile"`
	ServerOriginatedTelemetry bool   `yaml:"serverOriginatedTelemetry"`
	TelemetryNotifyInterval   string `yaml:"telemetryNotifyInterval"`
	Unit                      string `yaml:"unit"`
	UnitStatus                bool   `yaml:"unitStatus"`
}
type DefaultTelemetryConfigurationNode struct {
	MeasurementInterval       string `yaml:"measurementInterval"`
	MeasurementSample         string `yaml:"measurementSample"`
	LowPercentile             string `yaml:"lowPercentile"`
	MidPercentile             string `yaml:"midPercentile"`
	HighPercentile            string `yaml:"highPercentile"`
	ServerOriginatedTelemetry bool   `yaml:"serverOriginatedTelemetry"`
	TelemetryNotifyInterval   string `yaml:"telemetryNotifyInterval"`
	Unit                      string `yaml:"unit"`
	UnitStatus                bool   `yaml:"unitStatus"`
}
type DefaultTotalPipeCapacityNode struct {
	LinkId   string `yaml:"linkId"`
	Capacity string `yaml:"capacity"`
	Unit     string `yaml:"unit"`
}
type DefaultTargetNode struct {
	TargetPrefix    string `yaml:"targetPrefix"`
	TargetLowerPort string `yaml:"targetLowerPort"`
	TargetUpperPort string `yaml:"targetUpperPort"`
	TargetProtocol  string `yaml:"targetProtocol"`
	TargetFqdn      string `yaml:"targetFqdn"`
	TargetUri       string `yaml:"targetUri"`
}
type DefaultTotalTrafficNormalBaselineNode struct {
	Unit             string `yaml:"unit"`
	Protocol         string `yaml:"protocol"`
	LowPercrentileG  string `yaml:"lowPercentileG"`
	MidPercrentileG  string `yaml:"midPercentileG"`
	HighPercrentileG string `yaml:"highPercentileG"`
	PeakG            string `yaml:"peakG"`
}
type DefaultTotalConnectionCapacityNode struct {
	Protocol               string `yaml:"protocol"`
	Connection             string `yaml:"connection"`
	ConnectionClient       string `yaml:"connectionClient"`
	EmbryOnic              string `yaml:"embryonic"`
	EmbryOnicClient        string `yaml:"embryonicClient"`
	ConnectionPs           string `yaml:"connectionPs"`
	ConnectionClientPs     string `yaml:"connectionClientPs"`
	RequestPs              string `yaml:"requestPs"`
	RequestClientPs        string `yaml:"requestClientPs"`
	PartialRequestPs       string `yaml:"partialRequestPs"`
	PartialRequestClientPs string `yaml:"partialRequestClientPs"`
}
type LifetimeConfigurationNode struct {
	ActiveButTerminatingPeriod    string `yaml:"activeButTerminatingPeriod"`
	MaxActiveButTerminatingPeriod string `yaml:"maxActiveButTerminatingPeriod"`
	ManageLifetimeInterval        string `yaml:"manageLifetimeInterval"`
	ConflictRetryTimer            string `yaml:"conflictRetryTimer"`
}
func (scpn SignalConfigurationParameterNode) Convert() (interface{}, error) {
	heartbeatInterval, err := parseIntegerParameterRange(scpn.HeartbeatInterval)
	if err != nil {
		return nil, err
	}
	missingHbAllowed, err := parseIntegerParameterRange(scpn.MissingHbAllowed)
	if err != nil {
		return nil, err
	}
	maxRetransmit, err := parseIntegerParameterRange(scpn.MaxRetransmit)
	if err != nil {
		return nil, err
	}
	ackTimeout, err := parseFloatParameterRange(scpn.AckTimeout)
	if err != nil {
		return nil, err
	}
	ackRandomFactor, err := parseFloatParameterRange(scpn.AckRandomFactor)
	if err != nil {
		return nil, err
	}
	heartbeatIntervalIdle, err := parseIntegerParameterRange(scpn.HeartbeatIntervalIdle)
	if err != nil {
		return nil, err
	}
	missingHbAllowedIdle, err := parseIntegerParameterRange(scpn.MissingHbAllowedIdle)
	if err != nil {
		return nil, err
	}
	maxRetransmitIdle, err := parseIntegerParameterRange(scpn.MaxRetransmitIdle)
	if err != nil {
		return nil, err
	}
	ackTimeoutIdle, err := parseFloatParameterRange(scpn.AckTimeoutIdle)
	if err != nil {
		return nil, err
	}
	ackRandomFactorIdle, err := parseFloatParameterRange(scpn.AckRandomFactorIdle)
	if err != nil {
		return nil, err
	}
	return &SignalConfigurationParameter{
		HeartbeatInterval: heartbeatInterval,
		MissingHbAllowed:  missingHbAllowed,
		MaxRetransmit:     maxRetransmit,
		AckTimeout:        ackTimeout,
		AckRandomFactor:   ackRandomFactor,
		HeartbeatIntervalIdle: heartbeatIntervalIdle,
		MissingHbAllowedIdle:  missingHbAllowedIdle,
		MaxRetransmitIdle:     maxRetransmitIdle,
		AckTimeoutIdle:        ackTimeoutIdle,
		AckRandomFactorIdle:   ackRandomFactorIdle,
	}, nil
}
func (dscn DefaultSignalConfigurationNode) Convert() (interface{}, error) {
	return &DefaultSignalConfiguration{
		HeartbeatInterval: parseIntegerValue(dscn.HeartbeatInterval),
		MissingHbAllowed:  parseIntegerValue(dscn.MissingHbAllowed),
		MaxRetransmit:     parseIntegerValue(dscn.MaxRetransmit),
		AckTimeout:        parseFloatValue(dscn.AckTimeout),
		AckRandomFactor:   parseFloatValue(dscn.AckRandomFactor),
		HeartbeatIntervalIdle: parseIntegerValue(dscn.HeartbeatIntervalIdle),
		MissingHbAllowedIdle:  parseIntegerValue(dscn.MissingHbAllowedIdle),
		MaxRetransmitIdle:     parseIntegerValue(dscn.MaxRetransmitIdle),
		AckTimeoutIdle:        parseFloatValue(dscn.AckTimeoutIdle),
		AckRandomFactorIdle:   parseFloatValue(dscn.AckRandomFactorIdle),
	}, nil
}
func (tcpn TelemetryConfigurationParameterNode) Convert() (interface{}, error) {
	unit := parseIntegerValue(tcpn.Unit)
	if unit < 1 || unit > 3 {
		return nil, errors.New("'unit' MUST be between 1 and 3")
	}
	measurementInterval, err := parseIntegerParameterRange(tcpn.MeasurementInterval)
	if err != nil {
		return nil, err
	}
	measurementSample, err := parseIntegerParameterRange(tcpn.MeasurementSample)
	if err != nil {
		return nil, err
	}
	lowPercentile, err := parseFloatParameterRange(tcpn.LowPercentile)
	if err != nil {
		return nil, err
	}
	midPercentile, err :=  parseFloatParameterRange(tcpn.MidPercentile)
	if err != nil {
		return nil, err
	}
	highPercentile, err := parseFloatParameterRange(tcpn.HighPercentile)
	if err != nil {
		return nil, err
	}
	telemetryNotifyInterval, err := parseIntegerParameterRange(tcpn.TelemetryNotifyInterval)
	if err != nil {
		return nil, err
	}
	return &TelemetryConfigurationParameter{
		MeasurementInterval:       measurementInterval,
		MeasurementSample:         measurementSample,
		LowPercentile:             lowPercentile,
		MidPercentile:             midPercentile,
		HighPercentile:            highPercentile,
		ServerOriginatedTelemetry: tcpn.ServerOriginatedTelemetry,
		TelemetryNotifyInterval:   telemetryNotifyInterval,
		Unit:                      unit,
		UnitStatus:                tcpn.UnitStatus,
	}, nil
}
func (dtcn DefaultTelemetryConfigurationNode) Convert() (interface{}, error) {
	telemetryNotifyInterval := parseIntegerValue(dtcn.TelemetryNotifyInterval)
	unit := parseIntegerValue(dtcn.Unit)
	if telemetryNotifyInterval < 1 || telemetryNotifyInterval > 3600 {
		return nil, errors.New("'telemetryNotifyInterval' MUST be between 1 and 3600")
	}
	if unit < 1 || unit > 3 {
		return nil, errors.New("'unit' MUST be between 1 and 3")
	}
	return &DefaultTelemetryConfiguration{
		MeasurementInterval:       parseIntegerValue(dtcn.MeasurementInterval),
		MeasurementSample:         parseIntegerValue(dtcn.MeasurementSample),
		LowPercentile:             parseFloatValue(dtcn.LowPercentile),
		MidPercentile:             parseFloatValue(dtcn.MidPercentile),
		HighPercentile:            parseFloatValue(dtcn.HighPercentile),
		ServerOriginatedTelemetry: dtcn.ServerOriginatedTelemetry,
		TelemetryNotifyInterval:   telemetryNotifyInterval,
		Unit:                      unit,
		UnitStatus:                dtcn.UnitStatus,
	}, nil
}
func (dtpcn DefaultTotalPipeCapacityNode) Convert() (interface{}, error) {
	unit := parseIntegerValue(dtpcn.Unit)
	if unit < 1 || unit > 15 {
		return nil, errors.New("'unit' MUST be between 1 and 15")
	}
	return &DefaultTotalPipeCapacity{
		LinkId:   dtpcn.LinkId,
		Capacity: parseIntegerValue(dtpcn.Capacity),
		Unit:     unit,
	}, nil
}
func (dtn DefaultTargetNode) Convert() (interface{}, error) {
	lowerport := parseIntegerValue(dtn.TargetLowerPort)
	upperPort := parseIntegerValue(dtn.TargetUpperPort)
	protocol  := parseIntegerValue(dtn.TargetProtocol)
	if lowerport < 0 || 0xffff < lowerport || upperPort < 0 || 0xffff < upperPort {
		errMsg := fmt.Sprintf("invalid port-range: lower-port: %+v, upper-port: %+v", lowerport, upperPort)
		return nil, errors.New(errMsg)
	} else if lowerport > upperPort {
		return nil, errors.New("'lowerPort MUST be smaller than 'upperPort'")
	}
	if protocol < 0 || protocol > 255 {
		return nil, errors.New("'targetProtocol' MUST be between 0 and 255")
	}
	return &DefaultTarget{
		TargetPrefix:    dtn.TargetPrefix,
		TargetLowerPort: lowerport,
		TargetUpperPort: upperPort,
		TargetProtocol:  protocol,
		TargetFqdn:      dtn.TargetFqdn,
		TargetUri:       dtn.TargetUri,
	}, nil
}
func (dttnbn DefaultTotalTrafficNormalBaselineNode) Convert() (interface{}, error) {
	unit            := parseIntegerValue(dttnbn.Unit)
	protocol        := parseIntegerValue(dttnbn.Protocol)
	lowPercentileG  := parseIntegerValue(dttnbn.LowPercrentileG)
	midPercentileG  := parseIntegerValue(dttnbn.MidPercrentileG)
	highPercentileG := parseIntegerValue(dttnbn.HighPercrentileG)
	peakG           := parseIntegerValue(dttnbn.PeakG)
	if unit < 1 || unit > 15 {
		return nil, errors.New("'unit' MUST be between 1 and 15")
	}
	if protocol < 0 || protocol > 255 {
		return nil, errors.New("'protocol' MUST be between 0 and 255")
	}
	if lowPercentileG > midPercentileG {
		return nil, errors.New("'midPercentitleG' MUST be greater than or equal to the 'lowPercentitleG'")
	}
	if midPercentileG > highPercentileG {
		return nil, errors.New("'highPercentitleG' MUST be greater than or equal to the 'midPercentitleG'")
	}
	if highPercentileG > peakG {
		return nil, errors.New("'highercentitleG' MUST be greater than or equal to the 'peakG'")
	}
	return &DefaultTotalTrafficNormalBaseline{
		Unit:            unit,
		Protocol:        protocol,
		LowPercentileG:  lowPercentileG,
		MidPercentileG:  midPercentileG,
		HighPercentileG: highPercentileG,
		PeakG:           peakG,
	}, nil
}
func (dtccn DefaultTotalConnectionCapacityNode) Convert() (interface{}, error) {
	protocol := parseIntegerValue(dtccn.Protocol)
	if protocol < 0 || protocol > 255 {
		return nil, errors.New("'protocol' MUST be between 0 and 255")
	}
	return &DefaultTotalConnectionCapacity{
		Protocol:               protocol,
		Connection:             parseIntegerValue(dtccn.Connection),
		ConnectionClient:       parseIntegerValue(dtccn.ConnectionClient),
		EmbryOnic:              parseIntegerValue(dtccn.EmbryOnic),
		EmbryOnicClient:        parseIntegerValue(dtccn.EmbryOnicClient),
		ConnectionPs:           parseIntegerValue(dtccn.ConnectionPs),
		ConnectionClientPs:     parseIntegerValue(dtccn.ConnectionClientPs),
		RequestPs:              parseIntegerValue(dtccn.RequestPs),
		RequestClientPs:        parseIntegerValue(dtccn.RequestClientPs),
		PartialRequestPs:       parseIntegerValue(dtccn.PartialRequestPs),
		PartialRequestClientPs: parseIntegerValue(dtccn.PartialRequestClientPs),
	}, nil
}
func (lcn LifetimeConfigurationNode) Convert() (interface{}, error) {
	return &LifetimeConfiguration{
		ActiveButTerminatingPeriod:    parseIntegerValue(lcn.ActiveButTerminatingPeriod),
		MaxActiveButTerminatingPeriod: parseIntegerValue(lcn.MaxActiveButTerminatingPeriod),
		ManageLifetimeInterval:        parseIntegerValue(lcn.ManageLifetimeInterval),
		ConflictRetryTimer:            parseIntegerValue(lcn.ConflictRetryTimer),
	}, nil
}
func  ConvertMaxAge(maxAge string) (uint, error) {
	var m int
	if maxAge != "" {
		mt,_ := strconv.Atoi(maxAge)
		m = mt
	} else {
		m = 60
	}
	if m < 0 || m > 4294967295 {
		return uint(m), errors.New("maxAgeOption must be between 0 and (2^32)-1")
	}
	return uint(m), nil
}
func ConvertQueryType(queryType string) ([]int, error) {
	var result []int
	if queryType == "" {
		queryType = "1,2,3,4,6"
	}
	queryTypeSplit := strings.Split(queryType, ",")
	for _, v := range queryTypeSplit {
		resultTmp, err := strconv.Atoi(v)
		if err != nil {
			return result, err
		}
		result = append(result, resultTmp)
	}
	return result, nil
}
type ServerConfigTree struct {
	ServerSystemConfig ServerSystemConfigNode `yaml:"system"`
}
type NetworkNode struct {
	BindAddress       string `yaml:"bindAddress"`
	SignalChannelPort int    `yaml:"signalChannelPort"`
	DataChannelPort   int    `yaml:"dataChannelPort"`
	DBNotificationPort int   `yaml:"dbNotificationPort"`
	HrefOrigin         string `yaml:"hrefOrigin"`
	HrefPathname       string `yaml:"hrefPathname"`
}
func (ncn NetworkNode) Convert() (interface{}, error) {
	bindAddress := net.ParseIP(ncn.BindAddress)
	if bindAddress == nil {
		return nil, errors.New("bindAddress is invalid")
	}
	if ncn.SignalChannelPort < 1 || ncn.SignalChannelPort > 65535 {
		return nil, errors.New("signalChannelPort must be between 1 and 65,535")
	}
	if ncn.DataChannelPort < 1 || ncn.DataChannelPort > 65535 {
		return nil, errors.New("dataChannelPort must be between 1 and 65,535")
	}
	if ncn.DBNotificationPort < 1 || ncn.DBNotificationPort > 65535 {
		return nil, errors.New("dbNotificationPort must be between 1 and 65,535")
	}
	if ncn.SignalChannelPort == ncn.DataChannelPort {
		return nil, errors.New("dataChannelPort must be different from signalChannelPort")
	}
	if ncn.HrefOrigin == "" {
		return nil, errors.New("hrefOrigin must not be empty")
	}
	if ncn.HrefPathname == "" {
		return nil, errors.New("hrefPathname must not be empty")
	}
	return &Network{
		BindAddress:       ncn.BindAddress,
		SignalChannelPort: ncn.SignalChannelPort,
		DataChannelPort:   ncn.DataChannelPort,
		DBNotificationPort: ncn.DBNotificationPort,
		HrefOrigin:         ncn.HrefOrigin,
		HrefPathname:       ncn.HrefPathname,
	}, nil
}
func (nc *Network) Store() {
	GetServerSystemConfig().setNetwork(*nc)
}
type Network struct {
	BindAddress       string
	SignalChannelPort int
	DataChannelPort   int
	DBNotificationPort int
	HrefOrigin         string
	HrefPathname       string
}
type SecureFileNode struct {
	ServerCertFile string `yaml:"serverCertFile"`
	ServerKeyFile  string `yaml:"serverKeyFile"`
	CrlFile        string `yaml:"crlFile"`
	CertFile       string `yaml:"certFile"`
}
func (sfpcn SecureFileNode) Convert() (interface{}, error) {
	return &SecureFile{
		ServerCertFile: sfpcn.ServerCertFile,
		ServerKeyFile:  sfpcn.ServerKeyFile,
		CrlFile:        sfpcn.CrlFile,
		CertFile:       sfpcn.CertFile,
	}, nil
}
type SecureFile struct {
	ServerCertFile string
	ServerKeyFile  string
	CrlFile        string
	CertFile       string
}
func (sfpc *SecureFile) Store() {
	GetServerSystemConfig().setSecureFile(*sfpc)
}
type DatabaseNode struct {
	Username     string `yaml:"username"`
	Password     string `yaml:"password"`
	Protocol     string `yaml:"protocol"`
	Host         string `yaml:"host"`
	Port         int    `yaml:"port"`
	DatabaseName string `yaml:"databaseName"`
}
func (dcn DatabaseNode) Convert() (interface{}, error) {
	if dcn.Port < 1 || dcn.Port > 65535 {
		return nil, errors.New("Database port must be between 1 and 65,535")
	}
	return &Database{
		Username:     dcn.Username,
		Password:     dcn.Password,
		Protocol:     dcn.Protocol,
		Host:         dcn.Host,
		Port:         dcn.Port,
		DatabaseName: dcn.DatabaseName,
	}, nil
}
type Database struct {
	Username     string
	Password     string
	Protocol     string
	Host         string
	Port         int
	DatabaseName string
}
func (dc *Database) Store() {
	GetServerSystemConfig().setDatabase(*dc)
}
type ServerSystemConfig struct {
	SignalConfigurationParameter      *SignalConfigurationParameter
	DefaultSignalConfiguration        *DefaultSignalConfiguration
	TelemetryConfigurationParameter   *TelemetryConfigurationParameter
	DefaultTelemetryConfiguration     *DefaultTelemetryConfiguration
	DefaultTotalPipeCapacity          *DefaultTotalPipeCapacity
	DefaultTarget                     *DefaultTarget
	DefaultTotalTrafficNormalBaseline *DefaultTotalTrafficNormalBaseline
	DefaultTotalConnectionCapacity    *DefaultTotalConnectionCapacity
	SecureFile                        *SecureFile
	Network                           *Network
	Database                          *Database
	LifetimeConfiguration             *LifetimeConfiguration
	MaxAgeOption                      uint
	CacheInterval                     int
	QueryType                         []int
	VendorMappingEnabled              bool
}
func (sc *ServerSystemConfig) Store() {
	GetServerSystemConfig().setSignalConfigurationParameter(*sc.SignalConfigurationParameter)
	GetServerSystemConfig().setDefaultSignalConfiguration(*sc.DefaultSignalConfiguration)
	GetServerSystemConfig().setTelemetryConfigurationParameter(*sc.TelemetryConfigurationParameter)
	GetServerSystemConfig().setDefaultTelemetryConfiguration(*sc.DefaultTelemetryConfiguration)
	GetServerSystemConfig().setDefaultTotalPipeCapacity(*sc.DefaultTotalPipeCapacity)
	GetServerSystemConfig().setDefaultTarget(*sc.DefaultTarget)
	GetServerSystemConfig().setDefaultTotalTrafficNormalBaseline(*sc.DefaultTotalTrafficNormalBaseline)
	GetServerSystemConfig().setDefaultTotalConnectionCapacity(*sc.DefaultTotalConnectionCapacity)
	GetServerSystemConfig().setSecureFile(*sc.SecureFile)
	GetServerSystemConfig().setNetwork(*sc.Network)
	GetServerSystemConfig().setDatabase(*sc.Database)
	GetServerSystemConfig().setLifetimeConfiguration(*sc.LifetimeConfiguration)
	GetServerSystemConfig().setMaxAgeOption(sc.MaxAgeOption)
	GetServerSystemConfig().setCacheInterval(sc.CacheInterval)
	GetServerSystemConfig().setQueryType(sc.QueryType)
	GetServerSystemConfig().setVendorMappingEnabled(sc.VendorMappingEnabled)
}
type ServerSystemConfigNode struct {
	SignalConfigurationParameter      SignalConfigurationParameterNode      `yaml:"signalConfigurationParameter"`
	DefaultSignalConfiguration        DefaultSignalConfigurationNode        `yaml:"defaultSignalConfiguration"`
	TelemetryConfigurationParameter   TelemetryConfigurationParameterNode   `yaml:"telemetryConfigurationParameter"`
	DefaultTelemetryConfiguration     DefaultTelemetryConfigurationNode     `yaml:"defaultTelemetryConfiguration"`
	DefaultTotalPipeCapacity          DefaultTotalPipeCapacityNode          `yaml:"defaultTotalPipeCapacity"`
	DefaultTarget                     DefaultTargetNode                     `yaml:"defaultTarget"`
	DefaultTotalTrafficNormalBaseline DefaultTotalTrafficNormalBaselineNode `yaml:"defaultTotalTrafficNormalBaseline"`
	DefaultTotalConnectionCapacity    DefaultTotalConnectionCapacityNode    `yaml:"defaultTotalConnectionCapacity"`
	SecureFile                        SecureFileNode                        `yaml:"secureFile"`
	Network                           NetworkNode                           `yaml:"network"`
	Database                          DatabaseNode                          `yaml:"database"`
	LifetimeConfiguration             LifetimeConfigurationNode             `yaml:"lifetimeConfiguration"`
	MaxAgeOption                      string                                `yaml:"maxAgeOption"`
	CacheInterval                     string                                `yaml:"cacheInterval"`
	QueryType                         string                                `yaml:"queryType"`
	VendorMappingEnabled              bool                                  `yaml:"vendorMappingEnabled"`
}
func (scn ServerSystemConfigNode) Convert() (interface{}, error) {
	signalConfigurationParameter, err := scn.SignalConfigurationParameter.Convert()
	if err != nil {
		return nil, err
	}
	defaultSignalConfiguration, err := scn.DefaultSignalConfiguration.Convert()
	if err != nil {
		return nil, err
	}
	telemetryConfigurationParameter, err := scn.TelemetryConfigurationParameter.Convert()
	if err != nil {
		return nil, err
	}
	defaultTelemetryConfiguration, err := scn.DefaultTelemetryConfiguration.Convert()
	if err != nil {
		return nil, err
	}
	defaultTotalPipeCapacity, err := scn.DefaultTotalPipeCapacity.Convert()
	if err != nil {
		return nil, err
	}
	defaultTarget, err := scn.DefaultTarget.Convert()
	if err != nil {
		return nil, err
	}
	defaultTotalTrafficNormalBaseline, err := scn.DefaultTotalTrafficNormalBaseline.Convert()
	if err != nil {
		return nil, err
	}
	defaultTotalConnectionCapacity, err := scn.DefaultTotalConnectionCapacity.Convert()
	if err != nil {
		return nil, err
	}
	secureFilePath, err := scn.SecureFile.Convert()
	if err != nil {
		return nil, err
	}
	network, err := scn.Network.Convert()
	if err != nil {
		return nil, err
	}
	database, err := scn.Database.Convert()
	if err != nil {
		return nil, err
	}
	lifetimeConfiguration, err := scn.LifetimeConfiguration.Convert()
	if err != nil {
		return nil, err
	}
	maxAgeOption, err := ConvertMaxAge(scn.MaxAgeOption)
	if err != nil {
		return nil, err
	}
	cacheInterval := parseIntegerValue(scn.CacheInterval)
	queryType, err := ConvertQueryType(scn.QueryType)
	if err != nil {
		return nil, err
	}
	return &ServerSystemConfig{
		SignalConfigurationParameter:      signalConfigurationParameter.(*SignalConfigurationParameter),
		DefaultSignalConfiguration:        defaultSignalConfiguration.(*DefaultSignalConfiguration),
		TelemetryConfigurationParameter:   telemetryConfigurationParameter.(*TelemetryConfigurationParameter),
		DefaultTelemetryConfiguration:     defaultTelemetryConfiguration.(*DefaultTelemetryConfiguration),
		DefaultTotalPipeCapacity:          defaultTotalPipeCapacity.(*DefaultTotalPipeCapacity),
		DefaultTarget:                     defaultTarget.(*DefaultTarget),
		DefaultTotalTrafficNormalBaseline: defaultTotalTrafficNormalBaseline.(*DefaultTotalTrafficNormalBaseline),
		DefaultTotalConnectionCapacity:    defaultTotalConnectionCapacity.(*DefaultTotalConnectionCapacity),
		SecureFile:                        secureFilePath.(*SecureFile),
		Network:                           network.(*Network),
		Database:                          database.(*Database),
		LifetimeConfiguration:             lifetimeConfiguration.(*LifetimeConfiguration),
		MaxAgeOption:                      maxAgeOption,
		CacheInterval:                     cacheInterval,
		QueryType:                         queryType,
		VendorMappingEnabled:               scn.VendorMappingEnabled,
	}, nil
}
func (sc *ServerSystemConfig) setSignalConfigurationParameter(parameter SignalConfigurationParameter) {
	sc.SignalConfigurationParameter = &parameter
}
func (sc *ServerSystemConfig) setDefaultSignalConfiguration(parameter DefaultSignalConfiguration) {
	sc.DefaultSignalConfiguration = &parameter
}
func (sc *ServerSystemConfig) setTelemetryConfigurationParameter(parameter TelemetryConfigurationParameter) {
	sc.TelemetryConfigurationParameter = &parameter
}
func (sc *ServerSystemConfig) setDefaultTelemetryConfiguration(parameter DefaultTelemetryConfiguration) {
	sc.DefaultTelemetryConfiguration = &parameter
}
func (sc *ServerSystemConfig) setDefaultTotalPipeCapacity(parameter DefaultTotalPipeCapacity) {
	sc.DefaultTotalPipeCapacity = &parameter
}
func (sc *ServerSystemConfig) setDefaultTarget(parameter DefaultTarget) {
	sc.DefaultTarget = &parameter
}
func (sc *ServerSystemConfig) setDefaultTotalTrafficNormalBaseline(parameter DefaultTotalTrafficNormalBaseline) {
	sc.DefaultTotalTrafficNormalBaseline = &parameter
}
func (sc *ServerSystemConfig) setDefaultTotalConnectionCapacity(parameter DefaultTotalConnectionCapacity) {
	sc.DefaultTotalConnectionCapacity = &parameter
}
func (sc *ServerSystemConfig) setSecureFile(config SecureFile) {
	sc.SecureFile = &config
}
func (sc *ServerSystemConfig) setNetwork(config Network) {
	sc.Network = &config
}
func (sc *ServerSystemConfig) setDatabase(config Database) {
	sc.Database = &config
}
func (sc *ServerSystemConfig) setLifetimeConfiguration(parameter LifetimeConfiguration) {
	sc.LifetimeConfiguration = &parameter
}
func (sc *ServerSystemConfig) setMaxAgeOption(parameter uint) {
	sc.MaxAgeOption = parameter
}
func (sc *ServerSystemConfig) setCacheInterval(parameter int) {
	sc.CacheInterval = parameter
}
func (sc *ServerSystemConfig) setQueryType(parameter []int) {
	sc.QueryType = parameter
}
func (sc *ServerSystemConfig) setVendorMappingEnabled(parameter bool) {
	sc.VendorMappingEnabled = parameter
}
var systemConfigInstance *ServerSystemConfig
func GetServerSystemConfig() *ServerSystemConfig {
	if systemConfigInstance == nil {
		systemConfigInstance = &ServerSystemConfig{}
	}
	return systemConfigInstance
}
func parseHcl(hclText []byte) (*ServerConfigTree, error) {
	hclParseTree, err := hcl.Parse(string(hclText))
	if err != nil {
		return nil, err
	}
	cfg := &ServerConfigTree{}
	if err := hcl.DecodeObject(&cfg, hclParseTree); err != nil {
		return nil, err
	}
	return cfg, nil
}
func parseServerYaml(configText []byte) (*ServerConfigTree, error) {
	cfg := &ServerConfigTree{}
	yaml.Unmarshal(configText, cfg)
	return cfg, nil
}
func isSlice(i interface{}) bool {
	return reflect.TypeOf(i).Kind() == reflect.Slice || reflect.TypeOf(i).Kind() == reflect.Array
}
func storeConfigField(field interface{}) (err error) {
	var objConvertible ConfigNode
	var ok bool
	if objConvertible, ok = field.(ConfigNode); !ok {
		return
	}
	objConverted, err := objConvertible.Convert()
	if objConverted == nil || err != nil {
		return
	}
	if objStorable, ok := objConverted.(Storable); ok {
		objStorable.Store()
	}
	return
}
func storeConfigSliceField(slice interface{}) (err error) {
	sliceValue := reflect.ValueOf(slice)
	for i := 0; i < sliceValue.Len(); i++ {
		err = storeConfigField(sliceValue.Index(i).Interface())
		if err != nil {
			return
		}
	}
	return
}
func ParseServerConfig(configText []byte) (cfg *ServerConfigTree, err error) {
	cfg, err = parseServerYaml(configText)
	if err != nil {
		return
	}
	cfgIndirect := reflect.Indirect(reflect.ValueOf(cfg))
	cfgType := cfgIndirect.Type()
	for i := 0; i < cfgType.NumField(); i++ {
		field := cfgIndirect.Field(i).Interface()
		if isSlice(field) {
			err = storeConfigSliceField(field)
			if err != nil {
				return
			}
		} else {
			err = storeConfigField(field)
			if err != nil {
				return
			}
		}
	}
	return
}
func LoadServerConfig(path string) (*ServerConfigTree, error) {
	configText, err := ioutil.ReadFile(path)
	if err != nil {
		return nil, err
	}
	return ParseServerConfig(configText)
}
type ServerConfiguration struct {
	signalConfigurationParameter SignalConfigurationParameter
}
type IntegerParameterRange struct {
	start int
	end   int
}
type FloatParameterRange struct {
	start float64
	end   float64
}