java/sql-dk/src/info/globalcode/sql/dk/configuration/TunnelDefinition.java
author František Kučera <franta-hg@frantovo.cz>
Tue, 26 Feb 2019 18:19:49 +0100
branchv_0
changeset 236 a3ec71fa8e17
parent 203 504c4ba56d1c
permissions -rw-r--r--
Avoid reusing/rewriting the DB connection properties. There was weird random errors while testing connection to multiple DB in parallel when one of them was meta connection to same DB connection. Two kinds of exception: 1) missing password 2) „Passing DB password as CLI parameter is insecure!“
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
203
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
/**
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
 * SQL-DK
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
 * Copyright © 2015 František Kučera (frantovo.cz)
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
 *
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
 * This program is free software: you can redistribute it and/or modify
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
 * the Free Software Foundation, either version 3 of the License, or
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
 * (at your option) any later version.
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
 *
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful,
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
 * GNU General Public License for more details.
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
 *
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
 */
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
package info.globalcode.sql.dk.configuration;
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
import static info.globalcode.sql.dk.Xmlns.CONFIGURATION;
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
import java.util.List;
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
import javax.xml.bind.annotation.XmlElement;
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
/**
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
 *
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
 * @author Ing. František Kučera (frantovo.cz)
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
 */
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
public class TunnelDefinition {
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
	private String command;
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
	private List<CommandArgument> arguments;
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
	@XmlElement(name = "command", namespace = CONFIGURATION)
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
	public String getCommand() {
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
		return command;
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
	}
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
	public void setCommand(String command) {
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
		this.command = command;
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
	}
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
	@XmlElement(name = "argument", namespace = CONFIGURATION)
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    43
	public List<CommandArgument> getArguments() {
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
		return arguments;
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    45
	}
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    46
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    47
	public void setArguments(List<CommandArgument> arguments) {
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    48
		this.arguments = arguments;
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    49
	}
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    50
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    51
}