1
|
/**
|
2
|
* Copyright (C) 2009 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.database;
|
10
|
import java.util.ArrayList;
|
11
|
import java.util.List;
|
12
|
|
13
|
import org.springframework.jdbc.datasource.AbstractDriverBasedDataSource;
|
14
|
|
15
|
/**
|
16
|
* @author a.kohlbecker
|
17
|
* @since 12.01.2010
|
18
|
*/
|
19
|
public class DataSourceInfo {
|
20
|
|
21
|
String url;
|
22
|
String username;
|
23
|
List<String> problems;
|
24
|
|
25
|
public String getUrl() {
|
26
|
return url;
|
27
|
}
|
28
|
public void setUrl(String url) {
|
29
|
this.url = url;
|
30
|
}
|
31
|
public String getUsername() {
|
32
|
return username;
|
33
|
}
|
34
|
public void setUsername(String userName) {
|
35
|
this.username = userName;
|
36
|
}
|
37
|
public List<String> getProblems() {
|
38
|
if(problems == null){
|
39
|
problems = new ArrayList<String>();
|
40
|
}
|
41
|
return problems;
|
42
|
}
|
43
|
public void setProblems(List<String> problems) {
|
44
|
this.problems = problems;
|
45
|
}
|
46
|
public boolean hasProblems() {
|
47
|
return getProblems().size() > 0;
|
48
|
}
|
49
|
|
50
|
public DataSourceInfo(AbstractDriverBasedDataSource dataSource){
|
51
|
if(dataSource != null){
|
52
|
setUrl(dataSource.getUrl());
|
53
|
setUsername(dataSource.getUsername());
|
54
|
}
|
55
|
}
|
56
|
}
|