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

org.bidib.wizard.localhost.config.LocalHostSettings Maven / Gradle / Ivy

There is a newer version: 2.0.29
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy