com.adobe.cq.screens.channel.ChannelService Maven / Gradle / Ivy
/*************************************************************************
*
* ADOBE CONFIDENTIAL
* __________________
*
* Copyright 2016 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.channel;
import java.util.Iterator;
import java.util.List;
import aQute.bnd.annotation.ProviderType;
import org.apache.sling.api.resource.PersistenceException;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import javax.jcr.RepositoryException;
/**
* Manages the channels in the repository.
*/
@ProviderType
public interface ChannelService {
/**
* Returns the displays the channel is assigned to
* @param resolver The resource resolver
* @param channel the channel resource to get the display for
* @return the displays or {@code null}
*/
@CheckForNull
@Deprecated
Iterator getDisplays(@Nonnull ResourceResolver resolver, @Nonnull Resource channel);
/**
* Returns the channel assignments the channel is assigned to
* @param resolver The resource resolver
* @param channel the channel resource to get the channel assignments for
* @return the assignments or {@code null}
*/
@CheckForNull
@Deprecated
Iterator getChannelAssignments(@Nonnull ResourceResolver resolver, @Nonnull Resource channel);
/**
* Deletes the channel assignments for that channel on all the specified displays.
* @param resolver The resource resolver
* @param channel The channel to remove the assignments for
* @param displays The displays we want to remove the assignment on
* @throws PersistenceException if the deletion fails
* @throws RepositoryException if there is a repository exception
*/
void unassignFromDisplays(@Nonnull ResourceResolver resolver, @Nonnull Resource channel, @Nonnull List displays) throws PersistenceException, RepositoryException;
}