Package org.jdrupes.vmoperator.common
Class VmPool
java.lang.Object
org.jdrupes.vmoperator.common.VmPool
Represents a VM pool.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
defineFrom
(VmPool definition) Fill the properties of a provisionally created pool from the definition.boolean
isAssignable
(VmDefinition vmDef) Checks if the given VM belongs to the pool and is not in use.boolean
Checks if is defined.boolean
Checks if is login on assignment.name()
Returns the name.Permissions granted for a VM from the pool.permissionsFor
(String user, Collection<String> roles) Collect all permissions for the given user with the given roles.retainUntil
(Instant lastUsed) Return the instant until which an assignment should be retained.Gets the retention.void
Marks the pool as undefined.toString()
To string.vms()
Returns the VM names.
-
Constructor Details
-
VmPool
Instantiates a new vm pool.- Parameters:
name
- the name
-
-
Method Details
-
defineFrom
Fill the properties of a provisionally created pool from the definition.- Parameters:
definition
- the definition
-
name
Returns the name.- Returns:
- the name
-
loginOnAssignment
Checks if is login on assignment.- Returns:
- the loginOnAssignment
-
isDefined
Checks if is defined.- Returns:
- the result
-
setUndefined
Marks the pool as undefined. -
retention
Gets the retention.- Returns:
- the retention
-
permissions
Permissions granted for a VM from the pool.- Returns:
- the permissions
-
vms
Returns the VM names.- Returns:
- the vms
-
permissionsFor
Collect all permissions for the given user with the given roles.- Parameters:
user
- the userroles
- the roles- Returns:
- the sets the
-
isAssignable
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
Return the instant until which an assignment should be retained.- Parameters:
lastUsed
- the last used- Returns:
- the instant
-
toString
To string.
-