Class PostgresServerManager
java.lang.Object
com.aoindustries.aoserv.daemon.util.BuilderThread
com.aoindustries.aoserv.daemon.postgres.PostgresServerManager
- All Implemented Interfaces:
CronJob,TableListener,PackageManager.PackageListener
Controls the PostgreSQL servers.
- Author:
- AO Industries, Inc.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.aoapps.cron.CronJob
CronJob.Executor, CronJob.ScheduleMode -
Field Summary
FieldsFields inherited from class com.aoindustries.aoserv.daemon.util.BuilderThread
DEFAULT_MAXIMUM_DELAY, DEFAULT_MINIMUM_DELAY, DEFAULT_PROCESS_TIMER_MAXIMUM_TIME, DEFAULT_PROCESS_TIMER_REMINDER_INTERVAL -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanintstatic voidvoidrun(int minute, int hour, int dayOfMonth, int month, int dayOfWeek, int year) Rotates PostgreSQL log files.static voidstart()static voidstatic voidstopPostgresql(Server ps) static voidMethods inherited from class com.aoindustries.aoserv.daemon.util.BuilderThread
getMaximumDelay, getMinimumDelay, getProcessTimerMaximumTime, getProcessTimerReminderInterval, getProcessTimerSubject, getRandomDelay, packageListUpdated, tableUpdated, waitForBuildMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.aoapps.cron.CronJob
getExecutor, getName, getScheduleMode
-
Field Details
-
pgsqlDirectory
-
-
Method Details
-
doRebuild
protected boolean doRebuild()- Specified by:
doRebuildin classBuilderThread- Returns:
trueif successful orfalseif unsuccessful and needs to be retried.
-
start
- Throws:
IOExceptionSQLException
-
waitForRebuild
public static void waitForRebuild() -
getProcessTimerDescription
- Specified by:
getProcessTimerDescriptionin classBuilderThread
-
restartPostgresql
- Throws:
IOExceptionSQLException
-
startPostgresql
- Throws:
IOExceptionSQLException
-
stopPostgresql
- Throws:
IOExceptionSQLException
-
getSchedule
- Specified by:
getSchedulein interfaceCronJob
-
getThreadPriority
public int getThreadPriority()- Specified by:
getThreadPriorityin interfaceCronJob
-
run
public void run(int minute, int hour, int dayOfMonth, int month, int dayOfWeek, int year) Rotates PostgreSQL log files. Those older than one month are removed.TODO: Should use standard log file rotation, so configuration still works if aoserv-daemon disabled or removed.
-
