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
Fields 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 boolean
int
static void
void
run
(int minute, int hour, int dayOfMonth, int month, int dayOfWeek, int year) Rotates PostgreSQL log files.static void
start()
static void
static void
stopPostgresql
(Server ps) static void
Methods inherited from class com.aoindustries.aoserv.daemon.util.BuilderThread
getMaximumDelay, getMinimumDelay, getProcessTimerMaximumTime, getProcessTimerReminderInterval, getProcessTimerSubject, getRandomDelay, packageListUpdated, tableUpdated, waitForBuild
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.aoapps.cron.CronJob
getExecutor, getName, getScheduleMode
-
Field Details
-
pgsqlDirectory
-
-
Method Details
-
doRebuild
protected boolean doRebuild()- Specified by:
doRebuild
in classBuilderThread
- Returns:
true
if successful orfalse
if unsuccessful and needs to be retried.
-
start
- Throws:
IOException
SQLException
-
waitForRebuild
public static void waitForRebuild() -
getProcessTimerDescription
- Specified by:
getProcessTimerDescription
in classBuilderThread
-
restartPostgresql
- Throws:
IOException
SQLException
-
startPostgresql
- Throws:
IOException
SQLException
-
stopPostgresql
- Throws:
IOException
SQLException
-
getSchedule
- Specified by:
getSchedule
in interfaceCronJob
-
getThreadPriority
public int getThreadPriority()- Specified by:
getThreadPriority
in 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.
-