1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.apache.syncope.core.provisioning.api;
20
21 import org.apache.syncope.common.lib.types.AuditElements;
22 import org.apache.syncope.core.provisioning.api.event.AfterHandlingEvent;
23
24 public interface AuditManager {
25
26 /**
27 * Checks if audit is requested matching the provided conditions.
28 *
29 * @param who user triggering the event
30 * @param type event category type
31 * @param category event category
32 * @param subcategory event subcategory
33 * @param event event
34 * @return created notification tasks
35 */
36 boolean auditRequested(
37 String who,
38 AuditElements.EventCategoryType type,
39 String category,
40 String subcategory,
41 String event);
42
43 /**
44 * Create audit entries according to the provided event.
45 *
46 * @param event Spring event raised during Logic processing
47 */
48 void audit(AfterHandlingEvent event);
49
50 /**
51 * Create audit entries for each audit matching provided conditions.
52 *
53 * @param who user triggering the event
54 * @param type event category type
55 * @param category event category
56 * @param subcategory event subcategory
57 * @param event event
58 * @param condition result value condition.
59 * @param before object(s) available before the event
60 * @param output object(s) produced by the event
61 * @param input object(s) provided to the event
62 */
63 @SuppressWarnings("squid:S00107")
64 void audit(
65 String who,
66 AuditElements.EventCategoryType type,
67 String category,
68 String subcategory,
69 String event,
70 AuditElements.Result condition,
71 Object before,
72 Object output,
73 Object... input);
74 }