Interface ContentSyncManager


  • public interface ContentSyncManager
    The ContentSyncManager listens for changes to content sync configurations stored in the repository and updates the zip content cache accordingly.
    • Method Detail

      • updateCache

        void updateCache​(Resource resource,
                         Session session)
        Update the cache for the given config resource and using the session for personalized content.
        Parameters:
        resource - The config resource
        session - The session
      • updateCache

        boolean updateCache​(Config config,
                            Session session)
        Update the cache for the given config and using the session for personalized content. If cached updated, create an update timestamp.
        Parameters:
        config - The config
        session - The session
        Returns:
        true if cache was filled, false otherwise
      • clearCache

        void clearCache​(Config config,
                        Session session)
        Clears the cache for the given config and using the session for personalized content.
        Parameters:
        config - The config
        session - The session
      • hasUpdates

        boolean hasUpdates​(Resource resource,
                           Date ifModifiedSince)
        Checks if there are any updates for the given config by comparing to the last modified date.
        Parameters:
        resource - The config's resource
        ifModifiedSince - The last modified date
        Returns:
        true when updates available, false otherwise
      • getLatestTimestamp

        Long getLatestTimestamp​(Config config,
                                Session session)
        Returns the latest update timestamp for the given config and user (for personalized configs).
        Parameters:
        config - The configuration
        session - The session
        Returns:
        Latest update timestamp or 0 if none exists
      • sendZip

        @Deprecated
        void sendZip​(HttpServletResponse response,
                     String requestURI)
        Deprecated.
        Sets the correct content type and copies the zip file to the response's output stream.
        Parameters:
        response - The response
        requestURI - Request URI of the zip file
      • sendZip

        void sendZip​(Session session,
                     OutputStream out,
                     String requestURI)
        Sets the correct content type and copies the zip file to the response's output stream.
        Parameters:
        session - The session
        out - The output to copy to
        requestURI - Request URI of the zip file.
      • sendZip

        void sendZip​(Session session,
                     HttpServletResponse response,
                     String requestURI)
        Sets the correct content type and copies the zip file to the response's output stream.
        Parameters:
        session - The session for reading the zip
        response - The response
        requestURI - Request URI of the zip file
      • getConfigs

        @Deprecated
        Iterator<Config> getConfigs()
        Deprecated.
        Get the list of available configs.
        Returns:
        The list of configs
      • getConfigs

        Iterator<Config> getConfigs​(ResourceResolver resolver)
        Get the list of available configs.
        Parameters:
        resolver - The resource resolver
        Returns:
        The list of configs