/*
 *  Copyright (C) 2016 VSCT
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */

package com.vsct.dt.strowgr.admin.gui.configuration;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.dropwizard.Configuration;
import io.dropwizard.client.HttpClientConfiguration;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

public class StrowgrConfiguration extends Configuration {

    public StrowgrConfiguration(){
        super();
    }

    @Min(1)
    private long handledHaproxyRefreshPeriodSecond;

    @Valid
    @NotNull
    private ConsulRepositoryFactory consulRepositoryFactory;

    @Valid
    @NotNull
    private NSQLookupFactory nsqLookupfactory;

    @Valid
    @NotNull
    private NSQProducerFactory nsqProducerFactory;

    @Valid
    @NotNull
    private PeriodicSchedulerFactory periodicSchedulerFactory;

    @NotEmpty
    private String defaultHAPName;

    @Min(1)
    private int threads;

    @Min(10)
    private int commitTimeout;

    @Valid
    @NotNull
    private HttpClientConfiguration httpClient = new HttpClientConfiguration();

    @JsonProperty("repository")
    public ConsulRepositoryFactory getConsulRepositoryFactory() {
        return consulRepositoryFactory;
    }

    @JsonProperty("repository")
    public void setConsulRepositoryFactory(ConsulRepositoryFactory consulRepositoryFactory) {
        this.consulRepositoryFactory = consulRepositoryFactory;
    }

    @JsonProperty("nsqLookup")
    public NSQLookupFactory getNsqLookupfactory() {
        return nsqLookupfactory;
    }

    @JsonProperty("nsqLookup")
    public void setNsqLookupfactory(NSQLookupFactory nsqLookupfactory) {
        this.nsqLookupfactory = nsqLookupfactory;
    }

    @JsonProperty("nsqProducer")
    public NSQProducerFactory getNsqProducerFactory() {
        return nsqProducerFactory;
    }

    @JsonProperty("nsqProducer")
    public void setNsqProducerFactory(NSQProducerFactory nsqProducerFactory) {
        this.nsqProducerFactory = nsqProducerFactory;
    }

    @JsonProperty("periodicScheduler")
    public PeriodicSchedulerFactory getPeriodicSchedulerFactory() {
        return periodicSchedulerFactory;
    }

    @JsonProperty("periodicScheduler")
    public void setPeriodicSchedulerFactory(PeriodicSchedulerFactory periodicSchedulerFactory) {
        this.periodicSchedulerFactory = periodicSchedulerFactory;
    }

    @JsonProperty("haproxyName")
    public String getDefaultHAPName() {
        return defaultHAPName;
    }

    @JsonProperty("haproxyName")
    public void setDefaultHAPName(String defaultHAPName) {
        this.defaultHAPName = defaultHAPName;
    }

    @JsonProperty("threads")
    public int getThreads() {
        return threads;
    }

    @JsonProperty("threads")
    public void setThreads(int threads) {
        this.threads = threads;
    }

    @JsonProperty("commitTimeout")
    public int getCommitTimeout() {
        return commitTimeout;
    }

    @JsonProperty("commitTimeout")
    public void setCommitTimeout(int commitTimeout) {
        this.commitTimeout = commitTimeout;
    }


    @JsonProperty("httpClient")
    public HttpClientConfiguration getHttpClientConfiguration() {
        return httpClient;
    }

    @JsonProperty("httpClient")
    public void setHttpClientConfiguration(HttpClientConfiguration httpClient) {
        this.httpClient = httpClient;
    }

    public long getHandledHaproxyRefreshPeriodSecond() {
        return handledHaproxyRefreshPeriodSecond;
    }

    public void setHandledHaproxyRefreshPeriodSecond(long handledHaproxyRefreshPeriodSecond) {
        this.handledHaproxyRefreshPeriodSecond = handledHaproxyRefreshPeriodSecond;
    }
}

@@ -1474,58 +1474,8 @@
 y;%0A%0A
-    @NotEmpty%0A    private String defaultHAPName;%0A%0A
     
@@ -2956,264 +2956,8 @@
  %7D%0A%0A
-    @JsonProperty(%22haproxyName%22)%0A    public String getDefaultHAPName() %7B%0A        return defaultHAPName;%0A    %7D%0A%0A    @JsonProperty(%22haproxyName%22)%0A    public void setDefaultHAPName(String defaultHAPName) %7B%0A        this.defaultHAPName = defaultHAPName;%0A    %7D%0A%0A
     

Remove unused property