1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.kernel.audit;
16  
17  import com.liferay.portal.kernel.json.JSONException;
18  import com.liferay.portal.kernel.json.JSONObject;
19  
20  import java.util.Date;
21  
22  /**
23   * <a href="AuditMessageFactoryUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Amos Fong
26   */
27  public class AuditMessageFactoryUtil {
28  
29      public static AuditMessageFactory getAuditMessageFactory() {
30          return _auditMessageFactory;
31      }
32  
33      public AuditMessage getAuditMessage(String message) throws JSONException {
34          return getAuditMessageFactory().getAuditMessage(message);
35      }
36  
37      public AuditMessage getAuditMessage(
38          String eventType, long companyId, long userId, String userName) {
39  
40          return getAuditMessageFactory().getAuditMessage(
41              eventType, companyId, userId, userName);
42      }
43  
44      public AuditMessage getAuditMessage(
45          String eventType, long companyId, long userId, String userName,
46          String className, String classPK) {
47  
48          return getAuditMessageFactory().getAuditMessage(
49              eventType, companyId, userId, userName, className, classPK);
50      }
51  
52      public AuditMessage getAuditMessage(
53          String eventType, long companyId, long userId, String userName,
54          String className, String classPK, String message) {
55  
56          return getAuditMessageFactory().getAuditMessage(
57              eventType, companyId, userId, userName, className, classPK,
58              message);
59      }
60  
61      public AuditMessage getAuditMessage(
62          String eventType, long companyId, long userId, String userName,
63          String className, String classPK, String message, Date timestamp,
64          JSONObject additionalInfo) {
65  
66          return getAuditMessageFactory().getAuditMessage(
67              eventType, companyId, userId, userName, className, classPK, message,
68              timestamp, additionalInfo);
69      }
70  
71      public AuditMessage getAuditMessage(
72          String eventType, long companyId, long userId, String userName,
73          String className, String classPK, String message,
74          JSONObject additionalInfo) {
75  
76          return getAuditMessageFactory().getAuditMessage(
77              eventType, companyId, userId, userName, className, classPK, message,
78              additionalInfo);
79      }
80  
81      public void setAuditMessageFactory(
82          AuditMessageFactory auditMessageFactory) {
83  
84          _auditMessageFactory = auditMessageFactory;
85      }
86  
87      private static AuditMessageFactory _auditMessageFactory;
88  
89  }