Interface WatcherService


public interface WatcherService
A service for interacting with watchers
Since:
5.10
  • Method Details

    • isWatching

      boolean isWatching(@Nonnull IsWatchingRequest request)
      Checks if a watcher exists that matches the provided request
      Parameters:
      request - a request describing the watcher to match
      Returns:
      true if a watcher exists that matches the provided request, false otherwise
    • search

      @Nonnull Page<Watcher> search(@Nonnull WatcherSearchRequest request, @Nonnull PageRequest pageRequest)
      Search for watcher entities matching the criteria in the provided request
      Parameters:
      request - a request describing the watchers to search for
      pageRequest - the page request
      Returns:
      a page of watchers matching the criteria in the provided request
    • unwatch

      boolean unwatch(@Nonnull UnwatchRequest request)
      Removes a user as a watcher of the given watchable. If the user is not provided the authenticated user is used. If the user is not watching the watchable, this method will have no effect and return false.
      Parameters:
      request - a request describing the watcher to delete
      Returns:
      true if the watcher existed and was removed, false otherwise
    • watch

      @Nonnull Watcher watch(@Nonnull WatchRequest request)
      Adds a new user as a watcher. If the user is not provided, the authenticated user is used. If the user is already watching the watchable this method will simply return the corresponding watcher instance.
      Parameters:
      request - a request describing the watcher to create
      Returns:
      the created watcher