You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -66,4 +66,4 @@ In the event of any expiration or termination of this Licensee, any Confidential
66
66
67
67
### Section 8 – Applicable Law.
68
68
69
-
The License shall be governed by and interpreted in accordance with the substantive law of the State of California, U.S.A., excluding its conflicts of law provisions, and by the courts of that state.
69
+
The License shall be governed by and interpreted in accordance with the substantive law of the State of California, U.S.A., excluding its conflicts of law provisions, and by the courts of that state.
The results of the audit operation are returned with the AuditingResult. It contains the following elements:
161
-
```
162
-
List<AuditEventFailReport> failedEvents;
163
-
List<AuditEvent> sentEvents;
164
-
```
165
-
Each `AuditEventFailReport` contains the failed event, a `FailReport` status code, and a failure description.
166
-
167
-
`FailReport` indicates the type of error encountered.
168
-
169
-
When returned with an event (i.e. `onFailure(event, failReport, description)` ) it can take one of the following values:
170
-
+ 'BAD_ACK' - NACK was received. The description contains the ack details.
171
-
+ 'NO_ACK' - no ACK was received after max retry attempts was made.
172
-
+ 'CACHE_IS_FULL' - the Audit cache is full and the event had to be dropped.
173
-
174
-
175
-
#### Additional API
176
-
177
-
##### Reconnect option
178
-
Occasionally, audit client can be disconnected. In such a case, you receive an ```onFailure``` callback with ```FailReport.STREAM_IS_CLOSE```
179
-
**This notification is currently available only for ASYNC mode**.
180
-
181
-
There are two ways to handle reconnection:
182
-
+ MANUAL (default) - the `auditClient.reconnect()` API should be used to re-establish the connection.
183
-
+ AUTOMATIC - no API call is needed. the sdk automatically reconnects until the connection is restored.
184
-
185
-
Use the configuration to change the reconnect mode:
186
-
```
187
-
AuditConfiguration.builder()
188
-
.reconnectMode(ReconnectMode.AUTOMATIC)
189
-
.build()
190
-
```
191
-
##### Authentication token
192
-
The sdk supports two modes of authentication:
193
-
- Using a UAA user and pass. Use the `AuditConfiguration.builder()` to obtain a regular, UAA based configuration.
194
-
- Using an authentication token. Use the `AuditConfiguration.builderWithAuthToken()` to obtain an auth token based configuration.
195
-
196
-
Once a client was created, its authentication mode cannot be changed.
197
-
When working with authentication token, you might need to refresh the token. This can be achieved by running the `auditClient.setAuthToken(token)` API.
198
-
199
-
Please note that this API throws IllegalStateException if executed on a client configured with UAA authentication mode.
200
-
201
-
----
202
-
## Additional information
203
-
204
-
##### Debug flag
205
-
You can enable audit debug log level by setting `AUDIT_DEBUG_ENABLED: true` in your environment.
206
-
207
-
##### Tracing abilities
208
-
The SDK audits a marked message once every few minutes. The message is not sent to your DB and is for debugging purposes. This feature may be disabled in the configuration:
209
-
```
210
-
AuditConfiguration.builder()
211
-
.traceEnabled(false)
212
-
.build()
213
-
```
214
-
##### Auditing Application Name
215
-
When building an auditEvent (V2 and up), you can add the auditing application name. This is a friendly name that can take a String up to 100 characters.
216
-
```
217
-
AuditConfiguration.builder()
218
-
.appName("application name")
219
-
.build()
220
-
```
221
-
If APPLICATION_NAME variable was set in the environment, it will be added to each message and there is no need to explicitly provide it when building the message.
This application is a sample publisher demonstrating how to use and run Audit-SDK.
4
+
5
+
6
+
### How to use the app?
7
+
8
+
1. Follow instructions to create UAA Service, clients and etc. [here](https://docs.predix.io/en-US/content/service/security/audit/getting-started-with-predix-audit#IODQyYmQ5ZjUtNTc3My00ZDBlLThmZGMtMjQ1MzQzYjc2YTlj)
9
+
2. Update the following in the manifest.yml:
10
+
* "services" - Name of your audit service instance (this is of automaticlly binding)
11
+
* AUDIT_SERVICE_NAME - Name of your audit service defenition. i.e: "predix-audit"
12
+
* AUDIT_UAA_URL - URL of your Audit UAA
13
+
* AUDIT_UAA_CLIENT_SECRET - Client secret of the above uaa
14
+
* AUDIT_UAA_CLIENT_ID - Client ID of the above uaa
15
+
3. Do mvn clean install
16
+
4. Push the application: ```cf push```
17
+
18
+
19
+
That's it.
20
+
Browse to the app URL with ```/publishAsync``` (GET request) to publish a message
21
+
Browse to the app URL with ```/getLastResponse``` (GET request) to see the last response
0 commit comments