org.bidib.wizard.localhost.config.LocalHostSettings Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bidibwizard-localhost Show documentation
Show all versions of bidibwizard-localhost Show documentation
jBiDiB BiDiB Wizard localhost POM
package org.bidib.wizard.localhost.config;
import org.bidib.wizard.common.model.settings.AbstractSettings;
import org.bidib.wizard.common.model.settings.LocalHostSettingsInterface;
import org.bidib.wizard.common.model.settings.annotation.SettingsIdentifier;
import org.bidib.wizard.common.model.settings.configuration.YamlPropertySourceFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.validation.annotation.Validated;
@ConfigurationProperties(prefix = "wizardmodule-local-host-configuration")
@SettingsIdentifier(storageIdentifier = "wizardmodule_localHostConfiguration")
@PropertySource(value = "file:${miscSettings.bidibConfigDir}/wizardmodule_localHostConfiguration.yml", factory = YamlPropertySourceFactory.class, ignoreResourceNotFound = true)
@Validated
public class LocalHostSettings extends AbstractSettings implements LocalHostSettingsInterface {
private static final long serialVersionUID = 1L;
private boolean localHostClientEnabled;
private boolean localHostServiceEnabled;
@Override
public boolean isLocalHostClientEnabled() {
return localHostClientEnabled;
}
@Override
public void setLocalHostClientEnabled(boolean localHostClientEnabled) {
boolean oldValue = this.localHostClientEnabled;
this.localHostClientEnabled = localHostClientEnabled;
firePropertyChange(PROPERTY_LOCALHOST_CLIENT_ENABLED, oldValue, this.localHostClientEnabled);
}
@Override
public boolean isLocalHostServiceEnabled() {
return localHostServiceEnabled;
}
@Override
public void setLocalHostServiceEnabled(boolean localHostServiceEnabled) {
boolean oldValue = this.localHostServiceEnabled;
this.localHostServiceEnabled = localHostServiceEnabled;
firePropertyChange(PROPERTY_LOCALHOST_SERVICE_ENABLED, oldValue, this.localHostServiceEnabled);
}
}