com.adobe.cq.screens.visitor.OfflineResourceVisitor Maven / Gradle / Ivy
/*************************************************************************
*
* ADOBE CONFIDENTIAL
* __________________
*
* Copyright 2019 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
************************************************************************/
package com.adobe.cq.screens.visitor;
import javax.annotation.Nonnull;
import javax.jcr.Node;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ValueMap;
import com.day.cq.dam.api.Asset;
import com.day.cq.dam.api.Rendition;
import com.day.cq.wcm.api.Page;
import aQute.bnd.annotation.ProviderType;
/**
* A resource visitor class used to go through the Screens resources for an offline use case
*/
@ProviderType
public interface OfflineResourceVisitor {
/**
* Accept the main resource.
*
* @param resource The main resource to start from
*/
void accept(@Nonnull Resource resource);
/**
* Visit the specified path for offline handling
*
* @param path The path to visit
*/
void visit(@Nonnull String path);
/**
* Visit the specified path for offline handling
*
* @param path The path to visit
* @param properties The properties of the resource from the path
*/
void visit(@Nonnull String path, @Nonnull ValueMap properties);
/**
* Visit the specified resource for offline handling
*
* @param resource The resource to visit
*/
void visit(@Nonnull Resource resource);
/**
* Visit the specified page for offline handling
*
* @param page The page to visit
*/
void visit(@Nonnull Page page);
/**
* Visit the specified asset for offline handling
*
* @param asset The asset to visit
*/
void visit(@Nonnull Asset asset);
/**
* Visit the specified rendition for offline handling
*
* @param rendition The rendition to visit
*/
void visit(@Nonnull Rendition rendition);
/**
* Visit the specified node for offline handling
*
* @param node The node to visit
*/
void visit(@Nonnull Node node);
/**
* Register a new resource handler in the visitor
*
* @param handler the handler to register
*/
void addResourceHandler(@Nonnull OfflineResourceHandler handler);
/**
* The page (i.e. channel) that serves as context to generate the offline data
*
* @return The page context
*/
Page getContext();
/**
* Remove resource handler in the visitor
*
* @param resourceType the type to remove
*/
void removeResourceHandler(@Nonnull String resourceType);
}