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

com.composum.ai.backend.slingbase.PageCachedValueService Maven / Gradle / Ivy

Go to download

Common Functionality for Composum AI specific to Sling but would be useable in both Composum and AEM and similar.

There is a newer version: 1.2.1
Show newest version
package com.composum.ai.backend.slingbase;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

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

/**
 * Service to cache some values that depend on a page content but are computationally intensive to calculate,
 * like the markdown representation or embeddings or a machine generated summary.
 * The values are not stored in the page itself but in a separate tree at a location that is configurable.
 */
public interface PageCachedValueService {

    /**
     * Writes a value that should be cached with that property name to the cache.
     */
    void putPageCachedValue(@Nonnull String propertyName, @Nonnull Resource resource, @Nonnull String value);

    /**
     * Reads a value that was cached with that property name from the cache.
     */
    @Nullable
    String getPageCachedValue(@Nonnull String propertyName, @Nonnull Resource resource);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy