All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.adobe.cq.screens.assignment.AssignmentResolver Maven / Gradle / Ivy

/*************************************************************************
 *
 * ADOBE CONFIDENTIAL
 * __________________
 *
 *  Copyright 2017 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.assignment;

import aQute.bnd.annotation.ConsumerType;

import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Iterator;

/**
 * An interface that allows defining a new class that manages the assignments between Display/Schedules
 * and Schedules/Channels. The assignment resolver is tied to a specific assignment resource type and contains
 * all the logic to travers the repository up or down the relationship tree, and thus allows easy extension.
 * Resolvers will be automatically loaded by the AssignmentService that is the entry point for all assignment
 * resolving methods.
 */
@ConsumerType
public interface AssignmentResolver {

    /**
     * Returns the supported resource type for this assignment resolver
     * @return the supported resource type
     */
    String getSupportedResourceType();

    /**
     * Resolves the referenced resource.
     * @param  assignment   The assignment resource
     * @return  The resolved resource, or null
     */
    @Nullable
    Resource resolveEntity(@Nonnull Resource assignment);

    /**
     * Resolves the referenced resource.
     * @param  assignment   The assignment resource
     * @param  context      Resource that defines the context in which to resolve the referenced resource
     * @return  The resolved resource, or null
     */
    @Nullable
    Resource resolveEntity(@Nonnull Resource assignment, Resource context);

    /**
     * Find the displays that point to the specified assignment.
     * @param  assignment   The assignment resource
     * @return  The displays that point to this assignment
     */
    @Nonnull
    Iterator findDisplaysForAssignment(@Nonnull Resource assignment);

    /**
     * Find the assignments that reference the specified resource.
     * @param  resource The referenced resource
     * @return  The assignment that reference that entity
     */
    @Nonnull
    Iterator findAssignmentsForEntity(@Nonnull Resource resource);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy