Package com.day.cq.contentsync
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
Modifier and TypeMethodDescriptionvoidclearCache(Config config, Session session) Clears the cache for the given config and using the session for personalized content.Deprecated.getConfigs(ResourceResolver resolver) Get the list of available configs.getLatestTimestamp(Config config, Session session) Returns the latest update timestamp for the given config and user (for personalized configs).This method builds a zip file according to the given config, last modified date and session and returns a URI for identification.booleanhasUpdates(Resource resource, Date ifModifiedSince) Checks if there are any updates for the given config by comparing to the last modified date.voidsendZip(Session session, OutputStream out, String requestURI) Sets the correct content type and copies the zip file to the response's output stream.voidsendZip(Session session, HttpServletResponse response, String requestURI) Sets the correct content type and copies the zip file to the response's output stream.voidsendZip(HttpServletResponse response, String requestURI) Deprecated.booleanupdateCache(Config config, Session session) Update the cache for the given config and using the session for personalized content.voidupdateCache(Resource resource, Session session) Update the cache for the given config resource and using the session for personalized content.
-
Method Details
-
updateCache
Update the cache for the given config resource and using the session for personalized content.- Parameters:
resource- The config resourcesession- The session
-
updateCache
Update the cache for the given config and using the session for personalized content. If cached updated, create an update timestamp.- Parameters:
config- The configsession- The session- Returns:
- true if cache was filled, false otherwise
-
clearCache
Clears the cache for the given config and using the session for personalized content.- Parameters:
config- The configsession- The session
-
hasUpdates
Checks if there are any updates for the given config by comparing to the last modified date.- Parameters:
resource- The config's resourceifModifiedSince- The last modified date- Returns:
truewhen updates available,falseotherwise
-
getLatestTimestamp
Returns the latest update timestamp for the given config and user (for personalized configs).- Parameters:
config- The configurationsession- The session- Returns:
- Latest update timestamp or
0if none exists
-
getZip
String getZip(Resource config, Date ifModifiedSince, Session session) throws RepositoryException, IOException This method builds a zip file according to the given config, last modified date and session and returns a URI for identification. UsesendZip(javax.servlet.http.HttpServletResponse, java.lang.String)for actual delivery of the file.- Parameters:
config- The config resourceifModifiedSince- The last modified datesession- The session- Returns:
- Path to zip file
- Throws:
IOException- if an I/O error occurrs.RepositoryException- if an error accessing the repository occurrs.
-
sendZip
Deprecated.Sets the correct content type and copies the zip file to the response's output stream.- Parameters:
response- The responserequestURI- Request URI of the zip file
-
sendZip
Sets the correct content type and copies the zip file to the response's output stream.- Parameters:
session- The sessionout- The output to copy torequestURI- Request URI of the zip file.
-
sendZip
Sets the correct content type and copies the zip file to the response's output stream.- Parameters:
session- The session for reading the zipresponse- The responserequestURI- Request URI of the zip file
-
getConfigs
Deprecated.Get the list of available configs.- Returns:
- The list of configs
-
getConfigs
Get the list of available configs.- Parameters:
resolver- The resource resolver- Returns:
- The list of configs
-