com.aoindustries.aoserv.client.web.jboss.SiteTable Maven / Gradle / Ivy
/*
* aoserv-client - Java client for the AOServ Platform.
* Copyright (C) 2001-2013, 2016, 2017, 2018, 2019, 2020 AO Industries, Inc.
* [email protected]
* 7262 Bull Pen Cir
* Mobile, AL 36695
*
* This file is part of aoserv-client.
*
* aoserv-client is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* aoserv-client is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with aoserv-client. If not, see .
*/
package com.aoindustries.aoserv.client.web.jboss;
import com.aoindustries.aoserv.client.AOServConnector;
import com.aoindustries.aoserv.client.CachedTableIntegerKey;
import com.aoindustries.aoserv.client.aosh.AOSH;
import com.aoindustries.aoserv.client.aosh.Command;
import com.aoindustries.aoserv.client.billing.Package;
import com.aoindustries.aoserv.client.linux.Group;
import com.aoindustries.aoserv.client.linux.Server;
import com.aoindustries.aoserv.client.linux.User;
import com.aoindustries.aoserv.client.net.Bind;
import com.aoindustries.aoserv.client.net.IpAddress;
import com.aoindustries.aoserv.client.schema.AoservProtocol;
import com.aoindustries.aoserv.client.schema.Table;
import com.aoindustries.collections.IntList;
import com.aoindustries.io.TerminalWriter;
import com.aoindustries.io.stream.StreamableInput;
import com.aoindustries.io.stream.StreamableOutput;
import com.aoindustries.net.DomainName;
import com.aoindustries.net.Email;
import java.io.IOException;
import java.io.Reader;
import java.sql.SQLException;
import java.util.List;
/**
* @see Site
*
* @author AO Industries, Inc.
*/
final public class SiteTable extends CachedTableIntegerKey {
SiteTable(AOServConnector connector) {
super(connector, Site.class);
}
private static final OrderBy[] defaultOrderBy = {
new OrderBy(Site.COLUMN_TOMCAT_SITE_name+'.'+com.aoindustries.aoserv.client.web.tomcat.Site.COLUMN_HTTPD_SITE_name+'.'+com.aoindustries.aoserv.client.web.Site.COLUMN_NAME_name, ASCENDING),
new OrderBy(Site.COLUMN_TOMCAT_SITE_name+'.'+com.aoindustries.aoserv.client.web.tomcat.Site.COLUMN_HTTPD_SITE_name+'.'+com.aoindustries.aoserv.client.web.Site.COLUMN_AO_SERVER_name+'.'+Server.COLUMN_HOSTNAME_name, ASCENDING)
};
@Override
protected OrderBy[] getDefaultOrderBy() {
return defaultOrderBy;
}
public int addHttpdJBossSite(
final Server aoServer,
final String siteName,
final Package packageObj,
final User siteUser,
final Group siteGroup,
final Email serverAdmin,
final boolean useApache,
final IpAddress ipAddress,
final DomainName primaryHttpHostname,
final DomainName[] altHttpHostnames,
final Version jBossVersion
) throws IOException, SQLException {
return connector.requestResult(
true,
AoservProtocol.CommandID.ADD,
new AOServConnector.ResultRequest() {
int pkey;
IntList invalidateList;
@Override
public void writeRequest(StreamableOutput out) throws IOException {
out.writeCompressedInt(Table.TableID.HTTPD_JBOSS_SITES.ordinal());
out.writeCompressedInt(aoServer.getPkey());
out.writeUTF(siteName);
out.writeUTF(packageObj.getName().toString());
out.writeUTF(siteUser.getUsername_id().toString());
out.writeUTF(siteGroup.getName().toString());
out.writeUTF(serverAdmin.toString());
out.writeBoolean(useApache);
out.writeCompressedInt(ipAddress==null?-1:ipAddress.getPkey());
out.writeUTF(primaryHttpHostname.toString());
out.writeCompressedInt(altHttpHostnames.length);
for(int c=0;c cached=getRows();
int size=cached.size();
for(int c=0;c cached=getRows();
int size=cached.size();
for(int c=0;c cached=getRows();
int size=cached.size();
for(int c=0;c cached=getRows();
int size=cached.size();
for(int c=0;c cached=getRows();
int size=cached.size();
for(int c=0;c
© 2015 - 2025 Weber Informatics LLC | Privacy Policy