Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions src/main/java/com/box/sdk/EventLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ public class EventLog implements Iterable<BoxEvent> {
* @param position the starting position of the event stream.
* @param after the lower bound on the timestamp of the events returned.
* @param before the upper bound on the timestamp of the events returned.
* @param types an optional list of event types to filter by.
* @param eventTypes an optional list of event types to filter by.
* @return a log of all the events that met the given criteria.
*/
public static EventLog getEnterpriseEvents(BoxAPIConnection api, String position, Date after, Date before,
BoxEvent.Type... types) {
return getEnterpriseEvents(api, position, after, before, ENTERPRISE_LIMIT, types);
BoxEvent.EventType... eventTypes) {
return getEnterpriseEvents(api, position, after, before, ENTERPRISE_LIMIT, eventTypes);
}

/**
Expand All @@ -69,11 +69,12 @@ public static EventLog getEnterpriseEvents(BoxAPIConnection api, String position
* @param api the API connection to use.
* @param after the lower bound on the timestamp of the events returned.
* @param before the upper bound on the timestamp of the events returned.
* @param types an optional list of event types to filter by.
* @param eventTypes an optional list of event types to filter by.
* @return a log of all the events that met the given criteria.
*/
public static EventLog getEnterpriseEvents(BoxAPIConnection api, Date after, Date before, BoxEvent.Type... types) {
return getEnterpriseEvents(api, null, after, before, ENTERPRISE_LIMIT, types);
public static EventLog getEnterpriseEvents(BoxAPIConnection api, Date after, Date before,
BoxEvent.EventType... eventTypes) {
return getEnterpriseEvents(api, null, after, before, ENTERPRISE_LIMIT, eventTypes);
}

/**
Expand All @@ -85,15 +86,15 @@ public static EventLog getEnterpriseEvents(BoxAPIConnection api, Date after, Dat
* @param after the lower bound on the timestamp of the events returned.
* @param before the upper bound on the timestamp of the events returned.
* @param limit the number of entries to be returned in the response.
* @param types an optional list of event types to filter by.
* @param eventTypes an optional list of event types to filter by.
* @return a log of all the events that met the given criteria.
*/
public static EventLog getEnterpriseEvents(BoxAPIConnection api, String position, Date after, Date before,
int limit, BoxEvent.Type... types) {
int limit, BoxEvent.EventType... eventTypes) {

URL url = ENTERPRISE_EVENT_URL_TEMPLATE.build(api.getBaseURL());

if (position != null || types.length > 0 || after != null
if (position != null || eventTypes.length > 0 || after != null
|| before != null || limit != ENTERPRISE_LIMIT) {
QueryStringBuilder queryBuilder = new QueryStringBuilder(url.getQuery());

Expand All @@ -115,9 +116,9 @@ public static EventLog getEnterpriseEvents(BoxAPIConnection api, String position
queryBuilder.appendParam("limit", limit);
}

if (types.length > 0) {
if (eventTypes.length > 0) {
StringBuilder filterBuilder = new StringBuilder();
for (BoxEvent.Type filterType : types) {
for (BoxEvent.EventType filterType : eventTypes) {
filterBuilder.append(filterType.name());
filterBuilder.append(',');
}
Expand Down