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.dto;
18  
19  import java.util.Map;
20  
21  /**
22   * Container for Audit Event data.
23   */
24  public class AuditDto {
25      /**
26       * The name of the event.
27       */
28      private String eventName;
29  
30      /**
31       * The catalog to use. If null the default catalog is used.
32       */
33      private String catalogId;
34  
35      /**
36       * The RequestContext Map. This may be used as an alternative to passing the RequestContext as
37       * headers.
38       */
39      private Map<String, String> requestContextMap;
40  
41      /**
42       * The event specific attributes.
43       */
44      private Map<String, String> properties;
45  
46      /**
47       * Get the name of the event.
48       * @return the name of the event.
49       */
50      public String getEventName() {
51          return eventName;
52      }
53  
54      /**
55       * Set the name of the event.
56       * @param eventName The name of the event.
57       */
58      public void setEventName(String eventName) {
59          this.eventName = eventName;
60      }
61  
62      /**
63       * Get the Catalog id.
64       * @return the catalog id.
65       */
66      public String getCatalogId() {
67          return catalogId;
68      }
69  
70      /**
71       * Set the catalog id.
72       * @param catalogId The catalog id.
73       */
74      public void setCatalogId(String catalogId) {
75          this.catalogId = catalogId;
76      }
77  
78      /**
79       * Returns the RequestContext data map.
80       * @return A Map containing all the RequestContext keys and values.
81       */
82      public Map<String, String> getRequestContextMap() {
83          return requestContextMap;
84      }
85  
86      /**
87       * Set the RequstContext Map.
88       * @param requestContextMap the RequestContext Map.
89       */
90      public void setRequestContextMap(Map<String, String> requestContextMap) {
91          this.requestContextMap = requestContextMap;
92      }
93  
94      /**
95       * Gets the Map of properties for this event.
96       * @return the Map of event properties.
97       */
98      public Map<String, String> getProperties() {
99          return properties;
100     }
101 
102     /**
103      * Sets the RequestContext properties.
104      * @param properties The RequestContext properties.
105      */
106     public void setProperties(Map<String, String> properties) {
107         this.properties = properties;
108     }
109 }