IAccessLogger.java

  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. import fr.paris.lutece.api.user.User;

  36. /**
  37.  * Interface for access loggers
  38.  */
  39. public interface IAccessLogger
  40. {

  41.     /**
  42.      * Log a message object with the INFO level.
  43.      *
  44.      * @param strEventType
  45.      *            the event type
  46.      * @param strAppEventCode
  47.      *            the event code
  48.      * @param connectedUser
  49.      *            the user connected
  50.      * @param data
  51.      *            the message object to log
  52.      * @param specificOrigin
  53.      *            specific origin of the event to log
  54.      */
  55.     public void info( String strEventType, String strAppEventCode, User connectedUser, Object data, String specificOrigin );

  56.     /**
  57.      * Log a message object with the INFO level.
  58.      *
  59.      * @param strEventType
  60.      *            the event type
  61.      * @param strAppEventCode
  62.      *            the event code
  63.      * @param connectedUser
  64.      *            the user connected
  65.      * @param data
  66.      *            the message object to log
  67.      */
  68.     public default void info( String strEventType, String strAppEventCode, User connectedUser, Object data )
  69.     {
  70.         info( strEventType, strAppEventCode, connectedUser, data, null );
  71.     }

  72.     /**
  73.      * Log a message object with the DEBUG level.
  74.      *
  75.      * @param strEventType
  76.      *            the event type
  77.      * @param strAppEventCode
  78.      *            the event code
  79.      * @param connectedUser
  80.      *            the user connected
  81.      * @param data
  82.      *            the message object to log
  83.      * @param specificOrigin
  84.      *            specific origin of the event to log
  85.      */
  86.     public void debug( String strEventType, String strAppEventCode, User connectedUser, Object data, String specificOrigin );

  87.     /**
  88.      * Log a message object with the DEBUG level.
  89.      *
  90.      * @param strEventType
  91.      *            the event type
  92.      * @param strAppEventCode
  93.      *            the event code
  94.      * @param connectedUser
  95.      *            the user connected
  96.      * @param data
  97.      *            the message object to log
  98.      */
  99.     public default void debug( String strEventType, String strAppEventCode, User connectedUser, Object data )
  100.     {
  101.         debug( strEventType, strAppEventCode, connectedUser, data, null );
  102.     }

  103.     /**
  104.      * Log a message object with the TRACE level.
  105.      *
  106.      * @param strEventType
  107.      *            the event type
  108.      * @param strAppEventCode
  109.      *            the event code
  110.      * @param connectedUser
  111.      *            the user connected
  112.      * @param data
  113.      *            the message object to log
  114.      * @param specificOrigin
  115.      *            specific origin of the event to log
  116.      */
  117.     public void trace( String strEventType, String strAppEventCode, User connectedUser, Object data, String specificOrigin );

  118.     /**
  119.      * Log a message object with the TRACE level.
  120.      *
  121.      * @param strEventType
  122.      *            the event type
  123.      * @param strAppEventCode
  124.      *            the event code
  125.      * @param connectedUser
  126.      *            the user connected
  127.      * @param data
  128.      *            the message object to log
  129.      */
  130.     public default void trace( String strEventType, String strAppEventCode, User connectedUser, Object data )
  131.     {
  132.         trace( strEventType, strAppEventCode, connectedUser, data, null );
  133.     }

  134.     /**
  135.      * Log a message object with the WARN level.
  136.      *
  137.      * @param strEventType
  138.      *            the event type
  139.      * @param strAppEventCode
  140.      *            the event code
  141.      * @param connectedUser
  142.      *            the user connected
  143.      * @param data
  144.      *            the message object to log
  145.      * @param specificOrigin
  146.      *            specific origin of the event to log
  147.      */
  148.     public void warn( String strEventType, String strAppEventCode, User connectedUser, Object data, String specificOrigin );

  149.     /**
  150.      * Log a message object with the WARN level.
  151.      *
  152.      * @param strEventType
  153.      *            the event type
  154.      * @param strAppEventCode
  155.      *            the event code
  156.      * @param connectedUser
  157.      *            the user connected
  158.      * @param data
  159.      *            the message object to log
  160.      */
  161.     public default void warn( String strEventType, String strAppEventCode, User connectedUser, Object data )
  162.     {
  163.         warn( strEventType, strAppEventCode, connectedUser, data, null );
  164.     }

  165. }