2015-04-09 21:22:47 +00:00
|
|
|
package wa.server.plugin.apache;
|
|
|
|
|
|
|
|
|
|
import wa.server.WAConstants;
|
2015-07-27 15:10:11 +00:00
|
|
|
import wa.server.plugin.WAServiceConfig;
|
2015-08-07 14:46:01 +00:00
|
|
|
import zutil.db.DBConnection;
|
2015-04-09 21:22:47 +00:00
|
|
|
import zutil.db.bean.DBBean;
|
2015-08-07 14:46:01 +00:00
|
|
|
import zutil.db.bean.DBBean.DBTable;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
2015-04-09 21:22:47 +00:00
|
|
|
|
2015-07-27 15:10:11 +00:00
|
|
|
public class ApacheConfigVirtualHost implements WAServiceConfig{
|
|
|
|
|
public static final String CONFIG_NAME = "Apache Virtual Host";
|
|
|
|
|
|
2015-08-07 14:46:01 +00:00
|
|
|
private List<VirtualHostData> vhosts = new ArrayList<>();
|
2015-04-09 21:22:47 +00:00
|
|
|
|
2015-07-27 15:10:11 +00:00
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getName() {
|
|
|
|
|
return CONFIG_NAME;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2015-08-07 14:46:01 +00:00
|
|
|
public void read() throws Exception {
|
|
|
|
|
DBConnection db = WAConstants.getDB();
|
|
|
|
|
vhosts = DBBean.load(db, VirtualHostData.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void save() throws Exception {
|
2015-07-27 15:10:11 +00:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2015-08-07 14:46:01 +00:00
|
|
|
public void configure() throws Exception {
|
2015-07-27 15:10:11 +00:00
|
|
|
|
|
|
|
|
}
|
2015-08-07 14:46:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
@DBTable(WAConstants.DB_TABLE_PREFIX + "_apache_vhost")
|
|
|
|
|
public static class VirtualHostData extends DBBean{
|
|
|
|
|
protected String domain;
|
|
|
|
|
protected String path;
|
|
|
|
|
protected boolean ssl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getDomain() {
|
|
|
|
|
return domain;
|
|
|
|
|
}
|
|
|
|
|
public void setDomain(String domain) {
|
|
|
|
|
this.domain = domain;
|
|
|
|
|
}
|
|
|
|
|
public String getPath() {
|
|
|
|
|
return path;
|
|
|
|
|
}
|
|
|
|
|
public void setPath(String path) {
|
|
|
|
|
this.path = path;
|
|
|
|
|
}
|
|
|
|
|
public boolean isSSL() {
|
|
|
|
|
return ssl;
|
|
|
|
|
}
|
|
|
|
|
public void setSSL(boolean ssl) {
|
|
|
|
|
this.ssl = ssl;
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-04-09 21:22:47 +00:00
|
|
|
}
|