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

io.metaloom.test.container.provider.server.ServerConfiguration Maven / Gradle / Ivy

There is a newer version: 0.1.4
Show newest version
package io.metaloom.test.container.provider.server;

import io.metaloom.test.container.provider.DatabaseSettings;

public record ServerConfiguration(int httpPort, String host, Integer port, String username, String password, String adminDB,
	String templateDatabaseName, Integer defaultPoolMinimum, Integer defaultPoolMaximum,
	Integer defaultPoolIncrement) {

	public static ServerConfiguration create(int httpPort, String host, Integer port, String username, String password, String adminDB,
		String templateDatabaseName, Integer defaultPoolMinimum, Integer defaultPoolMaximum,
		Integer defaultPoolIncrement) {
		return new ServerConfiguration(httpPort, host, port, username, password, adminDB, templateDatabaseName, defaultPoolMinimum,
			defaultPoolMaximum, defaultPoolIncrement);
	}

	public static ServerConfiguration create(int httpPort) {
		return new ServerConfiguration(httpPort, null, null, null, null, null, null, null, null, null);
	}

	public DatabaseSettings databaseSettings() {
		return new DatabaseSettings(host, port, host, port, username, password, adminDB);
	}

	public boolean hasConnectionDetails() {
		return host != null && port != null && username != null && password != null && adminDB != null;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy