Interface ServerCleanupManager

    • Method Detail

      • setCleanupStartCron

        void setCleanupStartCron​(@NotNull
                                 String cronExpression)
                          throws CronParseException
        Sets cleanup start time
        Parameters:
        cronExpression - cleanup start time cron expression
        Throws:
        CronParseException
      • setCleanupEnabled

        void setCleanupEnabled​(boolean enabled)
        Enables or disables periodical cleanup. If enabled, cleanup will start at specified start time. If start time is not specified, cleanup will start at 03:00
        Parameters:
        enabled - is periodical cleanup enabled
      • isCleanupEnabled

        boolean isCleanupEnabled()
        Returns:
        true if cleanup is enabled
      • setMaxCleanupDuration

        void setMaxCleanupDuration​(int durationMins)
        Sets maximum allowed cleanup duration in minutes. Note that in fact cleanup can take a bit more time than specified in this setting, this is because cleanup operation can't be interrupted at any time.
        Parameters:
        durationMins - max cleanup duration in minutes, 0 or negative value will disable cleanup duration check
      • getMaxCleanupDuration

        int getMaxCleanupDuration()
        Returns:
        max cleanup duration in minutes
      • getCleanupStartCron

        @NotNull
        CronScheduler getCleanupStartCron()
        Returns cleanup start time cron scheduler.
      • getCleanupStartTime

        @NotNull
        Date getCleanupStartTime()
      • getCleanupState

        @NotNull
        CleanupProcessStateEx getCleanupState()
        Returns:
        details about last (current or finished) server cleanup.
      • stopCleanup

        void stopCleanup​(@Nullable
                         SUser userPerformingAction)
        Stops cleanup.
        Parameters:
        userPerformingAction - user who performs this action, or null if action is performed by system
      • isCleanupCanBeStarted

        boolean isCleanupCanBeStarted()
        Returns true if cleanup can be started (if startCleanup() method can be invoked)
        Returns:
        see above
      • executeWithInactiveCleanup

        boolean executeWithInactiveCleanup​(@NotNull
                                           Runnable runnable,
                                           boolean waitTillCleanupFinished)
        Executes specified runnable if cleanup is not running a critical section. Cleanup will not start a critical data modification section while runnable is executing. If parameter waitTillFinished is true the method will wait till cleanup is finished.
        Parameters:
        runnable - runnable to execute
        waitTillCleanupFinished - true to wait till cleanup finishes
        Returns:
        true if runnable was executed
      • isRunningCriticalSection

        boolean isRunningCriticalSection()
        Determines whether the server is running a critical data modification section (like compacting the database).
        Returns:
        see above
        Since:
        9.0
        See Also:
        executeWithInactiveCleanup(Runnable, boolean)
      • getConfigErrors

        @NotNull
        ConfigurationErrors getConfigErrors()
        Returns configuration errors object that holds such errors that make impossible the cleaning of removed projects and build configurations.
        Since:
        2021.1