View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements. See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache license, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License. You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the license for the specific language governing permissions and
15   * limitations under the license.
16   */
17  package org.apache.logging.log4j.audit.catalog;
18  
19  import org.apache.logging.log4j.catalog.api.Attribute;
20  import org.apache.logging.log4j.catalog.api.Event;
21  
22  import java.util.List;
23  import java.util.Map;
24  
25  import static org.apache.logging.log4j.catalog.api.constant.Constants.DEFAULT_CATALOG;
26  
27  /**
28   *
29   */
30  public interface CatalogManager {
31  
32      default Event getEvent(String eventName) {
33          return getEvent(eventName, DEFAULT_CATALOG);
34      }
35  
36      Event getEvent(String eventName, String catalogId);
37  
38      default List<String> getRequiredContextAttributes(String eventName) {
39          return getRequiredContextAttributes(eventName, DEFAULT_CATALOG);
40      }
41  
42      List<String> getRequiredContextAttributes(String eventName, String catalogId);
43  
44      default List<String> getAttributeNames(String eventName) {
45          return getAttributeNames(eventName, DEFAULT_CATALOG);
46      }
47  
48      List<String> getAttributeNames(String eventName, String catalogId);
49  
50      default Map<String, Attribute> getAttributes(String eventName) {
51          return getAttributes(eventName, DEFAULT_CATALOG);
52      }
53  
54      Map<String, Attribute> getAttributes(String eventName, String catalogId);
55  
56      Map<String, Attribute> getRequestContextAttributes();
57  
58      default Attribute getAttribute(String attributeName) {
59          return getAttribute(attributeName, DEFAULT_CATALOG);
60      }
61  
62      Attribute getAttribute(String attributeName, String catalogId);
63  }