public class CloudMachineNamer
extends java.lang.Object
Constructor and Description |
---|
CloudMachineNamer(ConfigBag setup) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
generateNewGroupId() |
java.lang.String |
generateNewMachineUniqueName() |
java.lang.String |
generateNewMachineUniqueNameFromGroupId(java.lang.String groupId) |
java.lang.Integer |
getCustomMaxNameLength()
method for overriding to provide custom logic when an explicit config key is not set
|
int |
getMaxNameLength()
returns the max length of a VM name for the cloud specified in setup;
this value is typically decremented by 9 to make room for jclouds labels;
delegates to
getCustomMaxNameLength() when
CloudLocationConfig.VM_NAME_MAX_LENGTH is not set |
CloudMachineNamer |
lengthMaxPermittedForMachineName(int defaultMaxLength) |
CloudMachineNamer |
lengthReservedForNameInGroup(int identifierRequiredLength)
number of chars to use or reserve for the machine identifier when constructing a group identifier;
defaults to 9, e.g.
|
static java.lang.String |
sanitize(java.lang.String s) |
public CloudMachineNamer(ConfigBag setup)
public java.lang.String generateNewMachineUniqueName()
public java.lang.String generateNewMachineUniqueNameFromGroupId(java.lang.String groupId)
public java.lang.String generateNewGroupId()
public int getMaxNameLength()
getCustomMaxNameLength()
when
CloudLocationConfig.VM_NAME_MAX_LENGTH
is not setpublic CloudMachineNamer lengthMaxPermittedForMachineName(int defaultMaxLength)
public CloudMachineNamer lengthReservedForNameInGroup(int identifierRequiredLength)
public java.lang.Integer getCustomMaxNameLength()
public static java.lang.String sanitize(java.lang.String s)