So auto login according to pool setting.

This commit is contained in:
Michael Lipp 2025-03-03 21:26:10 +01:00
parent 701194799f
commit dfe3038463
5 changed files with 36 additions and 34 deletions

View file

@ -37,8 +37,9 @@ import org.jdrupes.vmoperator.util.DataPath;
@SuppressWarnings({ "PMD.DataClass" })
public class VmPool {
private String name;
private final String name;
private String retention;
private boolean loginOnAssignment;
private boolean defined;
private List<Grant> permissions = Collections.emptyList();
private final Set<String> vms
@ -53,6 +54,19 @@ public class VmPool {
this.name = name;
}
/**
* Fill the properties of a provisionally created pool from
* the definition.
*
* @param definition the definition
*/
public void defineFrom(VmPool definition) {
retention = definition.retention();
permissions = definition.permissions();
loginOnAssignment = definition.loginOnAssignment();
defined = true;
}
/**
* Returns the name.
*
@ -63,12 +77,12 @@ public class VmPool {
}
/**
* Sets the name.
* Checks if is login on assignment.
*
* @param name the name to set
* @return the loginOnAssignment
*/
public void setName(String name) {
this.name = name;
public boolean loginOnAssignment() {
return loginOnAssignment;
}
/**
@ -81,12 +95,10 @@ public class VmPool {
}
/**
* Sets if is.
*
* @param defined the defined to set
* Marks the pool as undefined.
*/
public void setDefined(boolean defined) {
this.defined = defined;
public void setUndefined() {
defined = false;
}
/**
@ -98,15 +110,6 @@ public class VmPool {
return retention;
}
/**
* Sets the retention.
*
* @param retention the retention to set
*/
public void setRetention(String retention) {
this.retention = retention;
}
/**
* Permissions granted for a VM from the pool.
*
@ -116,15 +119,6 @@ public class VmPool {
return permissions;
}
/**
* Sets the permissions.
*
* @param permissions the permissions to set
*/
public void setPermissions(List<Grant> permissions) {
this.permissions = permissions;
}
/**
* Returns the VM names.
*