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.audit;
16  
17  import com.liferay.portal.kernel.audit.AuditMessage;
18  import com.liferay.portal.kernel.audit.AuditMessageFactory;
19  import com.liferay.portal.kernel.json.JSONException;
20  import com.liferay.portal.kernel.json.JSONObject;
21  
22  import java.util.Date;
23  
24  /**
25   * <a href="AuditMessageFactoryImpl.java.html"><b><i>View Source</i></b></a>
26   *
27   * @author Amos Fong
28   */
29   public class AuditMessageFactoryImpl implements AuditMessageFactory {
30  
31      public AuditMessage getAuditMessage(String message) throws JSONException {
32          return new AuditMessage(message);
33      }
34  
35      public AuditMessage getAuditMessage(
36          String eventType, long companyId, long userId, String userName) {
37  
38          return new AuditMessage(eventType, companyId, userId, userName);
39      }
40  
41      public AuditMessage getAuditMessage(
42          String eventType, long companyId, long userId, String userName,
43          String className, String classPK) {
44  
45          return new AuditMessage(
46              eventType, companyId, userId, userName, className, classPK);
47      }
48  
49      public AuditMessage getAuditMessage(
50          String eventType, long companyId, long userId, String userName,
51          String className, String classPK, String message) {
52  
53          return new AuditMessage(
54              eventType, companyId, userId, userName, className, classPK,
55              message);
56      }
57  
58      public AuditMessage getAuditMessage(
59          String eventType, long companyId, long userId, String userName,
60          String className, String classPK, String message, Date timestamp,
61          JSONObject additionalInfo) {
62  
63          return new AuditMessage(
64              eventType, companyId, userId, userName, className, classPK, message,
65              timestamp, additionalInfo);
66      }
67  
68      public AuditMessage getAuditMessage(
69          String eventType, long companyId, long userId, String userName,
70          String className, String classPK, String message,
71          JSONObject additionalInfo) {
72  
73          return new AuditMessage(
74              eventType, companyId, userId, userName, className, classPK, message,
75              additionalInfo);
76      }
77  
78  }