@Test @FixFor( "MODE-2019" ) public void shouldSkipToEventsInJournal() throws Exception { long startingDate = System.currentTimeMillis(); getRoot().addNode("node1"); session.save(); Thread.sleep(100); long afterNode1 = System.currentTimeMillis(); getRoot().addNode("node2"); session.save(); Thread.sleep(100); long afterNode2 = System.currentTimeMillis(); getRoot().addNode("node3"); session.save(); Thread.sleep(100); long afterNode3 = System.currentTimeMillis(); EventJournal journal = getObservationManager().getEventJournal(); journal.skipTo(startingDate); assertPathsInJournal(journal, true, "/testroot/node1", "/testroot/node1/jcr:primaryType", "/testroot/node2", "/testroot/node2/jcr:primaryType", "/testroot/node3", "/testroot/node3/jcr:primaryType"); journal = getObservationManager().getEventJournal(); journal.skipTo(afterNode1); assertPathsInJournal(journal, true, "/testroot/node2", "/testroot/node2/jcr:primaryType", "/testroot/node3", "/testroot/node3/jcr:primaryType"); journal = getObservationManager().getEventJournal(); journal.skipTo(afterNode2); assertPathsInJournal(journal, true, "/testroot/node3", "/testroot/node3/jcr:primaryType"); journal = getObservationManager().getEventJournal(); journal.skipTo(afterNode3); assertFalse(journal.hasNext()); }
@Override public EventJournal getEventJournal() { return session.repository().journalId() != null ? new JcrEventJournal() : null; }
JcrObservationManager implements ObservationManager { @Override public EventJournal getEventJournal() { return session.repository().journalId() != null ? new JcrEventJournal() : null; } }
JcrObservationManager implements ObservationManager { @Override public EventJournal getEventJournal() { return session.repository().journalId() != null ? new JcrEventJournal() : null; } JcrObservationManager( JcrSession session,
                           Observable repositoryObservable ); }
JcrObservationManager implements ObservationManager { @Override public EventJournal getEventJournal() { return session.repository().journalId() != null ? new JcrEventJournal() : null; } JcrObservationManager( JcrSession session,
                           Observable repositoryObservable ); @Override void addEventListener( EventListener listener,
                                  int eventTypes,
                                  String absPath,
                                  boolean isDeep,
                                  String[] uuid,
                                  String[] nodeTypeName,
                                  boolean noLocal ); @Override EventListenerIterator getRegisteredEventListeners(); @Override void removeEventListener( EventListener listener ); @Override void setUserData( String userData ); @Override EventJournal getEventJournal(); @Override EventJournal getEventJournal( int eventTypes,
                                         String absPath,
                                         boolean isDeep,
                                         String[] uuid,
                                         String[] nodeTypeName ); }
JcrObservationManager implements ObservationManager { @Override public EventJournal getEventJournal() { return session.repository().journalId() != null ? new JcrEventJournal() : null; } JcrObservationManager( JcrSession session,
                           Observable repositoryObservable ); @Override void addEventListener( EventListener listener,
                                  int eventTypes,
                                  String absPath,
                                  boolean isDeep,
                                  String[] uuid,
                                  String[] nodeTypeName,
                                  boolean noLocal ); @Override EventListenerIterator getRegisteredEventListeners(); @Override void removeEventListener( EventListener listener ); @Override void setUserData( String userData ); @Override EventJournal getEventJournal(); @Override EventJournal getEventJournal( int eventTypes,
                                         String absPath,
                                         boolean isDeep,
                                         String[] uuid,
                                         String[] nodeTypeName );  }