Package javax.jcr.observation

Examples of javax.jcr.observation.EventJournal


    public EventBundle getEvents(SessionInfo sessionInfo,
                                   EventFilter filter,
                                   long after)
            throws RepositoryException, UnsupportedRepositoryOperationException {
        SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
        EventJournal journal = sInfo.getSession().getWorkspace().getObservationManager().getEventJournal();
        if (journal == null) {
            throw new UnsupportedRepositoryOperationException();
        }
        EventFactory factory = new EventFactory(sInfo.getSession(),
                sInfo.getNamePathResolver(), idFactory, qValueFactory);
        journal.skipTo(after);
        List<Event> events = new ArrayList<Event>();
        int batchSize = 1024;
        boolean distinctDates = true;
        long lastDate = Long.MIN_VALUE;
        while (journal.hasNext() && (batchSize > 0 || !distinctDates)) {
            Event e = factory.fromJCREvent(journal.nextEvent());
            if (filter.accept(e, false)) {
                distinctDates = lastDate != e.getDate();
                lastDate = e.getDate();
                events.add(e);
                batchSize--;
View Full Code Here


    public EventBundle getEvents(SessionInfo sessionInfo,
                                   EventFilter filter,
                                   long after)
            throws RepositoryException, UnsupportedRepositoryOperationException {
        SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
        EventJournal journal = sInfo.getSession().getWorkspace().getObservationManager().getEventJournal();
        if (journal == null) {
            throw new UnsupportedRepositoryOperationException();
        }
        EventFactory factory = new EventFactory(sInfo.getSession(),
                sInfo.getNamePathResolver(), idFactory, qValueFactory);
        journal.skipTo(after);
        List<Event> events = new ArrayList<Event>();
        int batchSize = 1024;
        boolean distinctDates = true;
        long lastDate = Long.MIN_VALUE;
        while (journal.hasNext() && (batchSize > 0 || !distinctDates)) {
            Event e = factory.fromJCREvent(journal.nextEvent());
            if (filter.accept(e, false)) {
                distinctDates = lastDate != e.getDate();
                lastDate = e.getDate();
                events.add(e);
                batchSize--;
View Full Code Here

    public EventBundle getEvents(SessionInfo sessionInfo,
                                   EventFilter filter,
                                   long after)
            throws RepositoryException, UnsupportedRepositoryOperationException {
        SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
        EventJournal journal = sInfo.getSession().getWorkspace().getObservationManager().getEventJournal();
        if (journal == null) {
            throw new UnsupportedRepositoryOperationException();
        }
        EventFactory factory = new EventFactory(sInfo.getSession(),
                sInfo.getNamePathResolver(), idFactory, qValueFactory);
        journal.skipTo(after);
        List<Event> events = new ArrayList<Event>();
        int batchSize = 1024;
        boolean distinctDates = true;
        long lastDate = Long.MIN_VALUE;
        while (journal.hasNext() && (batchSize > 0 || !distinctDates)) {
            Event e = factory.fromJCREvent(journal.nextEvent());
            if (filter.accept(e, false)) {
                distinctDates = lastDate != e.getDate();
                lastDate = e.getDate();
                events.add(e);
                batchSize--;
View Full Code Here

            // root
            resource = new RootCollection(locator, session, this);
        } else if ("journal".equals(type) && locator.getResourcePath().equals(locator.getWorkspacePath())) {
            // feed/event journal resource
            try {
                EventJournal ej = session.getRepositorySession().getWorkspace().getObservationManager()
                        .getEventJournal();
                if (ej == null) {
                    throw new DavException(HttpServletResponse.SC_NOT_IMPLEMENTED, "event journal not supported");
                }
                resource = new EventJournalResourceImpl(ej, locator, session, request, this);
View Full Code Here

            // root
            resource = new RootCollection(locator, session, this);
        } else if ("journal".equals(type) && locator.getResourcePath().equals(locator.getWorkspacePath())) {
            // feed/event journal resource
            try {
                EventJournal ej = session.getRepositorySession().getWorkspace().getObservationManager()
                        .getEventJournal();
                if (ej == null) {
                    throw new DavException(HttpServletResponse.SC_NOT_IMPLEMENTED, "event journal not supported");
                }
                resource = new EventJournalResourceImpl(ej, locator, session, request, this);
View Full Code Here

    public EventBundle getEvents(SessionInfo sessionInfo,
                                   EventFilter filter,
                                   long after)
            throws RepositoryException, UnsupportedRepositoryOperationException {
        SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
        EventJournal journal = sInfo.getSession().getWorkspace().getObservationManager().getEventJournal();
        if (journal == null) {
            throw new UnsupportedRepositoryOperationException();
        }
        EventFactory factory = new EventFactory(sInfo.getSession(),
                sInfo.getNamePathResolver(), idFactory, qValueFactory);
        journal.skipTo(after);
        List<Event> events = new ArrayList<Event>();
        int batchSize = 1024;
        boolean distinctDates = true;
        long lastDate = Long.MIN_VALUE;
        while (journal.hasNext() && (batchSize > 0 || !distinctDates)) {
            Event e = factory.fromJCREvent(journal.nextEvent());
            if (filter.accept(e, false)) {
                distinctDates = lastDate != e.getDate();
                lastDate = e.getDate();
                events.add(e);
                batchSize--;
View Full Code Here

    public EventBundle getEvents(SessionInfo sessionInfo,
                                   EventFilter filter,
                                   long after)
            throws RepositoryException, UnsupportedRepositoryOperationException {
        SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
        EventJournal journal = sInfo.getSession().getWorkspace().getObservationManager().getEventJournal();
        if (journal == null) {
            throw new UnsupportedRepositoryOperationException();
        }
        EventFactory factory = new EventFactory(sInfo.getSession(),
                sInfo.getNamePathResolver(), idFactory, qValueFactory);
        journal.skipTo(after);
        List<Event> events = new ArrayList<Event>();
        int batchSize = 1024;
        boolean distinctDates = true;
        long lastDate = Long.MIN_VALUE;
        while (journal.hasNext() && (batchSize > 0 || !distinctDates)) {
            Event e = factory.fromJCREvent(journal.nextEvent());
            if (filter.accept(e, false)) {
                distinctDates = lastDate != e.getDate();
                lastDate = e.getDate();
                events.add(e);
                batchSize--;
View Full Code Here

    public EventBundle getEvents(SessionInfo sessionInfo,
                                   EventFilter filter,
                                   long after)
            throws RepositoryException, UnsupportedRepositoryOperationException {
        SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
        EventJournal journal = sInfo.getSession().getWorkspace().getObservationManager().getEventJournal();
        if (journal == null) {
            throw new UnsupportedRepositoryOperationException();
        }
        EventFactory factory = new EventFactory(sInfo.getSession(),
                sInfo.getNamePathResolver(), idFactory, qValueFactory);
        journal.skipTo(after);
        List<Event> events = new ArrayList<Event>();
        int batchSize = 1024;
        boolean distinctDates = true;
        long lastDate = Long.MIN_VALUE;
        while (journal.hasNext() && (batchSize > 0 || !distinctDates)) {
            Event e = factory.fromJCREvent(journal.nextEvent());
            if (filter.accept(e, false)) {
                distinctDates = lastDate != e.getDate();
                lastDate = e.getDate();
                events.add(e);
                batchSize--;
View Full Code Here

    public EventBundle getEvents(SessionInfo sessionInfo,
                                   EventFilter filter,
                                   long after)
            throws RepositoryException, UnsupportedRepositoryOperationException {
        SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
        EventJournal journal = sInfo.getSession().getWorkspace().getObservationManager().getEventJournal();
        if (journal == null) {
            throw new UnsupportedRepositoryOperationException();
        }
        EventFactory factory = new EventFactory(sInfo.getSession(),
                sInfo.getNamePathResolver(), idFactory, qValueFactory);
        journal.skipTo(after);
        List<Event> events = new ArrayList<Event>();
        int batchSize = 1024;
        boolean distinctDates = true;
        long lastDate = Long.MIN_VALUE;
        while (journal.hasNext() && (batchSize > 0 || !distinctDates)) {
            Event e = factory.fromJCREvent(journal.nextEvent());
            if (filter.accept(e, false)) {
                distinctDates = lastDate != e.getDate();
                lastDate = e.getDate();
                events.add(e);
                batchSize--;
View Full Code Here

        long now = System.currentTimeMillis();
        session.getRootNode().addNode("testNode");
        session.save();
        session.getNode("/testNode").remove();
        session.save();
        EventJournal eventJournal = session.getWorkspace().getObservationManager().getEventJournal();
        eventJournal.skipTo(now);
        List<String> paths = new ArrayList<>();
        while (eventJournal.hasNext()) {
            paths.add(((Event)eventJournal.next()).getPath());
        }
        //check the node-added event is there
        assertTrue("Entry not found in journal", paths.remove("/testNode"));
        //check the node-removed event is there
        assertTrue("Entry not found in journal", paths.remove("/testNode"));
View Full Code Here

TOP

Related Classes of javax.jcr.observation.EventJournal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.