org.sidoh.wwf_api
Class StatefulApiProvider

java.lang.Object
  extended by org.sidoh.wwf_api.StatefulApiProvider

public class StatefulApiProvider
extends java.lang.Object

Ties together Communication, RequestGenerator, and ResponseParser. This implementation remembers the accessToken so that it doens't have to be passed to every call. Useful when not in a stateless environment.


Constructor Summary
StatefulApiProvider(java.lang.String accessToken)
           
 
Method Summary
 void createFacebookGame(long userId)
          Create a game versus a person with a particular facebook Id.
 void createRandomGame()
          Request the creation of a matchmaking game.
 void createZyngaGame(long userId)
          Create a game versus a person with a particular Zynga Id.
 java.util.List<java.lang.String> dictionaryLookup(java.util.List<java.lang.String> words)
          Check if the provided words are in the WWF dictionary
 org.sidoh.wwf_api.types.api.GameIndex getGameIndex()
          Get a list of games.
 org.sidoh.wwf_api.types.api.GameState getGameState(long gameId)
          Get all of the data associated with a particular game.
 java.util.List<org.sidoh.wwf_api.types.api.ChatMessage> getUnreadChats(long gameId)
          Return a list of chat messages assigned to a particular game
 org.sidoh.wwf_api.types.api.GameState makeMove(org.sidoh.wwf_api.types.api.GameState state, org.sidoh.wwf_api.types.api.MoveSubmission move)
          Submit a move.
 org.sidoh.wwf_api.types.api.ChatMessage submitChatMessage(long gameId, java.lang.String message)
          Submit a chat message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatefulApiProvider

public StatefulApiProvider(java.lang.String accessToken)
Method Detail

getUnreadChats

public java.util.List<org.sidoh.wwf_api.types.api.ChatMessage> getUnreadChats(long gameId)
Return a list of chat messages assigned to a particular game

Parameters:
gameId -
Returns:

getGameIndex

public org.sidoh.wwf_api.types.api.GameIndex getGameIndex()
Get a list of games.

Returns:

getGameState

public org.sidoh.wwf_api.types.api.GameState getGameState(long gameId)
Get all of the data associated with a particular game.

Parameters:
gameId -
Returns:

makeMove

public org.sidoh.wwf_api.types.api.GameState makeMove(org.sidoh.wwf_api.types.api.GameState state,
                                                      org.sidoh.wwf_api.types.api.MoveSubmission move)
Submit a move.

Parameters:
state -
move -
Returns:

createRandomGame

public void createRandomGame()
Request the creation of a matchmaking game.


createFacebookGame

public void createFacebookGame(long userId)
Create a game versus a person with a particular facebook Id.

Parameters:
userId -

createZyngaGame

public void createZyngaGame(long userId)
Create a game versus a person with a particular Zynga Id.

Parameters:
userId -

submitChatMessage

public org.sidoh.wwf_api.types.api.ChatMessage submitChatMessage(long gameId,
                                                                 java.lang.String message)
Submit a chat message

Parameters:
gameId -
message -
Returns:

dictionaryLookup

public java.util.List<java.lang.String> dictionaryLookup(java.util.List<java.lang.String> words)
Check if the provided words are in the WWF dictionary

Parameters:
words - a list of words to look up
Returns:
list of words that are NOT in the dictionary -- empty set if all are in the dictionary