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 TypeMethodDescriptionboolean
isAssignable
(VmDefinition vmDef) Checks if the given VM belongs to the pool and is not in use.boolean
Checks if is defined.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
setDefined
(boolean defined) Sets if is.void
Sets the name.void
setPermissions
(List<VmDefinition.Grant> permissions) Sets the permissions.void
setRetention
(String retention) Sets the retention.toString()
To string.vms()
Returns the VM names.
-
Constructor Details
-
VmPool
Instantiates a new vm pool.- Parameters:
name
- the name
-
-
Method Details
-
name
Returns the name.- Returns:
- the name
-
setName
Sets the name.- Parameters:
name
- the name to set
-
isDefined
Checks if is defined.- Returns:
- the result
-
setDefined
Sets if is.- Parameters:
defined
- the defined to set
-
retention
Gets the retention.- Returns:
- the retention
-
setRetention
Sets the retention.- Parameters:
retention
- the retention to set
-
permissions
Permissions granted for a VM from the pool.- Returns:
- the permissions
-
setPermissions
Sets the permissions.- Parameters:
permissions
- the permissions to set
-
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.
-