|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.jcr.cache.NodeKey
@Immutable public final class NodeKey
An immutable unique key for a node within the repository
's database
.
A node key consists of three parts:
This class contains methods for
Field Summary | |
---|---|
protected static int |
SOURCE_LENGTH
|
protected static int |
WORKSPACE_LENGTH
|
Constructor Summary | |
---|---|
NodeKey(String key)
Reconstitute a node key from the supplied string. |
|
NodeKey(String sourceKey,
String workspaceKey,
String identifier)
Reconstitute a node key from the supplied source key, workspace key, and node identifier. |
Method Summary | |
---|---|
int |
compareTo(NodeKey that)
|
boolean |
equals(Object obj)
|
String |
getIdentifier()
Get the multi-character key representing the JCR identifier of a node, which is usually a UUID. |
String |
getIdentifierHash()
Get the SHA-1 hash of the identifier . |
String |
getSourceKey()
Get the multi-character key uniquely identifying the repository's storage source in which this node appears. |
String |
getWorkspaceKey()
Get the multi-character key uniquely identifying the workspace in which the node appears. |
int |
hashCode()
|
static boolean |
isValidFormat(String key)
Determine if the supplied string may be a valid identifier. |
static String |
keyForSourceName(String name)
|
static String |
keyForWorkspaceName(String name)
|
String |
toString()
|
NodeKey |
withId(String identifier)
|
NodeKey |
withRandomId()
|
NodeKey |
withRandomIdAndWorkspace(String workspaceKey)
|
NodeKey |
withSourceKeyAndId(String sourceKey,
String identifier)
|
NodeKey |
withWorkspaceKey(String workspaceKey)
|
NodeKey |
withWorkspaceKeyAndId(String workspaceKey,
String identifier)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final int SOURCE_LENGTH
protected static final int WORKSPACE_LENGTH
Constructor Detail |
---|
public NodeKey(String key)
key
- the string representation of the key; may not be nullpublic NodeKey(String sourceKey, String workspaceKey, String identifier)
sourceKey
- the source key; may not be null and must be 4 charactersworkspaceKey
- the workspace key; may not be null and must be 4 charactersidentifier
- the node identifier; may not be null and must be at least 1 characterMethod Detail |
---|
public static boolean isValidFormat(String key)
key
-
public String getSourceKey()
public String getWorkspaceKey()
public String getIdentifier()
public String getIdentifierHash()
identifier
.
public int compareTo(NodeKey that)
compareTo
in interface Comparable<NodeKey>
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String toString()
toString
in class Object
public NodeKey withRandomId()
public NodeKey withRandomIdAndWorkspace(String workspaceKey)
public NodeKey withId(String identifier)
public NodeKey withWorkspaceKey(String workspaceKey)
public NodeKey withWorkspaceKeyAndId(String workspaceKey, String identifier)
public NodeKey withSourceKeyAndId(String sourceKey, String identifier)
public static String keyForSourceName(String name)
public static String keyForWorkspaceName(String name)
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |