Class Database.MaintenanceSchedule

java.lang.Object
com.github.cowwoc.digitalocean.resource.Database.MaintenanceSchedule
Enclosing class:
Database

public static final class Database.MaintenanceSchedule extends Object
The schedule for when maintenance activities may be performed on the cluster.
  • Constructor Details

    • MaintenanceSchedule

      public MaintenanceSchedule(DigitalOceanClient client, OffsetTime hour, DayOfWeek day, boolean pending, List<String> descriptions)
      Creates a new schedule.
      Parameters:
      client - the client configuration
      hour - the start hour when maintenance may take place
      day - the day of the week when maintenance may take place
      pending - determines whether any maintenance is scheduled to be performed in the next maintenance window
      descriptions - a list of strings, each containing information about a pending maintenance update
      Throws:
      NullPointerException - if any of the arguments are null
      IllegalArgumentException - if:
      • one of the descriptions contains leading or trailing whitespace or is empty.
      • hour contains a non-zero minute, second or nano component.
  • Method Details

    • hour

      public OffsetTime hour()
      Returns the start hour when maintenance may take place.
      Returns:
      the hour
    • day

      public DayOfWeek day()
      Returns the day of the week when maintenance may take place.
      Returns:
      the day
    • isPending

      public boolean isPending()
      Determines whether any maintenance is scheduled to be performed in the next maintenance window.
      Returns:
      true if maintenance is scheduled
    • getDescriptions

      public List<String> getDescriptions()
      Returns a list of strings, each containing information about a pending maintenance update.
      Returns:
      information about a pending maintenance update
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • forCreator

      Converts this object to a type that is accepted by DatabaseCreator.
      Returns:
      the DatabaseCreator.MaintenanceSchedule