public class FabricRequirements extends Object
| Constructor and Description |
|---|
FabricRequirements() |
FabricRequirements(List<ProfileRequirements> profileRequirements) |
| Modifier and Type | Method and Description |
|---|---|
void |
addOrUpdateProfileRequirements(ProfileRequirements requirement) |
ProfileRequirements |
findProfileRequirements(String profile) |
ProfileRequirements |
getOrCreateProfileRequirement(String profile)
Returns or creates a new
ProfileRequirements for the given profile id |
List<ProfileRequirements> |
getProfileRequirements() |
SshConfiguration |
getSshConfiguration() |
Map<String,SshHostConfiguration> |
getSshHostsMap() |
String |
getVersion()
Returns the current version for the fabric which the requirements apply to (usually the latest version,
as scaling requirements typically are independent of rolling upgrades and versioning).
|
boolean |
hasMinimumInstances(String profileId)
Returns true if there are any requirements for the given profile ID and it has at least 1 minimum instances defined
|
ProfileRequirements |
profile(String profileId)
Returns the requirements for the given profile; lazily creating requirements if none exist yet.
|
void |
removeEmptyRequirements()
Removes all the empty requirements; usually used just before saving to JSON
|
boolean |
removeProfileRequirements(String profile) |
void |
setProfileRequirements(List<ProfileRequirements> profileRequirements) |
void |
setSshConfiguration(SshConfiguration sshConfiguration) |
void |
setVersion(String version) |
protected void |
sortProfilesRequirements() |
SshConfiguration |
sshConfiguration()
Returns the ssh configuration; lazily creating one if it does not exist yet
|
SshHostConfiguration |
sshHost(String hostAlias)
Looks up and lazily creates if required a SSH host configuration for the given host alias.
|
String |
toString() |
public FabricRequirements()
public FabricRequirements(List<ProfileRequirements> profileRequirements)
public List<ProfileRequirements> getProfileRequirements()
public void setProfileRequirements(List<ProfileRequirements> profileRequirements)
public String getVersion()
public void setVersion(String version)
public SshConfiguration getSshConfiguration()
public void setSshConfiguration(SshConfiguration sshConfiguration)
public Map<String,SshHostConfiguration> getSshHostsMap()
public ProfileRequirements getOrCreateProfileRequirement(String profile)
ProfileRequirements for the given profile idpublic ProfileRequirements findProfileRequirements(String profile)
public boolean removeProfileRequirements(String profile)
public void addOrUpdateProfileRequirements(ProfileRequirements requirement)
protected void sortProfilesRequirements()
public void removeEmptyRequirements()
public boolean hasMinimumInstances(String profileId)
public SshHostConfiguration sshHost(String hostAlias)
public ProfileRequirements profile(String profileId)
public SshConfiguration sshConfiguration()
Copyright © 2011–2014 Red Hat. All rights reserved.