View Javadoc

1   /***
2    * 
3    */
4   package net.sourceforge.jdbdump.gui;
5   
6   import java.util.ArrayList;
7   import java.util.Collection;
8   
9   import javax.faces.model.SelectItem;
10  
11  import net.sourceforge.jdbdump.connect.DatabaseConnectorFactory;
12  
13  /***
14   * @author grabka
15   *
16   */
17  public class DbEditBean {
18  	private String dbTitle;
19  	private String dbServerName;
20  	private String port;
21  	private String engine;
22  	private String dbName;
23  	private String login;
24  	private String password;
25  	private String passwordAgain;
26  	private String url;
27  	private ArrayList<SelectItem> engines;
28  	
29  	public DbEditBean() {
30  		engines = new ArrayList<SelectItem>();
31  		String[] enginesStrings = DatabaseConnectorFactory.getInstance().listPlugins();
32  		
33  		for (int i=0; i<enginesStrings.length; i++) {
34  			String engineShortName = enginesStrings[i].substring(enginesStrings[i].lastIndexOf(".")+1);
35  			engines.add(new SelectItem(engineShortName));
36  		}
37  	}
38  
39  	public String getDbName() {
40  		return dbName;
41  	}
42  
43  	public void setDbName(String dbName) {
44  		this.dbName = dbName;
45  	}
46  
47  	public String getDbServerName() {
48  		return dbServerName;
49  	}
50  
51  	public void setDbServerName(String dbServerName) {
52  		this.dbServerName = dbServerName;
53  	}
54  
55  	public String getDbTitle() {
56  		return dbTitle;
57  	}
58  
59  	public void setDbTitle(String dbTitle) {
60  		this.dbTitle = dbTitle;
61  	}
62  
63  	public String getEngine() {
64  		return engine;
65  	}
66  
67  	public void setEngine(String engine) {
68  		this.engine = engine;
69  	}
70  
71  	public String getLogin() {
72  		return login;
73  	}
74  
75  	public void setLogin(String login) {
76  		this.login = login;
77  	}
78  
79  	public String getPassword() {
80  		return password;
81  	}
82  
83  	public void setPassword(String password) {
84  		this.password = password;
85  	}
86  
87  	public String getPasswordAgain() {
88  		return passwordAgain;
89  	}
90  
91  	public void setPasswordAgain(String passwordAgain) {
92  		this.passwordAgain = passwordAgain;
93  	}
94  
95  	public String getPort() {
96  		return port;
97  	}
98  
99  	public void setPort(String port) {
100 		this.port = port;
101 	}
102 	
103 	public Collection<SelectItem> getEngines(){
104 		  return engines;
105 	}
106 	
107 	public void setEngines(Collection<SelectItem> engines){
108 		  this.engines = new ArrayList<SelectItem>(engines);
109 	} 	
110 	
111 	public String getUrl() {
112 		return url;
113 	}
114 
115 	public void setUrl(String url) {
116 		this.url = url;
117 	}
118 }