Interface TwitterService

All Known Implementing Classes:
TwitterServiceImpl

@Service public interface TwitterService
  • Method Details

    • getTwitterAccounts

      org.springframework.data.domain.Page<TwitterAccount> getTwitterAccounts(String currentUser, org.springframework.data.domain.Pageable pageable) throws IllegalAccessException
      Get available watched twitter accounts using page.
      Parameters:
      currentUser - user name attempting to access watched twitter accounts
      pageable - Pageable the page to be returned.
      Returns:
      List of TwitterAccount
      Throws:
      IllegalAccessException - when user is not authorized to access watched twitter accounts
    • getTwitterAccountById

      TwitterAccount getTwitterAccountById(long accountId)
      Retrieves a watched twitter account identified by its technical identifier.
      Parameters:
      accountId - watched twitter account technical identifier
      Returns:
      found TwitterAccount
    • getTwitterAccountById

      TwitterAccount getTwitterAccountById(long accountId, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Retrieves a watched twitter account identified by its technical identifier accessed by a user
      Parameters:
      accountId - watched twitter account technical identifier
      username - user name attempting to access watched twitter account
      Returns:
      found TwitterAccount
      Throws:
      IllegalAccessException - when user is not authorized to access watched twitter account
      org.exoplatform.commons.exception.ObjectNotFoundException - twitter account not found
    • getTwitterAccounts

      org.springframework.data.domain.Page<TwitterAccount> getTwitterAccounts(org.springframework.data.domain.Pageable pageable)
      Get available watched twitter accounts using page.
      Parameters:
      pageable - Pageable the page to be returned.
      Returns:
      List of TwitterAccount
    • getTwitterAccounts

      List<TwitterAccount> getTwitterAccounts()
      Get all watched twitter accounts.
      Returns:
      List of TwitterAccount
    • countTwitterAccounts

      long countTwitterAccounts(String currentUser) throws IllegalAccessException
      Count all watched twitter accounts
      Parameters:
      currentUser - User name accessing watched twitter accounts
      Returns:
      Watched twitter accounts count
      Throws:
      IllegalAccessException - when user is not authorized to get watched twitter accounts
    • addTwitterAccount

      TwitterAccount addTwitterAccount(String twitterUsername, String currentUser) throws org.exoplatform.commons.ObjectAlreadyExistsException, IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Add watched Twitter account.
      Parameters:
      twitterUsername - Twitter username
      currentUser - user name attempting to add watched Twitter account.
      Returns:
      TwitterAccount
      Throws:
      org.exoplatform.commons.ObjectAlreadyExistsException - when watched Twitter account already exists
      IllegalAccessException - when user is not authorized to add watched Twitter account.
      org.exoplatform.commons.exception.ObjectNotFoundException - when the Twitter account identified by its technical name is not found
    • deleteTwitterAccount

      void deleteTwitterAccount(long twitterAccountId, String currentUser) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      delete watched Twitter account
      Parameters:
      twitterAccountId - twitter remote account id
      currentUser - user name attempting to delete watched Twitter account
      Throws:
      IllegalAccessException - when user is not authorized to delete the watched Twitter account
      org.exoplatform.commons.exception.ObjectNotFoundException
    • addTweetToWatch

      Tweet addTweetToWatch(String tweetLink)
      Add watched Tweet.
      Parameters:
      tweetLink - Tweet link
      Returns:
      TwitterAccount
    • getTweets

      org.springframework.data.domain.Page<Tweet> getTweets(org.springframework.data.domain.Pageable pageable)
      Get available watched tweets using page.
      Parameters:
      pageable - Pageable the page to be returned.
      Returns:
      List of Tweet
    • getTweets

      List<Tweet> getTweets()
      Get all watched tweets.
      Returns:
      List of Tweet
    • countTweets

      long countTweets()
      Count all watched tweets
      Returns:
      Watched tweets count
    • getTweetByLink

      Tweet getTweetByLink(String tweetLink)
      Retrieves a watched tweet identified by its link
      Parameters:
      tweetLink - watched tweet link
      Returns:
      found TwitterAccount
    • deleteTweet

      void deleteTweet(long tweetId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      delete watched Tweet
      Parameters:
      tweetId - tweet Id
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • deleteTweetById

      void deleteTweetById(long tweetId)
    • saveTwitterBearerToken

      void saveTwitterBearerToken(String bearerToken, String currentUser) throws IllegalAccessException
      Saves Twitter bearer token
      Parameters:
      bearerToken - twitter bearer token
      currentUser - user name attempting to save Twitter bearer token
      Throws:
      IllegalAccessException - when user is not authorized save Twitter bearer token
    • deleteTwitterBearerToken

      void deleteTwitterBearerToken(String currentUser) throws IllegalAccessException
      Deletes Twitter bearer token
      Parameters:
      currentUser - user name attempting to delete Twitter bearer token
      Throws:
      IllegalAccessException - when user is not authorized to delete Twitter bearer token
    • getTwitterBearerToken

      String getTwitterBearerToken(String currentUser) throws IllegalAccessException
      gets Twitter bearer token
      Parameters:
      currentUser - user name attempting to access Twitter bearer token
      Returns:
      Twitter bearer token
      Throws:
      IllegalAccessException - when user is not authorized to access Twitter bearer token
    • getTwitterBearerToken

      String getTwitterBearerToken()
      gets Twitter bearer token
      Returns:
      Twitter bearer token
    • updateAccountLastMentionTweetId

      void updateAccountLastMentionTweetId(long accountId, long lastMentionTweetId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Update twitter account last mention tweet Id.
      Parameters:
      accountId - account Id
      lastMentionTweetId - last mention Tweet Id
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the Twitter account identified by its technical name is not found
    • updateTweetReactions

      void updateTweetReactions(long tweetId, Set<String> likers, Set<String> retweeters) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Update tweet with last reactions.
      Parameters:
      tweetId - tweetId
      likers - tweet likers
      retweeters - tweet retweeters
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the tweet identified by its technical id is not found