ModeShape Distribution 3.0.0.Alpha6

org.modeshape.jcr.cache.change
Class RecordingChanges

java.lang.Object
  extended by org.modeshape.jcr.cache.change.RecordingChanges
All Implemented Interfaces:
Serializable, Iterable<Change>, Changes, ChangeSet

@ThreadSafe
public class RecordingChanges
extends Object
implements Changes, ChangeSet

A thread-safe Changes implementation that records the changes and makes them available for iteration.

See Also:
Serialized Form

Constructor Summary
RecordingChanges(String processKey, String repositoryKey)
           
RecordingChanges(String processKey, String repositoryKey, String workspaceName)
           
 
Method Summary
 void binaryValueNoLongerUsed(BinaryKey key)
          Create an event that signals that the (stored) binary value with the supplied key is no longer used.
 Set<NodeKey> changedNodes()
           
 void freeze(String userId, Map<String,String> userData, DateTime timestamp)
           
 String getProcessKey()
          Get the key of the process in which the changes were made.
 String getRepositoryKey()
          Get the key of the repository in which the changes were made.
 DateTime getTimestamp()
           
 Map<String,String> getUserData()
           
 String getUserId()
           
 String getWorkspaceName()
          Get the name of the workspace in which the changes were made.
 Iterator<Change> iterator()
          Returns an iterator over the elements in this queue in proper sequence.
 void nodeChanged(NodeKey key, Path path)
          Create an event signifying that something about the node (other than the properties or location) changed.
 void nodeCreated(NodeKey key, NodeKey parentKey, Path path, Map<Name,Property> properties)
           
 void nodeMoved(NodeKey key, NodeKey newParent, NodeKey oldParent, Path newPath, Path oldPath)
           
 void nodeRemoved(NodeKey key, NodeKey parentKey, Path path)
           
 void nodeRenamed(NodeKey key, Path newPath, Path.Segment oldName)
           
 void nodeReordered(NodeKey key, NodeKey parent, Path newPath, Path oldPath, Path reorderedBeforePath)
           
 void nodeSequenced(NodeKey sequencedNodeKey, Path sequencedNodePath, NodeKey outputNodeKey, Path outputNodePath, String outputPath, String userId, String selectedPath, String sequencerName)
           
 void nodeSequencingFailure(NodeKey sequencedNodeKey, Path sequencedNodePath, String outputPath, String userId, String selectedPath, String sequencerName, Throwable cause)
           
 void propertyAdded(NodeKey key, Path nodePath, Property property)
           
 void propertyChanged(NodeKey key, Path nodePath, Property newProperty, Property oldProperty)
           
 void propertyRemoved(NodeKey key, Path nodePath, Property property)
           
 void setChangedNodes(Set<NodeKey> keys)
           
 int size()
          Return the number of individual changes.
 String toString()
           
 void workspaceAdded(String workspaceName)
           
 void workspaceRemoved(String workspaceName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RecordingChanges

public RecordingChanges(String processKey,
                        String repositoryKey)

RecordingChanges

public RecordingChanges(String processKey,
                        String repositoryKey,
                        String workspaceName)
Method Detail

workspaceAdded

public void workspaceAdded(String workspaceName)
Specified by:
workspaceAdded in interface Changes

workspaceRemoved

public void workspaceRemoved(String workspaceName)
Specified by:
workspaceRemoved in interface Changes

nodeCreated

public void nodeCreated(NodeKey key,
                        NodeKey parentKey,
                        Path path,
                        Map<Name,Property> properties)
Specified by:
nodeCreated in interface Changes

nodeRemoved

public void nodeRemoved(NodeKey key,
                        NodeKey parentKey,
                        Path path)
Specified by:
nodeRemoved in interface Changes

nodeRenamed

public void nodeRenamed(NodeKey key,
                        Path newPath,
                        Path.Segment oldName)
Specified by:
nodeRenamed in interface Changes

nodeMoved

public void nodeMoved(NodeKey key,
                      NodeKey newParent,
                      NodeKey oldParent,
                      Path newPath,
                      Path oldPath)
Specified by:
nodeMoved in interface Changes

nodeReordered

public void nodeReordered(NodeKey key,
                          NodeKey parent,
                          Path newPath,
                          Path oldPath,
                          Path reorderedBeforePath)
Specified by:
nodeReordered in interface Changes

nodeChanged

public void nodeChanged(NodeKey key,
                        Path path)
Description copied from interface: Changes
Create an event signifying that something about the node (other than the properties or location) changed.

Specified by:
nodeChanged in interface Changes
Parameters:
key - the node key; may not be null
path - the path

nodeSequenced

public void nodeSequenced(NodeKey sequencedNodeKey,
                          Path sequencedNodePath,
                          NodeKey outputNodeKey,
                          Path outputNodePath,
                          String outputPath,
                          String userId,
                          String selectedPath,
                          String sequencerName)
Specified by:
nodeSequenced in interface Changes

nodeSequencingFailure

public void nodeSequencingFailure(NodeKey sequencedNodeKey,
                                  Path sequencedNodePath,
                                  String outputPath,
                                  String userId,
                                  String selectedPath,
                                  String sequencerName,
                                  Throwable cause)
Specified by:
nodeSequencingFailure in interface Changes

propertyAdded

public void propertyAdded(NodeKey key,
                          Path nodePath,
                          Property property)
Specified by:
propertyAdded in interface Changes

propertyRemoved

public void propertyRemoved(NodeKey key,
                            Path nodePath,
                            Property property)
Specified by:
propertyRemoved in interface Changes

propertyChanged

public void propertyChanged(NodeKey key,
                            Path nodePath,
                            Property newProperty,
                            Property oldProperty)
Specified by:
propertyChanged in interface Changes

binaryValueNoLongerUsed

public void binaryValueNoLongerUsed(BinaryKey key)
Description copied from interface: Changes
Create an event that signals that the (stored) binary value with the supplied key is no longer used.

Specified by:
binaryValueNoLongerUsed in interface Changes
Parameters:
key - the key for the now-unused binary value; may not be null

size

public int size()
Description copied from interface: ChangeSet
Return the number of individual changes.

Specified by:
size in interface ChangeSet
Returns:
the number of changes

iterator

public Iterator<Change> iterator()
Returns an iterator over the elements in this queue in proper sequence. The returned iterator is a "weakly consistent" iterator that will never throw ConcurrentModificationException, and guarantees to traverse elements as they existed upon construction of the iterator, and may (but is not guaranteed to) reflect any modifications subsequent to construction.

Specified by:
iterator in interface Iterable<Change>
Returns:
an iterator over the elements in this queue in proper sequence; never null
See Also:
Iterable.iterator()

changedNodes

public Set<NodeKey> changedNodes()
Specified by:
changedNodes in interface ChangeSet

setChangedNodes

public void setChangedNodes(Set<NodeKey> keys)

freeze

public void freeze(String userId,
                   Map<String,String> userData,
                   DateTime timestamp)

getProcessKey

public String getProcessKey()
Description copied from interface: ChangeSet
Get the key of the process in which the changes were made.

Specified by:
getProcessKey in interface ChangeSet
Returns:
the process key; never null

getRepositoryKey

public String getRepositoryKey()
Description copied from interface: ChangeSet
Get the key of the repository in which the changes were made.

Specified by:
getRepositoryKey in interface ChangeSet
Returns:
the repository key; never null

getWorkspaceName

public String getWorkspaceName()
Description copied from interface: ChangeSet
Get the name of the workspace in which the changes were made.

Specified by:
getWorkspaceName in interface ChangeSet
Returns:
the workspace name; may be null only when workspaces are added or removed

getTimestamp

public DateTime getTimestamp()
Specified by:
getTimestamp in interface ChangeSet

getUserData

public Map<String,String> getUserData()
Specified by:
getUserData in interface ChangeSet

getUserId

public String getUserId()
Specified by:
getUserId in interface ChangeSet

toString

public String toString()
Overrides:
toString in class Object

ModeShape Distribution 3.0.0.Alpha6

Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.