package tap.log;
/*
* This file is part of TAPLibrary.
*
* TAPLibrary is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* TAPLibrary is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with TAPLibrary. If not, see .
*
* Copyright 2012-2015 - UDS/Centre de Données astronomiques de Strasbourg (CDS),
* Astronomisches Rechen Institut (ARI)
*/
import tap.TAPExecutionReport;
import tap.TAPSyncJob;
import tap.db.DBConnection;
import tap.parameters.TAPParameters;
import uws.service.log.UWSLog;
/**
* Let log any kind of message about a TAP service.
*
* @author Grégory Mantelet (CDS;ARI)
* @version 2.0 (04/2015)
*/
public interface TAPLog extends UWSLog {
/**
*
Log a message and/or an error in the DB (database) context.
*
* List of all events sent by the library (case sensitive):
*
* - CONNECTION_LACK
* - TRANSLATE
* - EXECUTE
* - RESULT
* - LOAD_TAP_SCHEMA
* - CLEAN_TAP_SCHEMA
* - CREATE_TAP_SCHEMA
* - TABLE_EXIST
* - COLUMN_EXIST
* - EXEC_UPDATE
* - ADD_UPLOAD_TABLE
* - DROP_UPLOAD_TABLE
* - START_TRANSACTION
* - COMMIT
* - ROLLBACK
* - END_TRANSACTION
* - CLOSE
*
*
* @param level Level of the log (info, warning, error, ...). SHOULD NOT be NULL, but if NULL anyway, the level SHOULD be considered as INFO
* @param connection DB connection from which this log comes. MAY be NULL
* @param event Event at the origin of this log or action executed by the given database connection while this log is sent. MAY be NULL
* @param message Message to log. MAY be NULL
* @param error Error/Exception to log. MAY be NULL
*
* @since 2.0
*/
public void logDB(final LogLevel level, final DBConnection connection, final String event, final String message, final Throwable error);
/**
* Log a message and/or an error in the general context of TAP.
*
*
* One of the parameter is of type {@link Object}. This object can be used to provide more information to the log function
* in order to describe as much as possible the state and/or result event.
*
*
* List of all events sent by the library (case sensitive):
*
* - IDENT_USER (with a NULL "obj")
* - SYNC_INIT (with "obj" as an instance of {@link TAPParameters})
* - ASYNC_INIT (with a NULL "obj")
* - START (with "obj" as an instance of {@link TAPSyncJob})
* - UPLOADING (with "obj" as an instance of {@link TAPExecutionReport})
* - PARSING (with "obj" as an instance of {@link TAPExecutionReport})
* - START_DB_EXECUTION (with "obj" as an instance of {@link TAPExecutionReport})
* - WRITING_RESULT (with "obj" as an instance of {@link TAPExecutionReport})
* - RESULT_WRITTEN (with "obj" as an instance of {@link TAPExecutionReport})
* - START_STEP (with "obj" as an instance of {@link TAPExecutionReport})
* - END_EXEC (with "obj" as an instance of {@link TAPExecutionReport})
* - END_DB_EXECUTION (with "obj" as an instance of {@link TAPExecutionReport})
* - DROP_UPLOAD (with "obj" as an instance of {@link TAPExecutionReport})
* - TIME_OUT (with "obj" as an instance of {@link TAPSyncJob})
* - END (with "obj" as an instance of {@link TAPSyncJob})
*
*
* @param level Level of the log (info, warning, error, ...). SHOULD NOT be NULL, but if NULL anyway, the level SHOULD be considered as INFO
* @param obj Object providing more information about the event/object at the origin of this log. MAY be NULL
* @param event Event at the origin of this log or action currently executed by TAP while this log is sent. MAY be NULL
* @param message Message to log. MAY be NULL
* @param error Error/Exception to log. MAY be NULL
*
* @since 2.0
*/
public void logTAP(final LogLevel level, final Object obj, final String event, final String message, final Throwable error);
}