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

com.spotify.helios.agent.AgentConfig Maven / Gradle / Ivy

There is a newer version: 0.9.283
Show newest version
/*
 * Copyright (c) 2014 Spotify AB.
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.spotify.helios.agent;

import com.spotify.helios.servicescommon.DockerHost;

import io.dropwizard.Configuration;

import java.net.InetSocketAddress;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;

/**
 * The configuration of the Helios agent.
 */
public class AgentConfig extends Configuration {

  private String domain;
  private String name;
  private String zooKeeperConnectionString;
  private DockerHost dockerHost;
  private int zooKeeperSessionTimeoutMillis;
  private int zooKeeperConnectionTimeoutMillis;
  private String zooKeeperNamespace;
  private String zooKeeperClusterId;
  private Map envVars;
  private String redirectToSyslog;
  private boolean inhibitMetrics;
  private Path stateDirectory;
  private String statsdHostPort;
  private String riemannHostPort;
  private String serviceRegistryAddress;
  private int portRangeStart;
  private int portRangeEnd;
  private String sentryDsn;
  private Path serviceRegistrarPlugin;
  private String id;
  private List dns;
  private int adminPort;
  private InetSocketAddress httpEndpoint;
  private boolean noHttp;
  private List binds;
  private List kafkaBrokers;

  public boolean isInhibitMetrics() {
    return inhibitMetrics;
  }

  public AgentConfig setInhibitMetrics(boolean inhibitMetrics) {
    this.inhibitMetrics = inhibitMetrics;
    return this;
  }

  public String getName() {
    return name;
  }

  public AgentConfig setName(final String name) {
    this.name = name;
    return this;
  }

  public AgentConfig setRedirectToSyslog(final String redirect) {
    this.redirectToSyslog = redirect;
    return this;
  }

  public String getRedirectToSyslog() {
    return redirectToSyslog;
  }

  public String getDomain() {
    return domain;
  }

  public AgentConfig setDomain(final String domain) {
    this.domain = domain;
    return this;
  }

  public String getZooKeeperConnectionString() {
    return zooKeeperConnectionString;
  }

  public AgentConfig setZooKeeperConnectionString(final String connectionString) {
    this.zooKeeperConnectionString = connectionString;
    return this;
  }

  public AgentConfig setDockerHost(final DockerHost dockerHost) {
    this.dockerHost = dockerHost;
    return this;
  }

  public DockerHost getDockerHost() {
    return dockerHost;
  }

  public AgentConfig setZooKeeperSessionTimeoutMillis(final int timeoutMillis) {
    this.zooKeeperSessionTimeoutMillis = timeoutMillis;
    return this;
  }

  public int getZooKeeperSessionTimeoutMillis() {
    return zooKeeperSessionTimeoutMillis;
  }

  public AgentConfig setZooKeeperConnectionTimeoutMillis(final int timeoutMillis) {
    this.zooKeeperConnectionTimeoutMillis = timeoutMillis;
    return this;
  }

  public int getZooKeeperConnectionTimeoutMillis() {
    return zooKeeperConnectionTimeoutMillis;
  }

  public AgentConfig setZooKeeperNamespace(String zooKeeperPathPrefix) {
    this.zooKeeperNamespace = zooKeeperPathPrefix;
    return this;
  }

  public String getZooKeeperNamespace() {
    return this.zooKeeperNamespace;
  }

  public AgentConfig setZooKeeperClusterId(String zooKeeperClusterId) {
    this.zooKeeperClusterId = zooKeeperClusterId;
    return this;
  }

  public String getZooKeeperClusterId() {
    return zooKeeperClusterId;
  }

  public AgentConfig setEnvVars(final Map envVars) {
    this.envVars = envVars;
    return this;
  }

  public Map getEnvVars() {
    return envVars;
  }

  public AgentConfig setStateDirectory(final Path stateDirectory) {
    this.stateDirectory = stateDirectory;
    return this;
  }

  public Path getStateDirectory() {
    return stateDirectory;
  }

  public AgentConfig setStatsdHostPort(String hostPort) {
    this.statsdHostPort = hostPort;
    return this;
  }

  public String getStatsdHostPort() {
    return statsdHostPort;
  }
  public AgentConfig setRiemannHostPort(String hostPort) {
    this.riemannHostPort = hostPort;
    return this;
  }

  public String getRiemannHostPort() {
    return riemannHostPort;
  }

  public AgentConfig setServiceRegistryAddress(final String address) {
    this.serviceRegistryAddress = address;
    return this;
  }

  public String getServiceRegistryAddress() {
    return serviceRegistryAddress;
  }

  public AgentConfig setPortRange(final int start, final int end) {
    this.portRangeStart = start;
    this.portRangeEnd = end;
    return this;
  }

  public int getPortRangeStart() {
    return portRangeStart;
  }

  public int getPortRangeEnd() {
    return portRangeEnd;
  }

  public String getSentryDsn() {
    return sentryDsn;
  }

  public AgentConfig setSentryDsn(String sentryDsn) {
    this.sentryDsn = sentryDsn;
    return this;
  }

  public Path getServiceRegistrarPlugin() {
    return serviceRegistrarPlugin;
  }

  public AgentConfig setServiceRegistrarPlugin(final Path serviceRegistrarPlugin) {
    this.serviceRegistrarPlugin = serviceRegistrarPlugin;
    return this;
  }

  public String getId() {
    return id;
  }

  public AgentConfig setId(final String id) {
    this.id = id;
    return this;
  }

  public List getDns() {
    return dns;
  }

  public AgentConfig setDns(List dns) {
    this.dns = dns;
    return this;
  }

  public AgentConfig setAdminPort(int adminPort) {
    this.adminPort = adminPort;
    return this;
  }

  public AgentConfig setHttpEndpoint(InetSocketAddress httpEndpoint) {
    this.httpEndpoint = httpEndpoint;
    return this;
  }

  public int getAdminPort() {
    return adminPort;
  }

  public InetSocketAddress getHttpEndpoint() {
    return httpEndpoint;
  }

  public AgentConfig setNoHttp(boolean noHttp) {
    this.noHttp = noHttp;
    return this;
  }

  public boolean getNoHttp() {
    return noHttp;
  }

  public List getBinds() {
    return binds;
  }

  public AgentConfig setBinds(List binds) {
    this.binds = binds;
    return this;
  }

  public List getKafkaBrokers() {
    return kafkaBrokers;
  }

  public AgentConfig setKafkaBrokers(List kafkaBrokers) {
    this.kafkaBrokers = kafkaBrokers;
    return this;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy