/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library 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 Lesser General Public License for more
* details.
*/
package com.liferay.portal.security.audit.internal;
import com.liferay.portal.kernel.audit.AuditMessage;
import com.liferay.portal.kernel.audit.AuditMessageFactory;
import com.liferay.portal.kernel.json.JSONException;
import com.liferay.portal.kernel.json.JSONObject;
import java.util.Date;
import org.osgi.service.component.annotations.Component;
/**
* @author Amos Fong
*/
@Component(immediate = true, service = AuditMessageFactory.class)
public class AuditMessageFactoryImpl implements AuditMessageFactory {
@Override
public AuditMessage getAuditMessage(String message) throws JSONException {
return new AuditMessage(message);
}
@Override
public AuditMessage getAuditMessage(
String eventType, long companyId, long userId, String userName) {
return new AuditMessage(eventType, companyId, userId, userName);
}
@Override
public AuditMessage getAuditMessage(
String eventType, long companyId, long userId, String userName,
String className, String classPK) {
return new AuditMessage(
eventType, companyId, userId, userName, className, classPK);
}
@Override
public AuditMessage getAuditMessage(
String eventType, long companyId, long userId, String userName,
String className, String classPK, String message) {
return new AuditMessage(
eventType, companyId, userId, userName, className, classPK,
message);
}
@Override
public AuditMessage getAuditMessage(
String eventType, long companyId, long userId, String userName,
String className, String classPK, String message, Date timestamp,
JSONObject additionalInfo) {
return new AuditMessage(
eventType, companyId, userId, userName, className, classPK, message,
timestamp, additionalInfo);
}
@Override
public AuditMessage getAuditMessage(
String eventType, long companyId, long userId, String userName,
String className, String classPK, String message,
JSONObject additionalInfo) {
return new AuditMessage(
eventType, companyId, userId, userName, className, classPK, message,
additionalInfo);
}
}