forked from snowplow/snowplow-java-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmitter.java
More file actions
65 lines (57 loc) · 1.87 KB
/
Emitter.java
File metadata and controls
65 lines (57 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* Copyright (c) 2015 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the Apache License Version 2.0 is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
*/
package com.snowplowanalytics.snowplow.tracker.emitter;
// This library
import com.snowplowanalytics.snowplow.tracker.payload.TrackerPayload;
import java.util.List;
/**
* Emitter interface.
*/
public interface Emitter {
/**
* Adds a payload to the buffer and checks whether
* we have reached the buffer limit yet.
*
* @param payload an event payload
*/
void emit(TrackerPayload payload);
/**
* Customize the emitter buffer size to any valid integer
* greater than zero.
* - Will only effect the BatchEmitter
*
* @param bufferSize number of events to collect before
* sending
*/
void setBufferSize(int bufferSize);
/**
* When the buffer limit is reached sending of the buffer is
* initiated.
*
* This can be used to manually start sending.
*/
void flushBuffer();
/**
* Gets the Emitter Buffer Size
* - Will always be 1 for SimpleEmitter
*
* @return the buffer size
*/
int getBufferSize();
/**
* Returns the List of Payloads that are in the buffer.
*
* @return the buffer payloads
*/
List<TrackerPayload> getBuffer();
}