com.stackmob.sdkapi
Interface TwitterService


public interface TwitterService

The Twitter service.


Method Summary
 boolean createUserWithTwitter(String modelName, String smUsername, String token, String tokenSecret)
          Creates a user with the given StackMob username and Twitter token and token secret.
 String findAndVerifyUser(String modelName, String twUserId)
          Finds a StackMob user with the given Twitter user ID and then verifies the user's credentials are valid.
 String findAndVerifyUser(String modelName, String token, String tokenSecret)
          Finds a StackMob user with the given Twitter token and token secret and then verifies the user's credentials are valid.
 String findUsername(String modelName, String twUserId)
          Finds a StackMob username given the associated Twitter user ID.
 boolean linkUserWithTwitter(String modelName, String smUsername, String token, String tokenSecret)
          Links an existing user with the Twitter user identified by the given token and token secret.
 boolean updateStatus(String modelName, String smUsername, String statusMsg)
          Updates a user's Twitter status with the given message.
 boolean verifyCredentials(String modelName, String smUsername)
          Verifies a user's Twitter credentials.
 

Method Detail

createUserWithTwitter

boolean createUserWithTwitter(String modelName,
                              String smUsername,
                              String token,
                              String tokenSecret)
                              throws TwitterServiceException
Creates a user with the given StackMob username and Twitter token and token secret.

Parameters:
modelName - the name of the relevant object model; must be a type already declared for the current application
smUsername - the StackMob username
token - the Twitter token
tokenSecret - the Twitter token secret
Returns:
true if successful; false otherwise
Throws:
TwitterServiceException - if an exception has occurred in the Twitter service

linkUserWithTwitter

boolean linkUserWithTwitter(String modelName,
                            String smUsername,
                            String token,
                            String tokenSecret)
                            throws TwitterServiceException
Links an existing user with the Twitter user identified by the given token and token secret.

Parameters:
modelName - the name of the relevant object model; must be a type already declared for the current application
smUsername - the StackMob username
token - the Twitter token
tokenSecret - the Twitter token secret
Returns:
true if successful; false otherwise
Throws:
TwitterServiceException - if an exception has occurred in the Twitter service

findAndVerifyUser

String findAndVerifyUser(String modelName,
                         String token,
                         String tokenSecret)
                         throws TwitterServiceException
Finds a StackMob user with the given Twitter token and token secret and then verifies the user's credentials are valid.

Parameters:
modelName - the name of the relevant object model; must be a type already declared for the current application
token - the Twitter Token
tokenSecret - the Twitter token secret
Returns:
the StackMob username
Throws:
TwitterServiceException - if an exception has occurred in the Twitter service

findAndVerifyUser

String findAndVerifyUser(String modelName,
                         String twUserId)
                         throws TwitterServiceException
Finds a StackMob user with the given Twitter user ID and then verifies the user's credentials are valid.

Parameters:
modelName - the name of the relevant object model; must be a type already declared for the current application
twUserId - the Twitter user ID
Returns:
the StackMob username
Throws:
TwitterServiceException - if an exception has occurred in the Twitter service

findUsername

String findUsername(String modelName,
                    String twUserId)
                    throws TwitterServiceException
Finds a StackMob username given the associated Twitter user ID.

Parameters:
modelName - the name of the relevant object model; must be a type already declared for the current application
twUserId - the Twitter user ID
Returns:
the StackMob username
Throws:
TwitterServiceException - if an exception has occurred in the Twitter service

updateStatus

boolean updateStatus(String modelName,
                     String smUsername,
                     String statusMsg)
                     throws TwitterServiceException
Updates a user's Twitter status with the given message.

Parameters:
modelName - the name of the relevant object model; must be a type already declared for the current application
smUsername - the StackMob username
statusMsg - the status message
Returns:
true if successful; false otherwise
Throws:
TwitterServiceException - if an exception has occurred in the Twitter service

verifyCredentials

boolean verifyCredentials(String modelName,
                          String smUsername)
                          throws TwitterServiceException
Verifies a user's Twitter credentials.

Parameters:
modelName - the name of the relevant object model; must be a type already declared for the current application
smUsername - the StackMob username
Returns:
true if successful; false otherwise
Throws:
TwitterServiceException - if an exception has occurred in the Twitter service


Copyright © 2012 StackMob. All Rights Reserved.