Class VmPool

java.lang.Object
org.jdrupes.vmoperator.common.VmPool

public class VmPool extends Object
Represents a VM pool.
  • Constructor Details

    • VmPool

      public VmPool(String name)
      Instantiates a new vm pool.
      Parameters:
      name - the name
  • Method Details

    • defineFrom

      public void defineFrom(VmPool definition)
      Fill the properties of a provisionally created pool from the definition.
      Parameters:
      definition - the definition
    • name

      public String name()
      Returns the name.
      Returns:
      the name
    • loginOnAssignment

      public boolean loginOnAssignment()
      Checks if is login on assignment.
      Returns:
      the loginOnAssignment
    • isDefined

      public boolean isDefined()
      Checks if is defined.
      Returns:
      the result
    • setUndefined

      public void setUndefined()
      Marks the pool as undefined.
    • retention

      public String retention()
      Gets the retention.
      Returns:
      the retention
    • permissions

      Permissions granted for a VM from the pool.
      Returns:
      the permissions
    • vms

      public Set<String> vms()
      Returns the VM names.
      Returns:
      the vms
    • permissionsFor

      Collect all permissions for the given user with the given roles.
      Parameters:
      user - the user
      roles - the roles
      Returns:
      the sets the
    • isAssignable

      public boolean isAssignable(VmDefinition vmDef)
      Checks if the given VM belongs to the pool and is not in use.
      Parameters:
      vmDef - the vm def
      Returns:
      true, if is assignable
    • retainUntil

      public Instant retainUntil(Instant lastUsed)
      Return the instant until which an assignment should be retained.
      Parameters:
      lastUsed - the last used
      Returns:
      the instant
    • toString

      public String toString()
      To string.
      Overrides:
      toString in class Object
      Returns:
      the string