Package org.opencms.db
Interface I_CmsSubscriptionDriver
- All Known Implementing Classes:
CmsSubscriptionDriver
,CmsSubscriptionDriver
,CmsSubscriptionDriver
,CmsSubscriptionDriver
,CmsSubscriptionDriver
,CmsSubscriptionDriver
,CmsSubscriptionDriver
,CmsSubscriptionDriver
public interface I_CmsSubscriptionDriver
The interface for drivers handling subscriptions and user tracking.
- Since:
- 8.0.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The type ID to identify subscription driver implementations. -
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteVisits
(CmsDbContext dbc, String poolName, CmsVisitEntryFilter filter) Deletes visit entries matching the given filter.long
getDateLastVisitedBy
(CmsDbContext dbc, String poolName, CmsUser user, CmsResource resource) Returns the date when the resource was last visited by the user.Returns the SQL manager of this driver, if possible.initSqlManager
(String classname) Initializes the SQL manager for this driver.void
markResourceAsVisitedBy
(CmsDbContext dbc, String poolName, CmsResource resource, CmsUser user) Mark the given resource as visited by the user.readAllSubscribedResources
(CmsDbContext dbc, String poolName, CmsPrincipal principal) Returns all resources subscribed by the given user or group.readResourcesVisitedBy
(CmsDbContext dbc, String poolName, CmsVisitedByFilter filter) Returns the resources that were visited by a user set in the filter.readSubscribedDeletedResources
(CmsDbContext dbc, String poolName, CmsUser user, List<CmsGroup> groups, CmsResource parent, boolean includeSubFolders, long deletedFrom) Returns the subscribed history resources that were deleted.readSubscribedResources
(CmsDbContext dbc, String poolName, CmsSubscriptionFilter filter) Returns the resources that were subscribed by a user or group set in the filter.void
setSubscribedResourceAsDeleted
(CmsDbContext dbc, String poolName, CmsResource resource) Marks a subscribed resource as deleted.void
subscribeResourceFor
(CmsDbContext dbc, String poolName, CmsPrincipal principal, CmsResource resource) Subscribes the user or group to the resource.void
unsubscribeAllDeletedResources
(CmsDbContext dbc, String poolName, long deletedTo) Unsubscribes all deleted resources that were deleted before the specified time stamp.void
unsubscribeAllResourcesFor
(CmsDbContext dbc, String poolName, CmsPrincipal principal) Unsubscribes the principal from all resources.void
unsubscribeResourceFor
(CmsDbContext dbc, String poolName, CmsPrincipal principal, CmsResource resource) Unsubscribes the principal from the resource.void
unsubscribeResourceForAll
(CmsDbContext dbc, String poolName, CmsResource resource) Unsubscribes all groups and users from the resource.
-
Field Details
-
DRIVER_TYPE_ID
The type ID to identify subscription driver implementations.- See Also:
-
-
Method Details
-
deleteVisits
void deleteVisits(CmsDbContext dbc, String poolName, CmsVisitEntryFilter filter) throws CmsDataAccessException Deletes visit entries matching the given filter.- Parameters:
dbc
- the database contextpoolName
- the name of the database pool to use, ifnull
, the default pool is usedfilter
- the log entry filter- Throws:
CmsDataAccessException
- if something goes wrong
-
getDateLastVisitedBy
long getDateLastVisitedBy(CmsDbContext dbc, String poolName, CmsUser user, CmsResource resource) throws CmsException Returns the date when the resource was last visited by the user.- Parameters:
dbc
- the database contextpoolName
- the name of the database pool to useuser
- the user to check the dateresource
- the resource to check the date- Returns:
- the date when the resource was last visited by the user
- Throws:
CmsException
- if something goes wrong
-
getSqlManager
Returns the SQL manager of this driver, if possible.- Returns:
- an SQL manager
-
initSqlManager
Initializes the SQL manager for this driver.To obtain JDBC connections from different pools, further {online|offline|history} pool Urls have to be specified.
- Parameters:
classname
- the classname of the SQL manager- Returns:
- the SQL manager for this driver
-
markResourceAsVisitedBy
void markResourceAsVisitedBy(CmsDbContext dbc, String poolName, CmsResource resource, CmsUser user) throws CmsDataAccessException Mark the given resource as visited by the user.- Parameters:
dbc
- the database contextpoolName
- the name of the database pool to useresource
- the resource to mark as visiteduser
- the user that visited the resource- Throws:
CmsDataAccessException
- if something goes wrong
-
readAllSubscribedResources
List<CmsResource> readAllSubscribedResources(CmsDbContext dbc, String poolName, CmsPrincipal principal) throws CmsDataAccessException Returns all resources subscribed by the given user or group.- Parameters:
dbc
- the database contextpoolName
- the name of the database pool to useprincipal
- the principal to read the subscribed resources- Returns:
- all resources subscribed by the given user or group
- Throws:
CmsDataAccessException
- if something goes wrong
-
readResourcesVisitedBy
List<CmsResource> readResourcesVisitedBy(CmsDbContext dbc, String poolName, CmsVisitedByFilter filter) throws CmsDataAccessException Returns the resources that were visited by a user set in the filter.- Parameters:
dbc
- the database contextpoolName
- the name of the database pool to usefilter
- the filter that is used to get the visited resources- Returns:
- the resources that were visited by a user set in the filter
- Throws:
CmsDataAccessException
- if something goes wrong
-
readSubscribedDeletedResources
List<I_CmsHistoryResource> readSubscribedDeletedResources(CmsDbContext dbc, String poolName, CmsUser user, List<CmsGroup> groups, CmsResource parent, boolean includeSubFolders, long deletedFrom) throws CmsDataAccessException Returns the subscribed history resources that were deleted.- Parameters:
dbc
- the database contextpoolName
- the name of the database pool to useuser
- the user that subscribed to the resourcegroups
- the groups to check subscribed resources forparent
- the parent resource (folder) of the deleted resources, ifnull
all deleted resources will be returnedincludeSubFolders
- indicates if the sub folders of the specified folder path should be considered, toodeletedFrom
- the time stamp from which the resources should have been deleted- Returns:
- the subscribed history resources that were deleted
- Throws:
CmsDataAccessException
- if something goes wrong
-
readSubscribedResources
List<CmsResource> readSubscribedResources(CmsDbContext dbc, String poolName, CmsSubscriptionFilter filter) throws CmsDataAccessException Returns the resources that were subscribed by a user or group set in the filter.- Parameters:
dbc
- the database contextpoolName
- the name of the database pool to usefilter
- the filter that is used to get the subscribed resources- Returns:
- the resources that were subscribed by a user or group set in the filter
- Throws:
CmsDataAccessException
- if something goes wrong
-
setSubscribedResourceAsDeleted
void setSubscribedResourceAsDeleted(CmsDbContext dbc, String poolName, CmsResource resource) throws CmsDataAccessException Marks a subscribed resource as deleted.- Parameters:
dbc
- the database contextpoolName
- the name of the database pool to useresource
- the subscribed resource to mark as deleted- Throws:
CmsDataAccessException
- if something goes wrong
-
subscribeResourceFor
void subscribeResourceFor(CmsDbContext dbc, String poolName, CmsPrincipal principal, CmsResource resource) throws CmsDataAccessException Subscribes the user or group to the resource.- Parameters:
dbc
- the database contextpoolName
- the name of the database pool to useprincipal
- the principal that subscribes to the resourceresource
- the resource to subscribe to- Throws:
CmsDataAccessException
- if something goes wrong
-
unsubscribeAllDeletedResources
void unsubscribeAllDeletedResources(CmsDbContext dbc, String poolName, long deletedTo) throws CmsDataAccessException Unsubscribes all deleted resources that were deleted before the specified time stamp.- Parameters:
dbc
- the database contextpoolName
- the name of the database pool to usedeletedTo
- the time stamp to which the resources have been deleted- Throws:
CmsDataAccessException
- if something goes wrong
-
unsubscribeAllResourcesFor
void unsubscribeAllResourcesFor(CmsDbContext dbc, String poolName, CmsPrincipal principal) throws CmsDataAccessException Unsubscribes the principal from all resources.- Parameters:
dbc
- the database contextpoolName
- the name of the database pool to useprincipal
- the principal that unsubscribes from all resources- Throws:
CmsDataAccessException
- if something goes wrong
-
unsubscribeResourceFor
void unsubscribeResourceFor(CmsDbContext dbc, String poolName, CmsPrincipal principal, CmsResource resource) throws CmsDataAccessException Unsubscribes the principal from the resource.- Parameters:
dbc
- the database contextpoolName
- the name of the database pool to useprincipal
- the principal that unsubscribes from the resourceresource
- the resource to unsubscribe from- Throws:
CmsDataAccessException
- if something goes wrong
-
unsubscribeResourceForAll
void unsubscribeResourceForAll(CmsDbContext dbc, String poolName, CmsResource resource) throws CmsDataAccessException Unsubscribes all groups and users from the resource.- Parameters:
dbc
- the database contextpoolName
- the name of the database pool to useresource
- the resource to unsubscribe all groups and users from- Throws:
CmsDataAccessException
- if something goes wrong
-