summaryrefslogtreecommitdiffstats
path: root/base/common
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2017-05-18 19:38:20 +0200
committerEndi S. Dewata <edewata@redhat.com>2017-05-26 22:12:47 +0200
commite3f64ea8ca4ec231a954076a7f6b05dfc626ff1b (patch)
treeebd22b0d5a74eb4f59799adc950818bd01f0f4e9 /base/common
parent2866f6195eb49012cf7c42089a9fbf1be819129a (diff)
downloadpki-e3f64ea8ca4ec231a954076a7f6b05dfc626ff1b.tar.gz
pki-e3f64ea8ca4ec231a954076a7f6b05dfc626ff1b.tar.xz
pki-e3f64ea8ca4ec231a954076a7f6b05dfc626ff1b.zip
Added DELTA_CRL_GENERATION audit event.
A new DELTA_CRL_GENERATION audit event has been added which will be generated when delta CRL generation is complete. https://pagure.io/dogtagpki/issue/2651 Change-Id: Ic4759ac2d90b6915443587708292d0f51e11345f
Diffstat (limited to 'base/common')
-rw-r--r--base/common/src/com/netscape/certsrv/logging/event/DeltaCRLGenerationEvent.java86
1 files changed, 86 insertions, 0 deletions
diff --git a/base/common/src/com/netscape/certsrv/logging/event/DeltaCRLGenerationEvent.java b/base/common/src/com/netscape/certsrv/logging/event/DeltaCRLGenerationEvent.java
new file mode 100644
index 000000000..ba04a332a
--- /dev/null
+++ b/base/common/src/com/netscape/certsrv/logging/event/DeltaCRLGenerationEvent.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 DeltaCRLGenerationEvent extends AuditEvent {
+
+ private static final long serialVersionUID = 1L;
+
+ public final static String LOGGING_PROPERTY =
+ "LOGGING_SIGNED_AUDIT_DELTA_CRL_GENERATION";
+
+ public DeltaCRLGenerationEvent() {
+ super(LOGGING_PROPERTY);
+ }
+
+ public static DeltaCRLGenerationEvent createSuccessEvent(
+ String subjectID,
+ BigInteger crlNumber) {
+
+ DeltaCRLGenerationEvent event = new DeltaCRLGenerationEvent();
+
+ event.setAttribute("CRLnum", crlNumber);
+
+ event.setParameters(new Object[] {
+ subjectID,
+ ILogger.SUCCESS,
+ event.getAttributeList()
+ });
+
+ return event;
+ }
+
+ public static DeltaCRLGenerationEvent createSuccessEvent(
+ String subjectID,
+ String info) {
+
+ DeltaCRLGenerationEvent event = new DeltaCRLGenerationEvent();
+
+ event.setAttribute("Info", info);
+
+ event.setParameters(new Object[] {
+ subjectID,
+ ILogger.SUCCESS,
+ event.getAttributeList()
+ });
+
+ return event;
+ }
+
+ public static DeltaCRLGenerationEvent createFailureEvent(
+ String subjectID,
+ String reason) {
+
+ DeltaCRLGenerationEvent event = new DeltaCRLGenerationEvent();
+
+ event.setAttribute("FailureReason", reason);
+
+ event.setParameters(new Object[] {
+ subjectID,
+ ILogger.FAILURE,
+ event.getAttributeList()
+ });
+
+ return event;
+ }
+}