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

de.chandre.admintool.melody.AdminToolJavaMelodyConfig Maven / Gradle / Ivy

There is a newer version: 1.1.7.3
Show newest version
package de.chandre.admintool.melody;

import java.util.HashSet;
import java.util.Set;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import de.chandre.admintool.core.AdminToolConfig;

@Component("adminToolJavaMelodyConfig")
public class AdminToolJavaMelodyConfig implements AdminToolConfig {
	
	private static final Log LOGGER = LogFactory.getLog(AdminToolJavaMelodyConfig.class);
	
	@Value("${adminTool.melody.enabled:true}")
	private boolean enabled;
	
	@Value("${adminTool.melody.path:/monitoring}")
	private String melodyPath;
	
	@Value("#{'${admintool.melody.securityRoles:}'.split(';')}")
	private Set securityRoles = new HashSet<>();
	
	@Value("${admintool.melody.componentPosition:}")
	private Integer componentPosition;

	
	public boolean isEnabled() {
		return enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	public String getMelodyPath() {
		return melodyPath;
	}

	public void setMelodyPath(String melodyPath) {
		this.melodyPath = melodyPath;
	}

	public Set getSecurityRoles() {
		return securityRoles;
	}

	public void setSecurityRoles(Set securityRoles) {
		this.securityRoles = securityRoles;
	}

	public Integer getComponentPosition() {
		return componentPosition;
	}

	public void setComponentPosition(Integer componentPosition) {
		this.componentPosition = componentPosition;
	}
	
	@Override
	public void printConfig() {
		LOGGER.debug(toString());
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("AdminToolJavaMelodyConfig [enabled=").append(enabled).append(", melodyPath=").append(melodyPath)
				.append(", securityRoles=").append(securityRoles).append(", componentPosition=")
				.append(componentPosition).append("]");
		return builder.toString();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy