package com.atlassian.bitbucket.ssh;

import javax.annotation.Nullable;
import java.io.Serializable;

/**
 * Convenience implementation of {@link SshConfiguration} for use with the {@link SshConfigurationService}.
 */
public final class SimpleSshConfiguration implements SshConfiguration, Serializable {

    private final boolean accessKeysEnabled;
    private final boolean enabled;
    private final int port;
    private final String baseUrl;

    public SimpleSshConfiguration(boolean enabled, boolean accessKeysEnabled, int port, @Nullable String baseUrl) {
        this.accessKeysEnabled = accessKeysEnabled;
        this.enabled = enabled;
        this.port = port;
        this.baseUrl = baseUrl;
    }

    @Override
    public boolean isAccessKeysEnabled() {
        return accessKeysEnabled;
    }

    @Override
    public boolean isEnabled() {
        return enabled;
    }

    @Override
    public int getPort() {
        return port;
    }

    @Override
    public String getBaseUrl() {
        return baseUrl;
    }
}
