001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.audit;
016    
017    import com.liferay.portal.kernel.json.JSONException;
018    import com.liferay.portal.kernel.json.JSONObject;
019    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
020    import com.liferay.portal.kernel.util.ProxyFactory;
021    
022    import java.util.Date;
023    
024    /**
025     * @author Amos Fong
026     */
027    public class AuditMessageFactoryUtil {
028    
029            public static AuditMessageFactory getAuditMessageFactory() {
030                    PortalRuntimePermission.checkGetBeanProperty(
031                            AuditMessageFactoryUtil.class);
032    
033                    return _auditMessageFactory;
034            }
035    
036            public AuditMessage getAuditMessage(String message) throws JSONException {
037                    return getAuditMessageFactory().getAuditMessage(message);
038            }
039    
040            public AuditMessage getAuditMessage(
041                    String eventType, long companyId, long userId, String userName) {
042    
043                    return getAuditMessageFactory().getAuditMessage(
044                            eventType, companyId, userId, userName);
045            }
046    
047            public AuditMessage getAuditMessage(
048                    String eventType, long companyId, long userId, String userName,
049                    String className, String classPK) {
050    
051                    return getAuditMessageFactory().getAuditMessage(
052                            eventType, companyId, userId, userName, className, classPK);
053            }
054    
055            public AuditMessage getAuditMessage(
056                    String eventType, long companyId, long userId, String userName,
057                    String className, String classPK, String message) {
058    
059                    return getAuditMessageFactory().getAuditMessage(
060                            eventType, companyId, userId, userName, className, classPK,
061                            message);
062            }
063    
064            public AuditMessage getAuditMessage(
065                    String eventType, long companyId, long userId, String userName,
066                    String className, String classPK, String message, Date timestamp,
067                    JSONObject additionalInfo) {
068    
069                    return getAuditMessageFactory().getAuditMessage(
070                            eventType, companyId, userId, userName, className, classPK, message,
071                            timestamp, additionalInfo);
072            }
073    
074            public AuditMessage getAuditMessage(
075                    String eventType, long companyId, long userId, String userName,
076                    String className, String classPK, String message,
077                    JSONObject additionalInfo) {
078    
079                    return getAuditMessageFactory().getAuditMessage(
080                            eventType, companyId, userId, userName, className, classPK, message,
081                            additionalInfo);
082            }
083    
084            private static final AuditMessageFactory _auditMessageFactory =
085                    ProxyFactory.newServiceTrackedInstance(AuditMessageFactory.class);
086    
087    }