Package org.bgerp.app.dist

# Class Maintenance

java.lang.Object
org.bgerp.app.dist.Maintenance

public class Maintenance extends Object
Maintenance application' state. Blocking logging in and logging off users before the app's restart.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Maintenance`
  `cancel()`
  Cancels maintenance.
  `LocalDateTime`
  `getLogoffTime()`
  `LocalDateTime`
  `getStartTime()`
  `User`
  `getUser()`
  `static Maintenance`
  `instance()`
  `static Maintenance`
  `start(User user, Duration logoffDelay)`
  Starts maintenance.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### instance

    public static Maintenance instance()
    Returns:
      the current maintenance instance or `null`, if its missing.

  - ### start

    public static Maintenance start(User user, Duration logoffDelay)
    Starts maintenance.
    Parameters:
      `user` - the user.
      `logoffDelay` - delay before logging users off.
    Returns:
      the created maintenance instance.
    Throws:
      `IllegalStateException` - if maintenance is already running.

  - ### cancel

    public static Maintenance cancel()
    Cancels maintenance.
    Returns:
      the cancelled maintenance instance.

  - ### getUser

    public User getUser()

  - ### getStartTime

    public LocalDateTime getStartTime()

  - ### getLogoffTime

    public LocalDateTime getLogoffTime()