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

    • name

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

      public void setName(String name)
      Sets the name.
      Parameters:
      name - the name to set
    • isDefined

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

      public void setDefined(boolean defined)
      Sets if is.
      Parameters:
      defined - the defined to set
    • retention

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

      public void setRetention(String retention)
      Sets the retention.
      Parameters:
      retention - the retention to set
    • permissions

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

      public void setPermissions(List<VmDefinition.Grant> permissions)
      Sets the permissions.
      Parameters:
      permissions - the permissions to set
    • 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