1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.forgerock.audit.handlers.splunk;
17
18 import org.forgerock.audit.events.handlers.EventHandlerConfiguration;
19
20 import com.fasterxml.jackson.annotation.JsonPropertyDescription;
21
22
23
24
25 public final class SplunkAuditEventHandlerConfiguration extends EventHandlerConfiguration {
26
27 @JsonPropertyDescription("audit.handlers.splunk.connection")
28 private ConnectionConfiguration connection = new ConnectionConfiguration();
29
30 @JsonPropertyDescription("audit.handlers.splunk.buffering")
31 private BufferingConfiguration buffering = new BufferingConfiguration();
32
33 @JsonPropertyDescription("audit.handlers.splunk.authzToken")
34 private String authzToken;
35
36
37
38
39
40
41 public BufferingConfiguration getBuffering() {
42 return buffering;
43 }
44
45
46
47
48
49
50
51 public void setBuffering(final BufferingConfiguration buffering) {
52 this.buffering = buffering;
53 }
54
55
56
57
58
59
60 public ConnectionConfiguration getConnection() {
61 return connection;
62 }
63
64
65
66
67
68
69
70 public void setConnection(final ConnectionConfiguration connection) {
71 this.connection = connection;
72 }
73
74
75
76
77
78
79 public String getAuthzToken() {
80 return authzToken;
81 }
82
83
84
85
86
87
88
89 public void setAuthzToken(final String authzToken) {
90 this.authzToken = authzToken;
91 }
92
93 @Override
94 public boolean isUsableForQueries() {
95 return false;
96 }
97
98
99
100
101 public final static class ConnectionConfiguration {
102
103
104 private static final String DEFAULT_HOST = "localhost";
105
106
107 private static final int DEFAULT_PORT = 8088;
108
109 @JsonPropertyDescription("audit.handlers.splunk.connection.useSSL")
110 private boolean useSSL;
111
112 @JsonPropertyDescription("audit.handlers.splunk.connection.host")
113 private String host;
114
115 @JsonPropertyDescription("audit.handlers.splunk.connection.port")
116 private int port;
117
118
119
120
121
122
123 public boolean isUseSSL() {
124 return useSSL;
125 }
126
127
128
129
130
131
132
133 public void setUseSSL(final boolean useSSL) {
134 this.useSSL = useSSL;
135 }
136
137
138
139
140
141
142 public String getHost() {
143 return host != null && !host.isEmpty() ? host : DEFAULT_HOST;
144 }
145
146
147
148
149
150
151
152 public void setHost(final String host) {
153 this.host = host;
154 }
155
156
157
158
159
160
161 public int getPort() {
162 return port > 0 ? port : DEFAULT_PORT;
163 }
164
165
166
167
168
169
170
171 public void setPort(final int port) {
172 this.port = port;
173 }
174
175 }
176
177
178
179
180 public final static class BufferingConfiguration {
181
182 @JsonPropertyDescription("audit.handlers.splunk.buffering.maxSize")
183 private int maxSize;
184
185 @JsonPropertyDescription("audit.handlers.splunk.buffering.writeInterval")
186 private String writeInterval;
187
188 @JsonPropertyDescription("audit.handlers.splunk.buffering.maxBatchedEvents")
189 private int maxBatchedEvents;
190
191
192
193
194
195
196 public int getMaxSize() {
197 return maxSize;
198 }
199
200
201
202
203
204
205
206 public void setMaxSize(final int maxSize) {
207 this.maxSize = maxSize;
208 }
209
210
211
212
213
214
215 public String getWriteInterval() {
216 return writeInterval;
217 }
218
219
220
221
222
223
224
225 public void setWriteInterval(final String writeInterval) {
226 this.writeInterval = writeInterval;
227 }
228
229
230
231
232
233
234 public int getMaxBatchedEvents() {
235 return maxBatchedEvents;
236 }
237
238
239
240
241
242
243
244 public void setMaxBatchedEvents(final int maxBatchedEvents) {
245 this.maxBatchedEvents = maxBatchedEvents;
246 }
247 }
248
249 }