summaryrefslogtreecommitdiffstats
path: root/base/common/src
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2017-05-26 00:13:10 +0200
committerEndi S. Dewata <edewata@redhat.com>2017-05-26 22:12:48 +0200
commit37e6ba6d1fb24694c2744adbc27c78b749d7e35d (patch)
treef74c2bcbe44c563bbd446dbaea54e7a75a1a19cf /base/common/src
parent4d5ecb5dd3e1f4eabbe29ab2ddbfeb825f9f4233 (diff)
downloadpki-37e6ba6d1fb24694c2744adbc27c78b749d7e35d.tar.gz
pki-37e6ba6d1fb24694c2744adbc27c78b749d7e35d.tar.xz
pki-37e6ba6d1fb24694c2744adbc27c78b749d7e35d.zip
Added FULL_CRL_GENERATION audit event.
A new FULL_CRL_GENERATION audit event has been added which will be generated when full CRL generation is complete. https://pagure.io/dogtagpki/issue/2651 Change-Id: I74b083721e477ad72fe5a787935af617e89a6968
Diffstat (limited to 'base/common/src')
-rw-r--r--base/common/src/com/netscape/certsrv/logging/event/FullCRLGenerationEvent.java86
1 files changed, 86 insertions, 0 deletions
diff --git a/base/common/src/com/netscape/certsrv/logging/event/FullCRLGenerationEvent.java b/base/common/src/com/netscape/certsrv/logging/event/FullCRLGenerationEvent.java
new file mode 100644
index 000000000..9dd47dd45
--- /dev/null
+++ b/base/common/src/com/netscape/certsrv/logging/event/FullCRLGenerationEvent.java
@@ -0,0 +1,86 @@
+// --- BEGIN COPYRIGHT BLOCK ---
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// (C) 2017 Red Hat, Inc.
+// All rights reserved.
+// --- END COPYRIGHT BLOCK ---
+package com.netscape.certsrv.logging.event;
+
+import java.math.BigInteger;
+
+import com.netscape.certsrv.logging.AuditEvent;
+import com.netscape.certsrv.logging.ILogger;
+
+public class FullCRLGenerationEvent extends AuditEvent {
+
+ private static final long serialVersionUID = 1L;
+
+ public final static String LOGGING_PROPERTY =
+ "LOGGING_SIGNED_AUDIT_FULL_CRL_GENERATION";
+
+ public FullCRLGenerationEvent() {
+ super(LOGGING_PROPERTY);
+ }
+
+ public static FullCRLGenerationEvent createSuccessEvent(
+ String subjectID,
+ BigInteger crlNumber) {
+
+ FullCRLGenerationEvent event = new FullCRLGenerationEvent();
+
+ event.setAttribute("CRLnum", crlNumber);
+
+ event.setParameters(new Object[] {
+ subjectID,
+ ILogger.SUCCESS,
+ event.getAttributeList()
+ });
+
+ return event;
+ }
+
+ public static FullCRLGenerationEvent createSuccessEvent(
+ String subjectID,
+ String info) {
+
+ FullCRLGenerationEvent event = new FullCRLGenerationEvent();
+
+ event.setAttribute("Info", info);
+
+ event.setParameters(new Object[] {
+ subjectID,
+ ILogger.SUCCESS,
+ event.getAttributeList()
+ });
+
+ return event;
+ }
+
+ public static FullCRLGenerationEvent createFailureEvent(
+ String subjectID,
+ String reason) {
+
+ FullCRLGenerationEvent event = new FullCRLGenerationEvent();
+
+ event.setAttribute("FailureReason", reason);
+
+ event.setParameters(new Object[] {
+ subjectID,
+ ILogger.FAILURE,
+ event.getAttributeList()
+ });
+
+ return event;
+ }
+}