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 Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      void clearCache​(Config config, Session session)
      Clears the cache for the given config and using the session for personalized content.
      java.util.Iterator<Config> getConfigs()
      Deprecated.
      java.util.Iterator<Config> getConfigs​(ResourceResolver resolver)
      Get the list of available configs.
      java.lang.Long getLatestTimestamp​(Config config, Session session)
      Returns the latest update timestamp for the given config and user (for personalized configs).
      java.lang.String getZip​(Resource config, java.util.Date ifModifiedSince, Session session)
      This method builds a zip file according to the given config, last modified date and session and returns a URI for identification.
      boolean hasUpdates​(Resource resource, java.util.Date ifModifiedSince)
      Checks if there are any updates for the given config by comparing to the last modified date.
      void sendZip​(Session session, java.io.OutputStream out, java.lang.String requestURI)
      Sets the correct content type and copies the zip file to the response's output stream.
      void sendZip​(Session session, HttpServletResponse response, java.lang.String requestURI)
      Sets the correct content type and copies the zip file to the response's output stream.
      void sendZip​(HttpServletResponse response, java.lang.String requestURI)
      Deprecated.
      boolean updateCache​(Config config, Session session)
      Update the cache for the given config and using the session for personalized content.
      void updateCache​(Resource resource, Session session)
      Update the cache for the given config resource and using the session for personalized content.
    • 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,
                           java.util.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

        java.lang.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
      • getZip

        java.lang.String getZip​(Resource config,
                                java.util.Date ifModifiedSince,
                                Session session)
                         throws RepositoryException,
                                java.io.IOException
        This method builds a zip file according to the given config, last modified date and session and returns a URI for identification. Use sendZip(javax.servlet.http.HttpServletResponse, java.lang.String) for actual delivery of the file.
        Parameters:
        config - The config resource
        ifModifiedSince - The last modified date
        session - The session
        Returns:
        Path to zip file
        Throws:
        java.io.IOException - if an I/O error occurrs.
        RepositoryException - if an error accessing the repository occurrs.
      • sendZip

        @Deprecated
        void sendZip​(HttpServletResponse response,
                     java.lang.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,
                     java.io.OutputStream out,
                     java.lang.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,
                     java.lang.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
        java.util.Iterator<Config> getConfigs()
        Deprecated.
        Get the list of available configs.
        Returns:
        The list of configs
      • getConfigs

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