Tabnine Logo
RecordingChanges
Code IndexAdd Tabnine to your IDE (free)

How to use
RecordingChanges
in
org.modeshape.jcr.cache.change

Best Java code snippets using org.modeshape.jcr.cache.change.RecordingChanges (Showing top 20 results out of 315)

origin: org.fcrepo/modeshape-jcr

protected final RecordingChanges changesFor( String workspaceName ) {
  RecordingChanges changes = changesByWorkspace.get(workspaceName);
  if (changes == null) {
    changes = new RecordingChanges(sessionId, processId, repositoryKey, workspaceName, journalId);
    changesByWorkspace.put(workspaceName, changes);
  }
  return changes;
}
origin: org.fcrepo/modeshape-jcr

@Override
public void nodeRenamed( NodeKey key,
             Path newPath,
             Segment oldName,
             Name primaryType,
             Set<Name> mixinTypes ) {
  events.add(new NodeRenamed(key, newPath, oldName, filterName(primaryType), filterNameSet(mixinTypes)));
}
origin: ModeShape/modeshape

@Override
public String toString() {
  StringBuilder sb = new StringBuilder();
  sb.append("Save by '").append(getUserId()).append("' at ").append(getTimestamp()).append(" with user data = ")
   .append(userData).append(" in repository with key '").append(repositoryKey).append("' and workspace '")
   .append(workspaceName);
  if (journalId != null) {
    sb.append(". Journal id=").append(journalId);
  }
  sb.append("'\n");
  for (Change change : this) {
    sb.append("  ").append(change).append("\n");
  }
  sb.append("changed ").append(nodeKeys.size()).append(" nodes:\n");
  for (NodeKey key : nodeKeys) {
    sb.append("  ").append(key).append("\n");
  }
  return sb.toString();
}
origin: ModeShape/modeshape

String workspaceName = persistedCache.getWorkspaceName();
String repositoryKey = persistedCache.getRepositoryKey();
RecordingChanges changes = new RecordingChanges(context.getId(), context.getProcessId(), repositoryKey, workspaceName,
                        repositoryEnvironment.journalId());
      changes.nodeRemoved(key, parentKey, path, primaryType, mixinTypes, parentPrimaryType, parentMixinTypes);
      removedNodes.add(key);
      if (isUnorderedCollection) {
      changes.nodeCreated(key, newParent, newPath, primaryType, mixinTypes, node.changedProperties());
    } else {
      doc = documentStore.edit(keyStr, true);
        boolean isSameWorkspace = persistedCache.getWorkspaceKey().equalsIgnoreCase(workspaceKey);
        if (isSameWorkspace) {
          changes.nodeMoved(key, primaryType, mixinTypes, newParent, oldParentKey, newPath, oldPath);
          changes.propertyAdded(key, primaryType, mixinTypes, newPath, newProperty);
        } else if (newProperty == null) {
          changes.propertyRemoved(key, primaryType, mixinTypes, newPath, oldProperty);
        } else {
          changes.propertyChanged(key, primaryType, mixinTypes, newPath, newProperty, oldProperty);
          changes.propertyRemoved(key, primaryType, mixinTypes, newPath, oldProperty);
          changes.propertyAdded(key, primaryType, mixinTypes, newPath, prop);
          changes.propertyChanged(key, primaryType, mixinTypes, newPath, prop, oldProperty);
          hasPropertyChanges = true;
origin: ModeShape/modeshape

public final void setAccessControlEnabled( boolean enabled ) {
  if (this.accessControlEnabled.compareAndSet(!enabled, enabled)) {
    refreshRepositoryMetadata(true);
    // And notify the others ...
    String userId = context.getSecurityContext().getUserName();
    Map<String, String> userData = context.getData();
    DateTime timestamp = context.getValueFactories().getDateFactory().create();
    RecordingChanges changes = new RecordingChanges(context.getId(), context.getProcessId(), this.getKey(), null,
                            repositoryEnvironment.journalId());
    changes.repositoryMetadataChanged();
    changes.freeze(userId, userData, timestamp);
    this.changeBus.notify(changes);
  }
}
origin: ModeShape/modeshape

private void fireSequencingEvent( AbstractJcrNode sequencedNode,
                 List<AbstractJcrNode> outputNodes,
                 JcrSession outputSession,
                 String sequencerName ) throws RepositoryException {
  final ExecutionContext context = outputSession.context();
  RecordingChanges sequencingChanges = new RecordingChanges(outputSession.sessionId(), context.getProcessId(),
                               outputSession.getRepository().repositoryKey(),
                               outputSession.workspaceName(), outputSession.getRepository()
                                                     .journalId());
  Name primaryType = sequencedNode.getPrimaryTypeName();
  Set<Name> mixinTypes = sequencedNode.getMixinTypeNames();
  for (AbstractJcrNode outputNode : outputNodes) {
    sequencingChanges.nodeSequenced(sequencedNode.key(), sequencedNode.path(), primaryType, mixinTypes, outputNode.key(),
                    outputNode.path(), work.getOutputPath(), work.getUserId(), work.getSelectedPath(),
                    sequencerName);
  }
  sequencingChanges.freeze(outputSession.getUserID(), null, context.getValueFactories().getDateFactory().create());
  repository.changeBus().notify(sequencingChanges);
}
origin: org.fcrepo/modeshape-jcr

Map<String, String> userData = context.getData();
DateTime timestamp = context.getValueFactories().getDateFactory().create();
RecordingChanges changes = new RecordingChanges(context.getId(), context.getProcessId(), this.getKey(), null,
                        repositoryEnvironment.journalId());
changes.workspaceAdded(name);
changes.freeze(userId, userData, timestamp);
this.changeBus.notify(changes);
origin: org.fcrepo/modeshape-jcr

Map<String, String> userData = context.getData();
DateTime timestamp = context.getValueFactories().getDateFactory().create();
RecordingChanges changes = new RecordingChanges(context.getId(), context.getProcessId(), this.getKey(), null,
                        repositoryEnvironment.journalId());
changes.workspaceRemoved(name);
changes.freeze(userId, userData, timestamp);
this.changeBus.notify(changes);
return true;
origin: ModeShape/modeshape

  changesFor(wsAndOldPath.getWorkspaceName()).nodeRemoved(key, oldParentKey, wsAndOldPath.getPath(), primaryType,
                              mixinTypes, null, null);
  changesFor(wsAndNewPath.getWorkspaceName()).nodeCreated(key, newParentKey, wsAndNewPath.getPath(), primaryType,
                              mixinTypes, properties);
  changesFor(newWorkspace).nodeMoved(key, primaryType, mixinTypes, newParentKey, oldParentKey,
                    newWsAndPath.getPath(), oldWsAndPath.getPath());
  return;
changesFor(oldWsAndPath.getWorkspaceName()).nodeRemoved(key, oldParentKey, oldWsAndPath.getPath(), primaryType,
                            mixinTypes, null, null);
changesFor(newWsAndPath.getWorkspaceName()).nodeCreated(key, newParentKey, newWsAndPath.getPath(), primaryType,
                            mixinTypes, properties);
return;
  if (newWorkspace.equals(oldWorkspace)) {
    found = true;
    changesFor(newWorkspace).nodeMoved(key, primaryType, mixinTypes, newParentKey, oldParentKey,
                      wsAndNewPath.getPath(), wsAndOldPath.getPath());
  changesFor(wsAndNewPath).nodeCreated(key, newParentKey, wsAndNewPath.getPath(), primaryType, mixinTypes,
                     properties);
changesFor(oldWsAndPath).nodeRemoved(key, oldParentKey, oldWsAndPath.getPath(), primaryType, mixinTypes,
                   null, null);
origin: org.fcrepo/modeshape-jcr

private void fireSequencingFailureEvent( AbstractJcrNode sequencedNode,
                     JcrSession inputSession,
                     Throwable cause,
                     String sequencerName ) throws RepositoryException {
  assert sequencedNode != null;
  assert inputSession != null;
  Name primaryType = sequencedNode.getPrimaryTypeName();
  Set<Name> mixinTypes = sequencedNode.getMixinTypeNames();
  final ExecutionContext context = inputSession.context();
  RecordingChanges sequencingChanges = new RecordingChanges(inputSession.sessionId(), context.getProcessId(),
                               inputSession.getRepository().repositoryKey(),
                               inputSession.workspaceName(), inputSession.getRepository()
                                                    .journalId());
  sequencingChanges.nodeSequencingFailure(sequencedNode.key(), sequencedNode.path(), primaryType, mixinTypes,
                      work.getOutputPath(), work.getUserId(), work.getSelectedPath(), sequencerName,
                      cause);
  repository.changeBus().notify(sequencingChanges);
}
origin: org.fcrepo/modeshape-jcr

@Override
public void publish( Map<String, String> data ) {
  DateTime now = timeFactory.create();
  if (data == null) data = Collections.emptyMap();
  // Freeze and then notify the bus of each change set of a given workspace ...
  for (RecordingChanges changes : changesByWorkspace.values()) {
    changes.freeze(connectorSourceName, data, now);
    bus.notify(changes);
  }
  changesByWorkspace.clear();
}
origin: org.fcrepo/modeshape-jcr

  private Set<Name> filterNameSet( Set<Name> input ) {
    Set<Name> result = new HashSet<Name>(input.size());
    for (Name name : input) {
      result.add(filterName(name));
    }
    return result;
  }
}
origin: org.fcrepo/modeshape-jcr

@Override
public void nodeCreated( String docId,
             String parentDocId,
             String path,
             Name primaryType,
             Set<Name> mixinTypes,
             Map<Name, Property> properties ) {
  NodeKey key = nodeKey(docId);
  NodeKey parentKey = nodeKey(parentDocId);
  Path externalPath = pathMappings.getPathFactory().create(path);
  // This external path in the connector may be projected into *multiple* nodes in the same or different workspaces ...
  for (WorkspaceAndPath wsAndPath : pathMappings.resolveExternalPathToInternal(externalPath)) {
    changesFor(wsAndPath).nodeCreated(key, parentKey, wsAndPath.getPath(), primaryType, mixinTypes, properties);
  }
}
origin: org.fcrepo/modeshape-jcr

String workspaceName = persistedCache.getWorkspaceName();
String repositoryKey = persistedCache.getRepositoryKey();
RecordingChanges changes = new RecordingChanges(context.getId(), context.getProcessId(), repositoryKey, workspaceName,
                        repositoryEnvironment.journalId());
      changes.nodeRemoved(key, parentKey, path, primaryType, mixinTypes, parentPrimaryType, parentMixinTypes);
      removedNodes.add(key);
      if (isUnorderedCollection) {
      changes.nodeCreated(key, newParent, newPath, primaryType, mixinTypes, node.changedProperties());
    } else {
      doc = documentStore.edit(keyStr, true);
        boolean isSameWorkspace = persistedCache.getWorkspaceKey().equalsIgnoreCase(workspaceKey);
        if (isSameWorkspace) {
          changes.nodeMoved(key, primaryType, mixinTypes, newParent, oldParentKey, newPath, oldPath);
          changes.propertyAdded(key, primaryType, mixinTypes, newPath, newProperty);
        } else if (newProperty == null) {
          changes.propertyRemoved(key, primaryType, mixinTypes, newPath, oldProperty);
        } else {
          changes.propertyChanged(key, primaryType, mixinTypes, newPath, newProperty, oldProperty);
          changes.propertyRemoved(key, primaryType, mixinTypes, newPath, oldProperty);
          changes.propertyAdded(key, primaryType, mixinTypes, newPath, prop);
          changes.propertyChanged(key, primaryType, mixinTypes, newPath, prop, oldProperty);
          hasPropertyChanges = true;
origin: org.fcrepo/modeshape-jcr

public final void setAccessControlEnabled( boolean enabled ) {
  if (this.accessControlEnabled.compareAndSet(!enabled, enabled)) {
    refreshRepositoryMetadata(true);
    // And notify the others ...
    String userId = context.getSecurityContext().getUserName();
    Map<String, String> userData = context.getData();
    DateTime timestamp = context.getValueFactories().getDateFactory().create();
    RecordingChanges changes = new RecordingChanges(context.getId(), context.getProcessId(), this.getKey(), null,
                            repositoryEnvironment.journalId());
    changes.repositoryMetadataChanged();
    changes.freeze(userId, userData, timestamp);
    this.changeBus.notify(changes);
  }
}
origin: org.fcrepo/modeshape-jcr

private void fireSequencingEvent( AbstractJcrNode sequencedNode,
                 List<AbstractJcrNode> outputNodes,
                 JcrSession outputSession,
                 String sequencerName ) throws RepositoryException {
  final ExecutionContext context = outputSession.context();
  RecordingChanges sequencingChanges = new RecordingChanges(outputSession.sessionId(), context.getProcessId(),
                               outputSession.getRepository().repositoryKey(),
                               outputSession.workspaceName(), outputSession.getRepository()
                                                     .journalId());
  Name primaryType = sequencedNode.getPrimaryTypeName();
  Set<Name> mixinTypes = sequencedNode.getMixinTypeNames();
  for (AbstractJcrNode outputNode : outputNodes) {
    sequencingChanges.nodeSequenced(sequencedNode.key(), sequencedNode.path(), primaryType, mixinTypes, outputNode.key(),
                    outputNode.path(), work.getOutputPath(), work.getUserId(), work.getSelectedPath(),
                    sequencerName);
  }
  sequencingChanges.freeze(outputSession.getUserID(), null, context.getValueFactories().getDateFactory().create());
  repository.changeBus().notify(sequencingChanges);
}
origin: ModeShape/modeshape

Map<String, String> userData = context.getData();
DateTime timestamp = context.getValueFactories().getDateFactory().create();
RecordingChanges changes = new RecordingChanges(context.getId(), context.getProcessId(), this.getKey(), null,
                        repositoryEnvironment.journalId());
changes.workspaceAdded(name);
changes.freeze(userId, userData, timestamp);
this.changeBus.notify(changes);
origin: ModeShape/modeshape

Map<String, String> userData = context.getData();
DateTime timestamp = context.getValueFactories().getDateFactory().create();
RecordingChanges changes = new RecordingChanges(context.getId(), context.getProcessId(), this.getKey(), null,
                        repositoryEnvironment.journalId());
changes.workspaceRemoved(name);
changes.freeze(userId, userData, timestamp);
this.changeBus.notify(changes);
return true;
origin: org.fcrepo/modeshape-jcr

  changesFor(wsAndOldPath.getWorkspaceName()).nodeRemoved(key, oldParentKey, wsAndOldPath.getPath(), primaryType,
                              mixinTypes, null, null);
  changesFor(wsAndNewPath.getWorkspaceName()).nodeCreated(key, newParentKey, wsAndNewPath.getPath(), primaryType,
                              mixinTypes, properties);
  changesFor(newWorkspace).nodeMoved(key, primaryType, mixinTypes, newParentKey, oldParentKey,
                    newWsAndPath.getPath(), oldWsAndPath.getPath());
  return;
changesFor(oldWsAndPath.getWorkspaceName()).nodeRemoved(key, oldParentKey, oldWsAndPath.getPath(), primaryType,
                            mixinTypes, null, null);
changesFor(newWsAndPath.getWorkspaceName()).nodeCreated(key, newParentKey, newWsAndPath.getPath(), primaryType,
                            mixinTypes, properties);
return;
  if (newWorkspace.equals(oldWorkspace)) {
    found = true;
    changesFor(newWorkspace).nodeMoved(key, primaryType, mixinTypes, newParentKey, oldParentKey,
                      wsAndNewPath.getPath(), wsAndOldPath.getPath());
  changesFor(wsAndNewPath).nodeCreated(key, newParentKey, wsAndNewPath.getPath(), primaryType, mixinTypes,
                     properties);
changesFor(oldWsAndPath).nodeRemoved(key, oldParentKey, oldWsAndPath.getPath(), primaryType, mixinTypes,
                   null, null);
origin: ModeShape/modeshape

private void fireSequencingFailureEvent( AbstractJcrNode sequencedNode,
                     JcrSession inputSession,
                     Throwable cause,
                     String sequencerName ) throws RepositoryException {
  assert sequencedNode != null;
  assert inputSession != null;
  Name primaryType = sequencedNode.getPrimaryTypeName();
  Set<Name> mixinTypes = sequencedNode.getMixinTypeNames();
  final ExecutionContext context = inputSession.context();
  RecordingChanges sequencingChanges = new RecordingChanges(inputSession.sessionId(), context.getProcessId(),
                               inputSession.getRepository().repositoryKey(),
                               inputSession.workspaceName(), inputSession.getRepository()
                                                    .journalId());
  sequencingChanges.nodeSequencingFailure(sequencedNode.key(), sequencedNode.path(), primaryType, mixinTypes,
                      work.getOutputPath(), work.getUserId(), work.getSelectedPath(), sequencerName,
                      cause);
  repository.changeBus().notify(sequencingChanges);
}
org.modeshape.jcr.cache.changeRecordingChanges

Javadoc

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

Most used methods

  • <init>
    Creates a new change set.
  • binaryValueNoLongerUsed
  • binaryValueUsed
  • filterName
  • filterNameSet
  • freeze
    Marks this change set as frozen (aka. closed). This means it should not accept any more changes.
  • getTimestamp
  • getUserId
  • nodeChanged
  • nodeCreated
  • nodeMoved
  • nodeRemoved
  • nodeMoved,
  • nodeRemoved,
  • nodeRenamed,
  • nodeReordered,
  • nodeSequenced,
  • nodeSequencingFailure,
  • propertyAdded,
  • propertyChanged,
  • propertyRemoved,
  • repositoryMetadataChanged

Popular in Java

  • Reading from database using SQL prepared statement
  • compareTo (BigDecimal)
  • findViewById (Activity)
  • setContentView (Activity)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now