Class SharedTomcat
- java.lang.Object
-
- com.aoindustries.aoserv.client.AOServObject<K,T>
-
- com.aoindustries.aoserv.client.CachedObject<Integer,V>
-
- com.aoindustries.aoserv.client.CachedObjectIntegerKey<SharedTomcat>
-
- com.aoindustries.aoserv.client.web.tomcat.SharedTomcat
-
- All Implemented Interfaces:
Streamable,StreamReadable,StreamWritable,Row,AOServReadable,AOServStreamable,AOServWritable,Disablable,Removable,SingleTableObject<Integer,SharedTomcat>
public final class SharedTomcat extends CachedObjectIntegerKey<SharedTomcat> implements Disablable, Removable
AnHttpdSharedTomcatstores configuration information about the Jakarta Tomcat JVM under which run one or moreHttpdTomcatSharedSites.- Author:
- AO Industries, Inc.
- See Also:
SharedTomcatSite,Site
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MAX_POST_SIZEThe default setting of maxPostSize on the <Connector /> in server.xml.static StringDEFAULT_TOMCAT_VERSION_PREFIXstatic intMAX_NAME_LENGTH-
Fields inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
pkey
-
Fields inherited from class com.aoindustries.aoserv.client.CachedObject
table
-
Fields inherited from class com.aoindustries.aoserv.client.AOServObject
USE_ARRAY_OF_DOMAIN, USE_SQL_DATA, USE_SQL_DATA_WRITE
-
-
Constructor Summary
Constructors Constructor Description SharedTomcat()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDisable()booleancanEnable()voiddisable(DisableLog dl)voidenable()booleangetAutoDeploy()Gets theautoDeploysetting for this Tomcat.List<CannotRemoveReason<SharedTomcatSite>>getCannotRemoveReasons()Lists the reasons an object may not be removed.protected ObjectgetColumnImpl(int i)DisableLoggetDisableLog()List<SharedTomcatSite>getHttpdTomcatSharedSites()VersiongetHttpdTomcatVersion()PosixPathgetInstallDirectory()ServergetLinuxServer()UserServergetLinuxServerAccount()intgetLinuxServerAccount_pkey()GroupServergetLinuxServerGroup()intgetLinuxServerGroup_pkey()intgetMaxPostSize()Gets the max post size or-1of not limited.StringgetName()Table.TableIDgetTableID()StringgetTomcat4ShutdownKey()BindgetTomcat4ShutdownPort()WorkergetTomcat4Worker()booleangetTomcatAuthentication()Gets thetomcatAuthenticationsetting for this Tomcat.booleangetUnpackWARs()Gets theunpackWARssetting for this Tomcat.voidinit(ResultSet result)Initializes this object from the raw database contents.booleanisDisabled()Checks if this object is disabled.booleanisManual()static booleanisValidSharedTomcatName(String name)Checks the format of the name of the shared Tomcat, as used in the/wwwgroupdirectory.voidread(StreamableInput in, AoservProtocol.Version protocolVersion)readImpl method comment.voidremove()Removes this object, and all dependant objects, from the system.voidsetAutoDeploy(boolean autoDeploy)voidsetHttpdTomcatVersion(Version version)voidsetIsManual(boolean isManual)voidsetMaxPostSize(int maxPostSize)voidsetTomcatAuthentication(boolean tomcatAuthentication)voidsetUnpackWARs(boolean unpackWARs)StringtoStringImpl()AOServObject.toString()implementation that is allowed to throw exceptions.voidwrite(StreamableOutput out, AoservProtocol.Version protocolVersion)-
Methods inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
equals, getKey, getPkey, hashCode
-
Methods inherited from class com.aoindustries.aoserv.client.CachedObject
getTable, setTable
-
Methods inherited from class com.aoindustries.aoserv.client.AOServObject
compare, compare, compare, compare, compareIgnoreCaseConsistentWithEquals, compareTo, compareTo, compareTo, getAccountingCode, getColumn, getColumns, getColumns, getDomainLabel, getDomainLabels, getDomainName, getDto, getEmail, getGecos, getGroupId, getHashedKey, getHashedPassword, getHostname, getInetAddress, getLinuxID, getLinuxUserName, getMacAddress, getMySQLDatabaseName, getMySQLServerName, getMysqlUserName, getPort, getPostgresDatabaseName, getPostgresServerName, getPostgresUserId, getTableSchema, getTimeMillis, getTimeMillis, getUnixPath, getUserId, read, toString, write
-
-
-
-
Field Detail
-
DEFAULT_MAX_POST_SIZE
public static final int DEFAULT_MAX_POST_SIZE
The default setting of maxPostSize on the <Connector /> in server.xml. This raises the value from the Tomcat default of 2 MiB to a more real-world value, such as allowing uploads of pictures from modern digital cameras.- See Also:
getMaxPostSize(), Constant Field Values
-
MAX_NAME_LENGTH
public static final int MAX_NAME_LENGTH
- See Also:
- Constant Field Values
-
DEFAULT_TOMCAT_VERSION_PREFIX
public static final String DEFAULT_TOMCAT_VERSION_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
canDisable
public boolean canDisable()
- Specified by:
canDisablein interfaceDisablable
-
canEnable
public boolean canEnable() throws SQLException, IOException- Specified by:
canEnablein interfaceDisablable- Throws:
SQLExceptionIOException
-
getCannotRemoveReasons
public List<CannotRemoveReason<SharedTomcatSite>> getCannotRemoveReasons() throws SQLException, IOException
Description copied from interface:RemovableLists the reasons an object may not be removed.- Specified by:
getCannotRemoveReasonsin interfaceRemovable- Returns:
- an empty
List<CannotRemoveReason>if this object may be removed, or a list of descriptions - Throws:
SQLExceptionIOException
-
disable
public void disable(DisableLog dl) throws IOException, SQLException
- Specified by:
disablein interfaceDisablable- Throws:
IOExceptionSQLException
-
enable
public void enable() throws IOException, SQLException- Specified by:
enablein interfaceDisablable- Throws:
IOExceptionSQLException
-
getInstallDirectory
public PosixPath getInstallDirectory() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getColumnImpl
protected Object getColumnImpl(int i)
- Specified by:
getColumnImplin classAOServObject<Integer,SharedTomcat>
-
isDisabled
public boolean isDisabled()
Description copied from interface:DisablableChecks if this object is disabled. This should execute very quickly (not incur any round-trip to any database) and thus does not throw any checked exceptions.- Specified by:
isDisabledin interfaceDisablable
-
getDisableLog
public DisableLog getDisableLog() throws SQLException, IOException
- Specified by:
getDisableLogin interfaceDisablable- Throws:
SQLExceptionIOException
-
getHttpdTomcatSharedSites
public List<SharedTomcatSite> getHttpdTomcatSharedSites() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getHttpdTomcatVersion
public Version getHttpdTomcatVersion() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
setHttpdTomcatVersion
public void setHttpdTomcatVersion(Version version) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getLinuxServerAccount_pkey
public int getLinuxServerAccount_pkey()
-
getLinuxServerAccount
public UserServer getLinuxServerAccount() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getLinuxServerGroup_pkey
public int getLinuxServerGroup_pkey()
-
getLinuxServerGroup
public GroupServer getLinuxServerGroup() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getName
public String getName()
-
getLinuxServer
public Server getLinuxServer() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getTableID
public Table.TableID getTableID()
- Specified by:
getTableIDin classAOServObject<Integer,SharedTomcat>
-
getTomcat4Worker
public Worker getTomcat4Worker() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getTomcat4ShutdownKey
public String getTomcat4ShutdownKey()
-
getTomcat4ShutdownPort
public Bind getTomcat4ShutdownPort() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
init
public void init(ResultSet result) throws SQLException
Description copied from class:AOServObjectInitializes this object from the raw database contents.- Specified by:
initin classAOServObject<Integer,SharedTomcat>- Parameters:
result- theResultSetcontaining the row to copy into this object- Throws:
SQLException
-
isManual
public boolean isManual()
-
setIsManual
public void setIsManual(boolean isManual) throws IOException, SQLException- Throws:
IOExceptionSQLException
-
getMaxPostSize
public int getMaxPostSize()
Gets the max post size or-1of not limited.
-
setMaxPostSize
public void setMaxPostSize(int maxPostSize) throws IOException, SQLException- Throws:
IOExceptionSQLException
-
getUnpackWARs
public boolean getUnpackWARs()
Gets theunpackWARssetting for this Tomcat.
-
setUnpackWARs
public void setUnpackWARs(boolean unpackWARs) throws IOException, SQLException- Throws:
IOExceptionSQLException
-
getAutoDeploy
public boolean getAutoDeploy()
Gets theautoDeploysetting for this Tomcat.
-
setAutoDeploy
public void setAutoDeploy(boolean autoDeploy) throws IOException, SQLException- Throws:
IOExceptionSQLException
-
getTomcatAuthentication
public boolean getTomcatAuthentication()
Gets thetomcatAuthenticationsetting for this Tomcat.
-
setTomcatAuthentication
public void setTomcatAuthentication(boolean tomcatAuthentication) throws IOException, SQLException- Throws:
IOExceptionSQLException
-
isValidSharedTomcatName
public static boolean isValidSharedTomcatName(String name)
Checks the format of the name of the shared Tomcat, as used in the/wwwgroupdirectory. The name must be 12 characters or less, and comprised of onlya-z,0-9, or-. The first character must bea-z.Note: This matches the check constraint on the httpd_shared_tomcats table. Note: This matches keepWwwgroupDirs in HttpdSharedTomcatManager.
// TODO: Self-validating type (Shared site Site.Name validator, and/or PosixPortableFilename?)
-
read
public void read(StreamableInput in, AoservProtocol.Version protocolVersion) throws IOException
readImpl method comment.- Specified by:
readin interfaceAOServReadable- Specified by:
readin interfaceAOServStreamable- Specified by:
readin classAOServObject<Integer,SharedTomcat>- Throws:
IOException
-
remove
public void remove() throws IOException, SQLExceptionDescription copied from interface:RemovableRemoves this object, and all dependant objects, from the system.- Specified by:
removein interfaceRemovable- Throws:
IOExceptionSQLException
-
toStringImpl
public String toStringImpl() throws SQLException, IOException
Description copied from class:AOServObjectAOServObject.toString()implementation that is allowed to throw exceptions.Implementation Note:
This default implementation callsAOServObject.toString()on the key (fromAOServObject.getKey()). When the key isnull, uses the default implementation fromObject.toString().- Overrides:
toStringImplin classCachedObjectIntegerKey<SharedTomcat>- Throws:
SQLExceptionIOException
-
write
public void write(StreamableOutput out, AoservProtocol.Version protocolVersion) throws IOException
- Specified by:
writein interfaceAOServStreamable- Specified by:
writein interfaceAOServWritable- Specified by:
writein classAOServObject<Integer,SharedTomcat>- Throws:
IOException
-
-