|
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.SystemContent
public class SystemContent
Field Summary | |
---|---|
static String |
GENERATED_PREFIX
|
protected static Pattern |
GENERATED_PREFIX_PATTERN
|
Method Summary | |
---|---|
protected Iterable<?> |
all(CachedNode node,
Name propertyName)
|
SessionCache |
cache()
|
void |
cleanUpLocks(Set<String> activeSessionIds)
Clean up the locks within the repository's system content. |
protected Object |
first(CachedNode node,
Name propertyName)
|
protected Object |
first(CachedNode node,
Name propertyName,
Object defaultValue)
|
boolean |
hasVersionHistory(NodeKey versionableNodeKey)
|
protected MutableCachedNode |
initializeVersionStorage(NodeKey versionableNodeKey,
NodeKey versionHistoryKey,
NodeKey versionKey,
Name primaryTypeName,
Set<Name> mixinTypeNames,
Path versionHistoryPath,
NodeKey originalVersionKey,
DateTime now)
Create and initialize the version history structure for a versionable node with the supplied UUID. |
protected NodeKey |
keyForNamespaceUri(String namespaceUri)
|
NodeKey |
locksKey()
|
CachedNode |
locksNode()
|
MutableCachedNode |
mutableLocksNode()
|
MutableCachedNode |
mutableNamespacesNode()
|
MutableCachedNode |
mutableNodeTypesNode()
|
MutableCachedNode |
mutableVersionStorageNode()
|
NodeKey |
namespacesKey()
|
CachedNode |
namespacesNode()
|
protected Name |
nextNameForVersionNode(CachedNode historyNode,
Property predecessors,
ChildReferences historyChildren)
Compute the name for the next version node in the given history. |
NodeKey |
nodeTypesKey()
|
CachedNode |
nodeTypesNode()
|
protected int |
propertyType(Object value)
|
Collection<NamespaceRegistry.Namespace> |
readAllNamespaces()
|
List<NodeTypeDefinition> |
readAllNodeTypes()
Read from system storage all of the node type definitions. |
protected NodeDefinition |
readChildNodeDefinition(CachedNode childDefn)
|
String |
readNamespacePrefix(String namespaceUri,
boolean generateIfMissing)
|
NodeTypeDefinition |
readNodeTypeDefinition(CachedNode nodeType)
|
List<NodeTypeDefinition> |
readNodeTypes(Set<Name> nodeTypesToRefresh)
Read from system storage the node type definitions with the supplied names. |
protected PropertyDefinition |
readPropertyDefinition(CachedNode propDefn)
|
MutableCachedNode |
recordNewVersion(CachedNode versionableNode,
SessionCache cacheForVersionableNode,
Path versionHistoryPath,
NodeKey originalVersionKey,
Collection<Property> versionableProperties,
DateTime now,
AtomicReference<MutableCachedNode> frozenNodeOutput)
The method efficiently updates the JCR version history and storage with a new version of a node being checked in. |
Set<String> |
registerNamespaces(Map<String,String> newUrisByPrefix)
|
void |
save()
|
void |
store(Iterable<org.modeshape.jcr.JcrNodeType> nodeTypes,
boolean updateExisting)
Stores the node types in the system area under /jcr:system/jcr:nodeTypes . |
void |
store(org.modeshape.jcr.JcrNodeType nodeType,
boolean updateExisting)
Stores the node type in the system area under /jcr:system/jcr:nodeTypes . |
NodeKey |
systemKey()
|
CachedNode |
systemNode()
|
boolean |
unregisterNamespace(String namespaceUri)
|
NodeKey |
versionHistoryNodeKeyFor(NodeKey versionableNodeKey)
|
NodeKey |
versionStorageKey()
|
CachedNode |
versionStorageNode()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String GENERATED_PREFIX
protected static final Pattern GENERATED_PREFIX_PATTERN
Method Detail |
---|
public void save()
public final SessionCache cache()
public NodeKey systemKey()
public NodeKey nodeTypesKey()
public NodeKey namespacesKey()
public NodeKey locksKey()
public NodeKey versionStorageKey()
public CachedNode systemNode()
public CachedNode nodeTypesNode()
public CachedNode namespacesNode()
public CachedNode locksNode()
public CachedNode versionStorageNode()
public MutableCachedNode mutableNodeTypesNode()
public MutableCachedNode mutableNamespacesNode()
public MutableCachedNode mutableLocksNode()
public MutableCachedNode mutableVersionStorageNode()
public void store(Iterable<org.modeshape.jcr.JcrNodeType> nodeTypes, boolean updateExisting)
/jcr:system/jcr:nodeTypes
.
For each node type, a node is created with primary type of nt:nodeType
and a name that corresponds to the node
type's name. All other properties and child nodes for the newly created node are added in a manner consistent with the
guidance provided in section 6.7.22 of the JCR 1.0 specification and section 4.7.24 of the JCR 2.0 specification where
possible.
nodeTypes
- the node types to write out; may not be nullupdateExisting
- a boolean flag denoting whether the new node type definition should be overwrite an existing node
type definitionpublic void store(org.modeshape.jcr.JcrNodeType nodeType, boolean updateExisting)
/jcr:system/jcr:nodeTypes
.
The stored content will contain a node with a primary type of nt:nodeType
and a name that corresponds to the
node type's name. All other properties and child nodes for the newly created node are added in a manner consistent with the
guidance provided in section 6.7.22 of the JCR 1.0 specification and section 4.7.24 of the JCR 2.0 specification where
possible.
nodeType
- the node type to write; may not be nullupdateExisting
- a boolean flag denoting whether the new node type definition should be overwrite an existing node
type definitionpublic List<NodeTypeDefinition> readNodeTypes(Set<Name> nodeTypesToRefresh)
nodeTypesToRefresh
-
public List<NodeTypeDefinition> readAllNodeTypes()
public NodeTypeDefinition readNodeTypeDefinition(CachedNode nodeType)
protected PropertyDefinition readPropertyDefinition(CachedNode propDefn) throws ConstraintViolationException
ConstraintViolationException
protected NodeDefinition readChildNodeDefinition(CachedNode childDefn) throws ConstraintViolationException
ConstraintViolationException
protected final int propertyType(Object value)
protected final Iterable<?> all(CachedNode node, Name propertyName)
protected final Object first(CachedNode node, Name propertyName)
protected final Object first(CachedNode node, Name propertyName, Object defaultValue)
public Collection<NamespaceRegistry.Namespace> readAllNamespaces()
public Set<String> registerNamespaces(Map<String,String> newUrisByPrefix)
public String readNamespacePrefix(String namespaceUri, boolean generateIfMissing)
public boolean unregisterNamespace(String namespaceUri)
protected final NodeKey keyForNamespaceUri(String namespaceUri)
public void cleanUpLocks(Set<String> activeSessionIds)
activeSessionIds
- the IDs of the sessions that are still active in this repositorypublic NodeKey versionHistoryNodeKeyFor(NodeKey versionableNodeKey)
public boolean hasVersionHistory(NodeKey versionableNodeKey)
protected MutableCachedNode initializeVersionStorage(NodeKey versionableNodeKey, NodeKey versionHistoryKey, NodeKey versionKey, Name primaryTypeName, Set<Name> mixinTypeNames, Path versionHistoryPath, NodeKey originalVersionKey, DateTime now)
Given a NodeKey for a node that has an identifier part of "fae2b929-c5ef-4ce5-9fa1-514779ca0ae3", the SHA-1 hash of this identifier part is "b46dde8905f76361779339fa3ccacc4f47664255". The path to the version history for this node is as follows:
+ jcr:system + jcr:versionStorage {jcr:primaryType = mode:versionStorage} + b4 {jcr:primaryType = mode:versionHistoryFolder} + 6d {jcr:primaryType = mode:versionHistoryFolder} + de {jcr:primaryType = mode:versionHistoryFolder} + 298905f76361779339fa3ccacc4f47664255 {jcr:primaryType = nt:versionHistory} + jcr:versionLabels {jcr:primaryType = nt:versionLabels} + jcr:rootVersion {jcr:primaryType = nt:version} - jcr:uuid = ... - jcr:created = ... + jcr:frozenNode {jcr:primaryType = nt:frozenNode} - jcr:frozenUuid - jcr:frozenPrimaryType - jcr:frozenMixinTypesNote that the path between "/jcr:system/jcr:versionStorage" and the "nt:versionHistory" node is shown as being
hiearchical
.
versionableNodeKey
- the identifier of the versionable node for which the history is to be created; may not be nullversionHistoryKey
- the key to the version history node; may not be nullversionKey
- the key to be used for the initial version; may be null if the key should be generatedprimaryTypeName
- the name of the primary type of the versionable node; may not be nullmixinTypeNames
- the names of the mixin types for the versionable node; may be null or emptyversionHistoryPath
- the path of the version history node; may not be nulloriginalVersionKey
- the key of the original node from which the new versionable node was copied; may be nullnow
- the current date time; may not be null
public MutableCachedNode recordNewVersion(CachedNode versionableNode, SessionCache cacheForVersionableNode, Path versionHistoryPath, NodeKey originalVersionKey, Collection<Property> versionableProperties, DateTime now, AtomicReference<MutableCachedNode> frozenNodeOutput)
Note that this method will initialize the version history for the node if the version history does not already exist.
The names of the different versions has changed since 2.x, and now follows the same convention and algorithm as used in the
reference implementation. See
nextNameForVersionNode(org.modeshape.jcr.cache.CachedNode, org.modeshape.jcr.value.Property, org.modeshape.jcr.cache.ChildReferences)
for details.
versionableNode
- the versionable node for which a new version is to be created in the node's version history; may not
be nullcacheForVersionableNode
- the cache used to access the versionable node and any descendants; may not be nullversionHistoryPath
- the path of the version history node; may not be nulloriginalVersionKey
- the key of the original node from which the new versionable node was copied; may be nullversionableProperties
- the versionable node's properties that should be record in the version history (on the frozen
node); may be null or emptynow
- the current date time; may not be nullfrozenNodeOutput
- the reference that should be set upon successful completion to the frozen node created under the
new version; may not be null
protected Name nextNameForVersionNode(CachedNode historyNode, Property predecessors, ChildReferences historyChildren)
The basic rules are as follows:
jcr:rootVersion | | 1.0 2.0 | 1.1 | 1.2 ---\ ------\ | \ \ 1.3 1.2.0 1.2.0.0 | | 1.4 1.2.1 ----\ | | \ 1.5 1.2.2 1.2.1.0 | | | 1.6 | 1.2.1.1 |------/ 1.7
historyNode
- predecessors
- the 'jcr:predecessors' property; may not be nullhistoryChildren
- the child references under the version history for the node
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |