rename setter and getter

This commit is contained in:
Peter Hormanns 2023-12-12 14:38:59 +01:00
parent 13316d265e
commit c4bbde5984
4 changed files with 30 additions and 113 deletions

View File

@ -1,95 +1,12 @@
DROP VIEW ipconfig;
ALTER TABLE packet
ALTER COLUMN packet_name TYPE VARCHAR(6);
ALTER TABLE packet
ALTER COLUMN hive_id DROP NOT NULL;
UPDATE packet SET packet_name='vm10' || substr(packet_name,4,2) WHERE packet_name LIKE 'srv%';
ALTER TABLE domain
ADD COLUMN passenger_python character varying(256) NULL,
ADD COLUMN passenger_nodejs character varying(256) NULL,
ADD COLUMN passenger_ruby character varying(256) NULL,
ADD COLUMN fcgi_php_bin character varying(256) NULL;
CREATE VIEW ipconfig AS
SELECT DISTINCT ON (theunion.ipv4) theunion.ipv4,
theunion.name,
theunion.alias,
theunion.hivename
FROM ( SELECT h.hive_name AS hivename,
ip.inet_addr AS ipv4,
'eth0:'::text || p.packet_name::text AS alias,
p.packet_name AS name,
2 AS prio
FROM inet_addr ip
JOIN packet p ON p.cur_inet_addr_id = ip.inet_addr_id
JOIN hive h ON h.hive_id = p.hive_id
UNION
SELECT h.hive_name AS hivename,
ip.inet_addr AS ipv4,
'eth0'::text AS alias,
h.hive_name AS name,
1 AS prio
FROM inet_addr ip
JOIN hive h ON h.inet_addr_id = ip.inet_addr_id
ORDER BY 2, 5) theunion;
INSERT INTO basepacket (basepacket_code, description, sorting, valid, article_number)
VALUES ('SRV/CLD', 'Cloud Server', 0, true, 3000);
INSERT INTO basecomponent (basecomponent_code, description, sorting, valid)
VALUES ('BANDWIDTH', 'Bandbreite 95/5 (Mbit/s)', 0, true);
INSERT INTO basecomponent (basecomponent_code, description, sorting, valid)
VALUES ('SLAINFR8H', 'HS Ext. Support (24x7 8h) for Infrastructure', 0, true);
INSERT INTO basecomponent (basecomponent_code, description, sorting, valid)
VALUES ('SLAINFR4H', 'HS Ext. Support (24x7 4h) for Infrastructure', 0, true);
INSERT INTO basecomponent (basecomponent_code, description, sorting, valid)
VALUES ('SLAINFR2H', 'HS Ext. Support (24x7 2h) for Infrastructure', 0, true);
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number)
SELECT basepacket_id, basecomponent_id, 1, 102400000, 1, 1, 0, false, 3011 FROM basepacket, basecomponent WHERE basepacket_code='SRV/CLD' AND basecomponent_code='CPU';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number)
SELECT basepacket_id, basecomponent_id, 1024, 102400000, 1024, 1024, 0, false, 3012 FROM basepacket, basecomponent WHERE basepacket_code='SRV/CLD' AND basecomponent_code='RAM';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number)
SELECT basepacket_id, basecomponent_id, 0, 102400000, 250, 250, 0, false, 3013 FROM basepacket, basecomponent WHERE basepacket_code='SRV/CLD' AND basecomponent_code='TRAFFIC';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number)
SELECT basepacket_id, basecomponent_id, 0, 1000, 0, 1, 0, false, 3017 FROM basepacket, basecomponent WHERE basepacket_code='SRV/CLD' AND basecomponent_code='BANDWIDTH';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number)
SELECT basepacket_id, basecomponent_id, 25600, 102400000, 25600, 25600, 0, false, 3014 FROM basepacket, basecomponent WHERE basepacket_code='SRV/CLD' AND basecomponent_code='QUOTA';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number)
SELECT basepacket_id, basecomponent_id, 0, 102400000, 0, 256000, 0, false, 3015 FROM basepacket, basecomponent WHERE basepacket_code='SRV/CLD' AND basecomponent_code='STORAGE';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number)
SELECT basepacket_id, basecomponent_id, 1, 1, 1, 1, 0, false, 3136 FROM basepacket, basecomponent WHERE basepacket_code='SRV/CLD' AND basecomponent_code='SLABASIC';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number)
SELECT basepacket_id, basecomponent_id, 0, 1, 0, 1, 0, false, 3122 FROM basepacket, basecomponent WHERE basepacket_code='SRV/CLD' AND basecomponent_code='SLAINFR8H';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number)
SELECT basepacket_id, basecomponent_id, 0, 1, 0, 1, 0, false, 3125 FROM basepacket, basecomponent WHERE basepacket_code='SRV/CLD' AND basecomponent_code='SLAINFR4H';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number)
SELECT basepacket_id, basecomponent_id, 0, 1, 0, 1, 0, false, 3151 FROM basepacket, basecomponent WHERE basepacket_code='SRV/CLD' AND basecomponent_code='SLAINFR2H';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number)
SELECT basepacket_id, basecomponent_id, 0, 1000, 0, 1, 0, false, 2017 FROM basepacket, basecomponent WHERE basepacket_code='SRV/MGD' AND basecomponent_code='BANDWIDTH';
UPDATE component SET min_quantity=0 WHERE component_id=38; -- min. Traffic für Managed Server auf 0
INSERT INTO price (article_number, price, vat, price_list) VALUES (3011, 15, 19.0, 1);
INSERT INTO price (article_number, price, vat, price_list) VALUES (3012, 5, 19.0, 1);
INSERT INTO price (article_number, price, vat, price_list) VALUES (3013, 5, 19.0, 1);
INSERT INTO price (article_number, price, vat, price_list) VALUES (3014, 5, 19.0, 1);
INSERT INTO price (article_number, price, vat, price_list) VALUES (3015, 5, 19.0, 1);
INSERT INTO price (article_number, price, vat, price_list) VALUES (3017, 2, 19.0, 1);
INSERT INTO price (article_number, price, vat, price_list) VALUES (3136, 10, 19.0, 1);
INSERT INTO price (article_number, price, vat, price_list) VALUES (3122, 40, 19.0, 1);
INSERT INTO price (article_number, price, vat, price_list) VALUES (3125, 80, 19.0, 1);
INSERT INTO price (article_number, price, vat, price_list) VALUES (3151, 160, 19.0, 1);
INSERT INTO price (article_number, price, vat, price_list) VALUES (2017, 2, 19.0, 1);
INSERT INTO domain_option (domain_option_name) VALUES ('passenger');
INSERT INTO domain_option (domain_option_name) VALUES ('passengerfriendlyerrorpages');
INSERT INTO domain_option (domain_option_name) VALUES ('cgi');
INSERT INTO domain_option (domain_option_name) VALUES ('fastcgi');
ALTER TABLE domain ADD COLUMN passenger_python character varying(255);
ALTER TABLE domain ADD COLUMN passenger_nodejs character varying(255);
ALTER TABLE domain ADD COLUMN passenger_ruby character varying(255);
ALTER TABLE domain ADD COLUMN fcgi_php_bin character varying(255);
INSERT INTO domain_option (domain_option_name) VALUES
('passenger'),
('passengerfriendlyerrorpages'),
('cgi'),
('fastcgi');

View File

@ -51,13 +51,13 @@ public class DomainRemote extends AbstractRemote {
}
final String validsubdomains = dom.getValidsubdomainnames();
resultMap.put("validsubdomainnames", validsubdomains);
final String passengerpython = dom.getPassengerPython();
final String passengerpython = dom.getPassengerpython();
resultMap.put("passengerpython", passengerpython);
final String passengernodejs = dom.getPassengerNodejs();
final String passengernodejs = dom.getPassengernodejs();
resultMap.put("passengernodejs", passengernodejs);
final String passengerruby = dom.getPassengerRuby();
final String passengerruby = dom.getPassengerruby();
resultMap.put("passengerruby", passengerruby);
final String passengerfcgiphpbin = dom.getFcgiPhpBin();
final String passengerfcgiphpbin = dom.getFcgiphpbin();
resultMap.put("passengerfcgiphpbin", passengerfcgiphpbin);
}
@ -102,19 +102,19 @@ public class DomainRemote extends AbstractRemote {
}
final Object passengerpython = setParams.get("passengerpython");
if (passengerpython != null && passengerpython instanceof String) {
dom.setPassengerPython((String) passengerpython);
dom.setPassengerpython((String) passengerpython);
}
final Object passengernodejs = setParams.get("passengernodejs");
if (passengernodejs != null && passengernodejs instanceof String) {
dom.setPassengerNodejs((String) passengernodejs);
dom.setPassengernodejs((String) passengernodejs);
}
final Object passengerruby = setParams.get("passengerruby");
if (passengerruby != null && passengerruby instanceof String) {
dom.setPassengerRuby((String) passengerruby);
dom.setPassengerruby((String) passengerruby);
}
final Object fcgiphpbin = setParams.get("fcgiphpbin");
if (fcgiphpbin != null && fcgiphpbin instanceof String) {
dom.setFcgiPhpBin((String) fcgiphpbin);
dom.setFcgiphpbin((String) fcgiphpbin);
}
}

View File

@ -121,10 +121,10 @@ public class JsonPillarServlet extends HttpServlet {
domainadmins.add(domUserName);
final Pac domPac = domUser.getPac();
final String validSubdomainNames = dom.getValidsubdomainnames();
final String passengerPython = dom.getPassengerPython();
final String passengerNodejs = dom.getPassengerNodejs();
final String passengerRuby = dom.getPassengerRuby();
final String fcgiPhpBin = dom.getFcgiPhpBin();
final String passengerPython = dom.getPassengerpython();
final String passengerNodejs = dom.getPassengernodejs();
final String passengerRuby = dom.getPassengerruby();
final String fcgiPhpBin = dom.getFcgiphpbin();
final INetAddress domINetAddr = domPac.getCurINetAddr();
writer.println(" \"domain\": \"" + domName + "\"");
writer.println(" , \"pac\": \"" + domPac.getName() + "\"");

View File

@ -207,35 +207,35 @@ public class Domain extends AbstractEntity {
this.validsubdomainnames = validSubdomainNames;
}
public String getPassengerPython() {
public String getPassengerpython() {
return passengerpython;
}
public void setPassengerPython(String value) {
public void setPassengerpython(String value) {
this.passengerpython = value;
}
public String getPassengerNodejs() {
public String getPassengernodejs() {
return passengernodejs;
}
public void setPassengerNodejs(String value) {
public void setPassengernodejs(String value) {
this.passengernodejs = value;
}
public String getPassengerRuby() {
public String getPassengerruby() {
return passengerruby;
}
public void setPassengerRuby(String value) {
public void setPassengerruby(String value) {
this.passengerruby = value;
}
public String getFcgiPhpBin() {
public String getFcgiphpbin() {
return fcgiphpbin;
}
public void setFcgiPhpBin(String value) {
public void setFcgiphpbin(String value) {
this.fcgiphpbin = value;
}