View Javadoc
1   /*
2    * Copyright (c) 2002-2022, City of Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  package fr.paris.lutece.portal.service.security;
35  
36  import fr.paris.lutece.api.user.User;
37  
38  /**
39   * Interface for access loggers
40   */
41  public interface IAccessLogger
42  {
43  
44      /**
45       * Log a message object with the INFO level.
46       *
47       * @param strEventType
48       *            the event type
49       * @param strAppEventCode
50       *            the event code
51       * @param connectedUser
52       *            the user connected
53       * @param data
54       *            the message object to log
55       * @param specificOrigin
56       *            specific origin of the event to log
57       */
58      public void info( String strEventType, String strAppEventCode, User connectedUser, Object data, String specificOrigin );
59  
60      /**
61       * Log a message object with the INFO level.
62       *
63       * @param strEventType
64       *            the event type
65       * @param strAppEventCode
66       *            the event code
67       * @param connectedUser
68       *            the user connected
69       * @param data
70       *            the message object to log
71       */
72      public default void info( String strEventType, String strAppEventCode, User connectedUser, Object data )
73      {
74          info( strEventType, strAppEventCode, connectedUser, data, null );
75      }
76  
77      /**
78       * Log a message object with the DEBUG level.
79       *
80       * @param strEventType
81       *            the event type
82       * @param strAppEventCode
83       *            the event code
84       * @param connectedUser
85       *            the user connected
86       * @param data
87       *            the message object to log
88       * @param specificOrigin
89       *            specific origin of the event to log
90       */
91      public void debug( String strEventType, String strAppEventCode, User connectedUser, Object data, String specificOrigin );
92  
93      /**
94       * Log a message object with the DEBUG level.
95       *
96       * @param strEventType
97       *            the event type
98       * @param strAppEventCode
99       *            the event code
100      * @param connectedUser
101      *            the user connected
102      * @param data
103      *            the message object to log
104      */
105     public default void debug( String strEventType, String strAppEventCode, User connectedUser, Object data )
106     {
107         debug( strEventType, strAppEventCode, connectedUser, data, null );
108     }
109 
110     /**
111      * Log a message object with the TRACE level.
112      *
113      * @param strEventType
114      *            the event type
115      * @param strAppEventCode
116      *            the event code
117      * @param connectedUser
118      *            the user connected
119      * @param data
120      *            the message object to log
121      * @param specificOrigin
122      *            specific origin of the event to log
123      */
124     public void trace( String strEventType, String strAppEventCode, User connectedUser, Object data, String specificOrigin );
125 
126     /**
127      * Log a message object with the TRACE level.
128      *
129      * @param strEventType
130      *            the event type
131      * @param strAppEventCode
132      *            the event code
133      * @param connectedUser
134      *            the user connected
135      * @param data
136      *            the message object to log
137      */
138     public default void trace( String strEventType, String strAppEventCode, User connectedUser, Object data )
139     {
140         trace( strEventType, strAppEventCode, connectedUser, data, null );
141     }
142 
143     /**
144      * Log a message object with the WARN level.
145      *
146      * @param strEventType
147      *            the event type
148      * @param strAppEventCode
149      *            the event code
150      * @param connectedUser
151      *            the user connected
152      * @param data
153      *            the message object to log
154      * @param specificOrigin
155      *            specific origin of the event to log
156      */
157     public void warn( String strEventType, String strAppEventCode, User connectedUser, Object data, String specificOrigin );
158 
159     /**
160      * Log a message object with the WARN level.
161      *
162      * @param strEventType
163      *            the event type
164      * @param strAppEventCode
165      *            the event code
166      * @param connectedUser
167      *            the user connected
168      * @param data
169      *            the message object to log
170      */
171     public default void warn( String strEventType, String strAppEventCode, User connectedUser, Object data )
172     {
173         warn( strEventType, strAppEventCode, connectedUser, data, null );
174     }
175 
176 }