Interface TwitterAccountService

All Known Implementing Classes:
TwitterAccountServiceImpl

public interface TwitterAccountService
  • Method Details

    • getTwitterAccounts

      List<TwitterAccount> getTwitterAccounts(String currentUser, int offset, int limit, boolean forceUpdate) throws IllegalAccessException
      Get available watched twitter accounts using offset and limit.
      Parameters:
      currentUser - user name attempting to access watched twitter accounts
      offset - Offset of result
      limit - Limit of result
      forceUpdate - force Load remote accounts or not.
      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

      List<TwitterAccount> getTwitterAccounts(int offset, int limit)
      Get available watched twitter accounts using offset and limit.
      Parameters:
      offset - Offset of result
      limit - Limit of result
      Returns:
      List of TwitterAccount
    • countTwitterAccounts

      int 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

      void 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.
      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
    • 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
    • setEventEnabledForAccount

      void setEventEnabledForAccount(long eventId, long accountId, boolean enabled, String currentUser) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Enables/disables watched account event
      Parameters:
      eventId - event Id
      accountId - account remote Id
      enabled - true to enabled, else false
      currentUser - user name attempting to enables/disables event.
      Throws:
      IllegalAccessException - when user is not authorized enables/disables account event
      org.exoplatform.commons.exception.ObjectNotFoundException
    • 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