01: package org.dbbrowser.drivermanager;
02:
03: import java.util.List;
04:
05: /**
06: * This class stores the list of connection infos and the password used to encrypt the database passwords. If the
07: * master password provided in the constructer is null, it defaults to "DBBrowser"
08: * @author amangat
09: */
10: public class ConnectionInfos {
11: private static final String DEFAULT_MASTER_PASSWORD = "DBBrowser";
12: private List listOfConnectionInfos = null;
13: private String masterPassword = DEFAULT_MASTER_PASSWORD;
14:
15: /**
16: * Constructer
17: * @param listOfConnectionInfos
18: * @param masterPassword
19: */
20: public ConnectionInfos(List listOfConnectionInfos,
21: String inMasterPassword) {
22: this .listOfConnectionInfos = listOfConnectionInfos;
23:
24: if (inMasterPassword != null && (!"".equals(inMasterPassword))) {
25: this .masterPassword = inMasterPassword;
26: }
27: }
28:
29: /**
30: * Returns the list of connection infos
31: * @return
32: */
33: public List getListOfConnectionInfos() {
34: return this .listOfConnectionInfos;
35: }
36:
37: /**
38: * Returns the master password
39: * @return
40: */
41: public String getMasterPassword() {
42: return this .masterPassword;
43: }
44:
45: /**
46: * Set the master password
47: * @param masterPassword
48: */
49: public void setMasterPassword(String masterPassword) {
50: this .masterPassword = masterPassword;
51: }
52:
53: /**
54: * Returns true is password set by user
55: * @return
56: */
57: public Boolean isPasswordSetByUser() {
58: Boolean ans = Boolean.TRUE;
59: if (DEFAULT_MASTER_PASSWORD.equals(this.getMasterPassword())) {
60: ans = Boolean.FALSE;
61: }
62:
63: return ans;
64: }
65: }
|