Don't duplicate pool management.
This commit is contained in:
parent
76be59a5b3
commit
9b47ad3136
3 changed files with 26 additions and 10 deletions
|
|
@ -30,9 +30,21 @@ import org.jgrapes.core.Event;
|
|||
@SuppressWarnings("PMD.DataClass")
|
||||
public class GetPools extends Event<List<VmPool>> {
|
||||
|
||||
private String name;
|
||||
private String user;
|
||||
private List<String> roles = Collections.emptyList();
|
||||
|
||||
/**
|
||||
* Return only the pool with the given name.
|
||||
*
|
||||
* @param name the name
|
||||
* @return the returns the vms
|
||||
*/
|
||||
public GetPools withName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return only {@link VmPool}s that are accessible by
|
||||
* the given user or roles.
|
||||
|
|
@ -47,6 +59,15 @@ public class GetPools extends Event<List<VmPool>> {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name filter criterion, if set.
|
||||
*
|
||||
* @return the optional
|
||||
*/
|
||||
public Optional<String> name() {
|
||||
return Optional.ofNullable(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the user filter criterion, if set.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue