Package com.orchestranetworks.instance
Class HomeKey
java.lang.Object
com.orchestranetworks.instance.HomeKey
- Direct Known Subclasses:
BranchKey,VersionKey
Abstract superclass for dataspace and snapshot identifiers.
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanstatic final BranchKeyforBranchName(String aName) Returns the dataspace identifier with the specified name.final Stringformat()Returns a persistent identifier of a dataspace or snapshot.static final VersionKeyforVersionName(String aName) Returns the snapshot identifier with the specified name.final StringgetName()Returns the string associated with this key.final inthashCode()abstract booleanisBranch()Returnstrueif this key identifies a dataspace.final booleanReturnstrueif this key identifies a snapshot.static final HomeKeyParses the specified string, so as to return either a dataspace or snapshot key.final StringtoDisplayString(Locale aLocale) Returns a user-friendly string that specifies the type of this key, for example, "Dataspace <name>" or "Snapshot <name>".final StringtoString()
-
Field Details
-
MAX_KEY_LENGTH
public static final int MAX_KEY_LENGTHMaximum length of a dataspace or snapshot key: 32.- See Also:
-
KEY_PATTERN
Regular expression that controls the syntax of a dataspace or snapshot key. The regular expression is:"[a-zA-Z0-9_:.\\-\\|]*"
- See Also:
-
KEY_PATTERN_COMPILED
The compiled representation of a dataspace or a snapshot key.- Since:
- 6.0.0
- See Also:
-
-
Method Details
-
forBranchName
Returns the dataspace identifier with the specified name. -
forVersionName
Returns the snapshot identifier with the specified name. -
parse
Parses the specified string, so as to return either a dataspace or snapshot key.The specified string must have been generated by
format().- Parameters:
aString- specified string- Throws:
IllegalArgumentException- If specified string :- is undefined,
- is empty,
- has an illegal prefix character.
- See Also:
-
isBranch
public abstract boolean isBranch()Returnstrueif this key identifies a dataspace. -
isVersion
public final boolean isVersion()Returnstrueif this key identifies a snapshot. -
getName
Returns the string associated with this key.Since the dataspace namespace and the snapshot namespace are independent, the returned string is only an identifier in the context of one of the namespaces. For a global dataspace or snapshot identifier, the method
format()must be used.- See Also:
-
format
Returns a persistent identifier of a dataspace or snapshot.Compared to the method
getName(), this identifier additionally specifies whether this key is for a dataspace or a snapshot.- See Also:
-
equals
-
hashCode
public final int hashCode() -
toDisplayString
Returns a user-friendly string that specifies the type of this key, for example, "Dataspace <name>" or "Snapshot <name>". -
toString
-