diff options
author | Endi S. Dewata <edewata@redhat.com> | 2017-05-26 00:13:10 +0200 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2017-05-26 22:12:48 +0200 |
commit | 37e6ba6d1fb24694c2744adbc27c78b749d7e35d (patch) | |
tree | f74c2bcbe44c563bbd446dbaea54e7a75a1a19cf /base/common/src | |
parent | 4d5ecb5dd3e1f4eabbe29ab2ddbfeb825f9f4233 (diff) | |
download | pki-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.java | 86 |
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; + } +} |