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

com.vmware.vip.core.conf.ServerProperties Maven / Gradle / Ivy

There is a newer version: 0.7.12
Show newest version
/*
 * Copyright 2019-2022 VMware, Inc.
 * SPDX-License-Identifier: EPL-2.0
 */
package com.vmware.vip.core.conf;

import java.io.File;
import java.io.IOException;
import java.io.Serializable;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import com.vmware.vip.common.constants.ConstantsTomcat;

/**
 * this is the tomcat configuration properties
 *
 */
@Configuration
public class ServerProperties implements Serializable {

	private static final long serialVersionUID = 9008828985564148771L;

	@Value("${server.http.port}")
	private Integer httpPort;

	@Value("${server.port}")
	private Integer serverPort;

	@Value("${server.scheme}")
	private String serverScheme;

	@Value("${server.https.key-store}")
	private String httpsKeyStore;

	@Value("${server.https.key-store-password}")
	private String httpsKeyStorePassword;

	@Value("${server.https.key-store-type}")
	private String httpsKeyStoreType;

	@Value("${server.https.key-password}")
	private String httpsKeyPassword;

	@Value("${server.https.key-alias}")
	private String httpsKeyAlias;
	
	@Value("${server.max-http-header-size:8192}")
	private Integer maxHttpHeaderSize;
	
	
	@Value("${server.trace.enable}")
   private Boolean allowTrace;

	public Integer getServerPort() {
		return serverPort;
	}

	public String getServerScheme() {
		return serverScheme;
	}

	public Integer getHttpPort() {
		return this.httpPort;
	}

	public String getHttpsKeyStore() {
		if (this.httpsKeyStore.startsWith(ConstantsTomcat.CLASSPATH_STR)) {
			return this.httpsKeyStore.replace(ConstantsTomcat.CLASSPATH_STR, "");
		} else {
			try {
				return new File(this.httpsKeyStore).getCanonicalPath();
			} catch (IOException e) {
				return this.httpsKeyStore;
			}
		}
	}

	public String getHttpsKeyStorePassword() {
		return httpsKeyStorePassword;
	}

	public String getHttpsKeyStoreType() {
		return httpsKeyStoreType;
	}

	public String getHttpsKeyPassword() {
		return httpsKeyPassword;
	}

	public String getHttpsKeyAlias() {
		return httpsKeyAlias;
	}

   public Boolean isAllowTrace() {
      return allowTrace;
   }

public Integer getMaxHttpHeaderSize() {
	return maxHttpHeaderSize;
}

public void setMaxHttpHeaderSize(Integer maxHttpHeaderSize) {
	this.maxHttpHeaderSize = maxHttpHeaderSize;
}



}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy