/**
* 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.exportimport.internal.lifecycle;
import com.liferay.exportimport.kernel.lar.PortletDataContext;
import com.liferay.exportimport.kernel.lifecycle.EventAwareExportImportLifecycleListener;
import com.liferay.exportimport.kernel.lifecycle.ExportImportLifecycleListener;
import com.liferay.exportimport.kernel.model.ExportImportConfiguration;
import com.liferay.portal.kernel.model.StagedModel;
import com.liferay.portal.security.permission.PermissionCacheUtil;
import com.liferay.portal.servlet.filters.cache.CacheUtil;
import org.osgi.service.component.annotations.Component;
/**
* @author Mate Thurzo
*/
@Component(immediate = true, service = ExportImportLifecycleListener.class)
public class CacheExportImportLifecycleListener
implements EventAwareExportImportLifecycleListener {
@Override
public boolean isParallel() {
return false;
}
@Override
public void onLayoutExportFailed(
PortletDataContext portletDataContext, Throwable throwable)
throws Exception {
}
@Override
public void onLayoutExportStarted(PortletDataContext portletDataContext)
throws Exception {
}
@Override
public void onLayoutExportSucceeded(PortletDataContext portletDataContext)
throws Exception {
}
@Override
public void onLayoutImportFailed(
PortletDataContext portletDataContext, Throwable throwable)
throws Exception {
}
@Override
public void onLayoutImportProcessFinished(
PortletDataContext portletDataContext) {
clearCache();
}
@Override
public void onLayoutImportStarted(PortletDataContext portletDataContext)
throws Exception {
}
@Override
public void onLayoutImportSucceeded(PortletDataContext portletDataContext)
throws Exception {
}
@Override
public void onLayoutLocalPublicationFailed(
ExportImportConfiguration exportImportConfiguration,
Throwable throwable)
throws Exception {
}
@Override
public void onLayoutLocalPublicationStarted(
ExportImportConfiguration exportImportConfiguration)
throws Exception {
}
@Override
public void onLayoutLocalPublicationSucceeded(
ExportImportConfiguration exportImportConfiguration)
throws Exception {
}
@Override
public void onLayoutRemotePublicationFailed(
ExportImportConfiguration exportImportConfiguration,
Throwable throwable)
throws Exception {
}
@Override
public void onLayoutRemotePublicationStarted(
ExportImportConfiguration exportImportConfiguration)
throws Exception {
}
@Override
public void onLayoutRemotePublicationSucceeded(
ExportImportConfiguration exportImportConfiguration)
throws Exception {
}
@Override
public void onPortletExportFailed(
PortletDataContext portletDataContext, Throwable throwable)
throws Exception {
}
@Override
public void onPortletExportStarted(PortletDataContext portletDataContext)
throws Exception {
}
@Override
public void onPortletExportSucceeded(PortletDataContext portletDataContext)
throws Exception {
}
@Override
public void onPortletImportFailed(
PortletDataContext portletDataContext, Throwable throwable)
throws Exception {
}
@Override
public void onPortletImportProcessFinished(
PortletDataContext portletDataContext) {
clearCache();
}
@Override
public void onPortletImportStarted(PortletDataContext portletDataContext)
throws Exception {
}
@Override
public void onPortletImportSucceeded(PortletDataContext portletDataContext)
throws Exception {
}
@Override
public void onPortletPublicationFailed(
ExportImportConfiguration exportImportConfiguration,
Throwable throwable)
throws Exception {
}
@Override
public void onPortletPublicationStarted(
ExportImportConfiguration exportImportConfiguration)
throws Exception {
}
@Override
public void onPortletPublicationSucceeded(
ExportImportConfiguration exportImportConfiguration)
throws Exception {
}
@Override
public void onStagedModelExportFailed(
PortletDataContext portletDataContext, StagedModel stagedModel,
Throwable throwable)
throws Exception {
}
@Override
public void onStagedModelExportStarted(
PortletDataContext portletDataContext, StagedModel stagedModel)
throws Exception {
}
@Override
public void onStagedModelExportSucceeded(
PortletDataContext portletDataContext, StagedModel stagedModel)
throws Exception {
}
@Override
public void onStagedModelImportFailed(
PortletDataContext portletDataContext, StagedModel stagedModel,
Throwable throwable)
throws Exception {
}
@Override
public void onStagedModelImportStarted(
PortletDataContext portletDataContext, StagedModel stagedModel)
throws Exception {
}
@Override
public void onStagedModelImportSucceeded(
PortletDataContext portletDataContext, StagedModel stagedModel)
throws Exception {
}
protected void clearCache() {
CacheUtil.clearCache();
PermissionCacheUtil.clearCache();
}
}