org.apache.jackrabbit.core.observation
Class EventJournalImpl

java.lang.Object
  extended by org.apache.jackrabbit.core.observation.EventJournalImpl
All Implemented Interfaces:
Iterator, EventIterator, RangeIterator, EventJournal

public class EventJournalImpl
extends Object
implements EventJournal

EventJournalImpl implements the JCR 2.0 EventJournal.


Constructor Summary
EventJournalImpl(EventFilter filter, Journal journal, String producerId)
          Creates a new event journal.
 
Method Summary
 Calendar getDate()
          Returns the date associated with this event iterator, or null.
 long getPosition()
          
 long getSize()
           
 boolean hasNext()
          
 Object next()
          
 Event nextEvent()
          
 void remove()
           
 void skip(long skipNum)
          
 void skipTo(long date)
          Skip all elements of the iterator earlier than date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventJournalImpl

public EventJournalImpl(EventFilter filter,
                        Journal journal,
                        String producerId)
Creates a new event journal.

Parameters:
filter - for filtering the events read from the journal.
journal - the cluster journal.
producerId - the producer id of the cluster node.
Method Detail

skipTo

public void skipTo(long date)
Skip all elements of the iterator earlier than date.

If an attempt is made to skip past the last element of the iterator, no exception is thrown but the subsequent EventIterator.nextEvent() will fail.

Specified by:
skipTo in interface EventJournal
Parameters:
date - a date that is represented by the number of milliseconds since January 1, 1970, 00:00:00 GMT

nextEvent

public Event nextEvent()

Specified by:
nextEvent in interface EventIterator

getDate

public Calendar getDate()
Description copied from interface: EventIterator
Returns the date associated with this event iterator, or null.

The date is required to be non-null for event iterators obtained through an EventJournal.

Returns:
the date associated with this event iterator, or null.

skip

public void skip(long skipNum)

Specified by:
skip in interface RangeIterator

getSize

public long getSize()
Specified by:
getSize in interface RangeIterator
Returns:
always -1.

getPosition

public long getPosition()

Specified by:
getPosition in interface RangeIterator

remove

public void remove()
Specified by:
remove in interface Iterator
Throws:
UnsupportedOperationException - always.

hasNext

public boolean hasNext()

Specified by:
hasNext in interface Iterator

next

public Object next()

Specified by:
next in interface Iterator


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.