KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > pentaho > core > audit > AuditEntry


1 /*
2  * Copyright 2006 Pentaho Corporation. All rights reserved.
3  * This software was developed by Pentaho Corporation and is provided under the terms
4  * of the Mozilla Public License, Version 1.1, or any later version. You may not use
5  * this file except in compliance with the license. If you need a copy of the license,
6  * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
7  * BI Platform. The Initial Developer is Pentaho Corporation.
8  *
9  * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11  * the license for the specific language governing your rights and limitations.
12  *
13  * @created Mar 21, 2005
14  * @author Marc Batchelor
15  */

16
17 package org.pentaho.core.audit;
18
19 import java.math.*;
20
21 import org.apache.commons.logging.Log;
22 import org.apache.commons.logging.LogFactory;
23 import org.pentaho.core.system.*;
24
25 /**
26  * @author mbatchel
27  *
28  * TODO To change the template for this generated type comment go to Window -
29  * Preferences - Java - Code Style - Code Templates
30  */

31 public class AuditEntry {
32
33     private static IAuditEntry auditEntry;
34
35     private static final Log logger = LogFactory.getLog(AuditEntry.class);
36
37     static {
38         try {
39             String JavaDoc auditClass = PentahoSystem.getSystemSetting("objects/IAuditEntry", "org.pentaho.core.audit.AuditFileEntry"); //$NON-NLS-1$ //$NON-NLS-2$
40
Object JavaDoc object = null;
41             Class JavaDoc componentClass = Class.forName(auditClass);
42             object = componentClass.newInstance();
43             auditEntry = (IAuditEntry) object;
44         } catch (Exception JavaDoc ex) {
45             logger.error(ex);
46             throw new ExceptionInInitializerError JavaDoc(ex);
47         }
48     }
49
50     public static void auditJobDuration(String JavaDoc jobId, String JavaDoc instId, String JavaDoc objId, String JavaDoc objType, String JavaDoc actor, String JavaDoc messageType, String JavaDoc messageName, String JavaDoc messageTxtValue, BigDecimal duration) throws AuditException {
51
52         auditAll(jobId, instId, objId, objType, actor, messageType, messageName, messageTxtValue, null, duration);
53
54     }
55
56     public static void auditAll(String JavaDoc jobId, String JavaDoc instId, String JavaDoc objId, String JavaDoc objType, String JavaDoc actor, String JavaDoc messageType, String JavaDoc messageName, String JavaDoc messageTxtValue, BigDecimal messageNumValue, BigDecimal duration) throws AuditException {
57         auditEntry.auditAll(jobId, instId, objId, objType, actor, messageType, messageName, messageTxtValue, messageNumValue, duration);
58     }
59
60     public static void auditJobTxtValue(String JavaDoc jobId, String JavaDoc instId, String JavaDoc objId, String JavaDoc objType, String JavaDoc actor, String JavaDoc messageType, String JavaDoc messageName, String JavaDoc messageTxtValue) throws AuditException {
61         auditAll(jobId, instId, objId, objType, actor, messageType, messageName, messageTxtValue, null, null);
62     }
63
64     public static void auditJobNumValue(String JavaDoc jobId, String JavaDoc instId, String JavaDoc objId, String JavaDoc objType, String JavaDoc actor, String JavaDoc messageType, String JavaDoc messageName, BigDecimal messageNumValue) throws AuditException {
65         auditAll(jobId, instId, objId, objType, actor, messageType, messageName, null, messageNumValue, null);
66
67     }
68
69 }
70
Popular Tags