public class EventLog extends Object implements Iterable<BoxEvent>
An EventLog cannot be instantiated directly. Instead, use one of the static methods to retrieve a log of events.
Unlike the EventStream
class, EventLog doesn't support retrieving events in real-time.
Modifier and Type | Field and Description |
---|---|
static URLTemplate |
ENTERPRISE_EVENT_URL_TEMPLATE
Enterprise Event URL Template.
|
Modifier and Type | Method and Description |
---|---|
int |
getChunkSize()
Gets the number of events in this log, including duplicate events.
|
Date |
getEndDate()
Gets the date of the latest event in this log.
|
static EventLog |
getEnterpriseEvents(BoxAPIConnection api,
Date after,
Date before,
BoxEvent.Type... types)
Gets all the enterprise events that occurred within a specified date range.
|
static EventLog |
getEnterpriseEvents(BoxAPIConnection api,
String position,
Date after,
Date before,
BoxEvent.Type... types)
Gets all the enterprise events that occurred within a specified date range, starting from a given position
within the event stream.
|
static EventLog |
getEnterpriseEvents(BoxAPIConnection api,
String position,
Date after,
Date before,
int limit,
BoxEvent.Type... types)
Gets all the enterprise events that occurred within a specified date range, starting from a given position
within the event stream.
|
int |
getLimit()
Gets the maximum number of events that this event log could contain given its start date, end date, and stream
position.
|
String |
getNextStreamPosition()
Gets the next position within the event stream for retrieving subsequent events.
|
int |
getSize()
Gets the number of events in this list, excluding duplicate events.
|
Date |
getStartDate()
Gets the date of the earliest event in this log.
|
String |
getStreamPosition()
Gets the starting position of the events in this log within the event stream.
|
Iterator<BoxEvent> |
iterator()
Returns an iterator over the events in this log.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static final URLTemplate ENTERPRISE_EVENT_URL_TEMPLATE
public static EventLog getEnterpriseEvents(BoxAPIConnection api, String position, Date after, Date before, BoxEvent.Type... types)
api
- the API connection to use.position
- the starting position of the event stream.after
- the lower bound on the timestamp of the events returned.before
- the upper bound on the timestamp of the events returned.types
- an optional list of event types to filter by.public static EventLog getEnterpriseEvents(BoxAPIConnection api, Date after, Date before, BoxEvent.Type... types)
api
- the API connection to use.after
- the lower bound on the timestamp of the events returned.before
- the upper bound on the timestamp of the events returned.types
- an optional list of event types to filter by.public static EventLog getEnterpriseEvents(BoxAPIConnection api, String position, Date after, Date before, int limit, BoxEvent.Type... types)
api
- the API connection to use.position
- the starting position of the event stream.after
- the lower bound on the timestamp of the events returned.before
- the upper bound on the timestamp of the events returned.limit
- the number of entries to be returned in the response.types
- an optional list of event types to filter by.public Date getStartDate()
The value returned by this method corresponds to the created_after
URL parameter that was used
when retrieving the events in this EventLog.
public Date getEndDate()
The value returned by this method corresponds to the created_before
URL parameter that was used
when retrieving the events in this EventLog.
public int getLimit()
The value returned by this method corresponds to the limit
URL parameter that was used when
retrieving the events in this EventLog.
public String getStreamPosition()
The value returned by this method corresponds to the stream_position
URL parameter that was used
when retrieving the events in this EventLog.
public String getNextStreamPosition()
The value returned by this method corresponds to the next_stream_position
field returned by the
API's events endpoint.
public int getChunkSize()
The chunk size may not be representative of the number of events returned by this EventLog's iterator because the iterator will automatically ignore duplicate events.
The value returned by this method corresponds to the chunk_size
field returned by the API's
events endpoint.
public int getSize()
The size is guaranteed to be representative of the number of events returned by this EventLog's iterator.