|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@Beta public interface GroupNamingConvention
jclouds needs to understand the difference between resources it creates and those supplied by the user. For example, if jclouds creates a security group, it should be able to delete this as a part of cleanup without accidentally deleting resources the user specified manually.
ComputeService#createNodesInGroup
Typically, a security group or network is something shared across all members
of a group, so the name should be concise, yet unique.
# can sometimes break apis.
As such, you may end preferring always using a hyphen.
- followed by the group name. The jclouds prefix
signifies this resource is safe to delete, and the hash clearly delineates
the encoding from what's in the group name.
mycluster, the naming convention for
shared resources would produce jclouds-mycluster
mycluster, the naming convention for
unique resources could produce jclouds-mycluster-f3e the first time,
and jclouds-mycluster-e64 the next.
IllegalStateException is
thrown when attempting to create a named resource which already exists.
However, if you attempt to create a resource with a name generated by
GroupNamingConvention, and receive an IllegalStateException,
it may have been for another reason besides name conflict.
| Nested Class Summary | |
|---|---|
static interface |
GroupNamingConvention.Factory
|
| Method Summary | |
|---|---|
com.google.common.base.Predicate<String> |
containsAnyGroup()
A predicate that identifies if an input has any group encoded in it. |
com.google.common.base.Predicate<String> |
containsGroup(String group)
A predicate that identifies if an input has the given group encoded in it. |
String |
extractGroup(String encoded)
Extracts the group from a shared/unique name. |
String |
groupInSharedNameOrNull(String encoded)
retrieve the group associated with the encoded name |
String |
groupInUniqueNameOrNull(String encoded)
retrieve the group associated with the encoded name |
String |
sharedNameForGroup(String group)
encodes the {code group parameter} into a name that exists only once in the group. |
String |
uniqueNameForGroup(String group)
encodes the {code group parameter} into a name that exists more than once in the group. |
| Method Detail |
|---|
String sharedNameForGroup(String group)
String uniqueNameForGroup(String group)
@Nullable String groupInUniqueNameOrNull(String encoded)
@Nullable String groupInSharedNameOrNull(String encoded)
com.google.common.base.Predicate<String> containsGroup(String group)
com.google.common.base.Predicate<String> containsAnyGroup()
String extractGroup(String encoded)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||