|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.moyoman.comm.client.CommandExecutor
Any class which implements this interface would be used by the client writer to communicate with the server. A single CommandExecutor object is used for all commands to a given server. Only direct method calls are supported now, but in the future, get() would take an argument indicating direct, remote protocol, CORBA, etc.
Field Summary | |
private static CommandExecutor |
ce
The CommandExecutor object. |
Constructor Summary | |
CommandExecutor()
|
Method Summary | |
abstract void |
deleteActiveGame(String name)
Delete a temporary game on the server. |
abstract void |
deleteSavedGame(String name)
Delete a game from permanent storage on the server. |
static CommandExecutor |
get()
Get the CommandExecutor object. |
protected abstract Color |
getColor(String id)
Get the color of the player associated with this game. |
abstract Debug[] |
getDebuggingInfo(String id,
String name,
DebugType[] types)
Get debugging information about a module from the server. |
abstract GameRecord |
getGameRecord(String id)
Get a game record from the server. |
protected abstract Handicap |
getHandicap(String id)
Get the handicap for this game. |
abstract String[] |
getLanguageNames()
Get all of the supported language names. |
abstract Stone |
getLastMoveKo(String id)
Get the score from the server. |
abstract String |
getMessage(String name)
Get the internationalized message of the given name. |
protected abstract Mode |
getMode(String id)
Get the mode for this game. |
abstract short |
getMoveNumber(String id)
Get the move number for the specified game. |
abstract MoveDescriptor |
getSuggestedMove(String id)
Get the suggested move from the server. |
abstract Stone[] |
getSuicideMoves(String id)
|
abstract Stone[] |
getSuperKoMoves(String id)
|
abstract boolean |
isActive(String id)
Determine if the game id is an active game. |
abstract String[] |
listActiveGames()
List games that are currently active on the server. |
abstract String[] |
listDebuggingModules(String id,
DebugType[] types)
An array of all of the modules which have debugging information. |
abstract String[] |
listSavedGames()
List games permanently stored on the server. |
abstract PlayerManager |
loadGame(String name)
Load a game from the server. |
abstract MoveDescriptor |
makeMove(String id,
Stone st)
Make a move. |
protected abstract String |
newGeneratedGame(Color color,
Handicap handicap,
Mode mode)
Create a new game on the server. |
protected abstract String |
newGeneratedGame(Color color,
Handicap handicap,
Mode mode,
Rules rules,
float komi)
Create a new game on the server. |
protected abstract String |
newValidatedGame(Color color,
Handicap handicap,
Mode mode)
Create a new game on the server. |
protected abstract String |
newValidatedGame(Color color,
Handicap handicap,
Mode mode,
Rules rules,
float komi)
Create a new game on the server. |
abstract void |
onExit()
This method is called before normal shutdown. |
abstract MoveDescriptor |
pass(String id)
Pass in the specified game. |
abstract void |
registerNonvalidatedPlayerFactory(NonvalidatedPlayerFactory nvpf)
|
abstract MoveDescriptor |
requestMove(String id)
Request a move. |
abstract BooleanResponse |
requestResignation(String id)
Request that the server resign. |
abstract void |
resignGame(String id)
Resign the specified game. |
abstract PlayerManager |
resumeGame()
Restart the most recent active game. |
abstract void |
saveGame(PlayerManager pm,
String name)
Save a game on the server. |
abstract void |
setLanguageName(String name)
Set the default language name. |
abstract void |
setProperties(String id,
Properties props)
Set the properties for the given id. |
abstract BooleanResponse |
takeBackMove(PlayerManager pm)
Take back a move in the specified game. |
abstract MoveDescriptor |
validateMove(String id,
Stone st)
Validate a move. |
protected abstract void |
writeLastGameInformation(String blackId,
String whiteId)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static CommandExecutor ce
Constructor Detail |
public CommandExecutor()
Method Detail |
public static CommandExecutor get() throws InternalErrorException
InternalErrorException.
InternalErrorException
public abstract void deleteSavedGame(String name) throws NoSuchDataException, InternalErrorException
name
- The name under which the game was saved.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract void deleteActiveGame(String name) throws NoSuchDataException, InternalErrorException
name
- The name under which the game was saved.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract Debug[] getDebuggingInfo(String id, String name, DebugType[] types) throws NoSuchDataException, InternalErrorException
id
- The game id.name
- The name of the module. One of the String objects
returned by the listDebuggingModules() method.types
- An array of DebugType objects supported by the caller.
NoSuchDataException
- Thrown if the game id or module name do not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract GameRecord getGameRecord(String id) throws NoSuchDataException, InternalErrorException
id
- The game id.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract Stone getLastMoveKo(String id) throws NoSuchDataException, InternalErrorException
id
- The game id.
Exception
- Thrown if the operation fails.
public abstract Score getScore(String id)
throws Exception;
NOT YET IMPLEMENTED
NoSuchDataException
InternalErrorException
public abstract Stone[] getSuicideMoves(String id) throws NoSuchDataException, InternalErrorException
NoSuchDataException
InternalErrorException
public abstract Stone[] getSuperKoMoves(String id) throws NoSuchDataException, InternalErrorException
NoSuchDataException
InternalErrorException
public abstract void setProperties(String id, Properties props) throws NoSuchDataException, InternalErrorException
id
- The game id.props
- The properties.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract MoveDescriptor getSuggestedMove(String id) throws NoSuchDataException, InternalErrorException
id
- The game id.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract boolean isActive(String id) throws InternalErrorException
id
- The game id.
InternalErrorException
- - Thrown if the operation fails for any reason.public abstract String[] listActiveGames() throws InternalErrorException
InternalErrorException
- Thrown if the operation fails for any reason.public abstract String[] listSavedGames() throws InternalErrorException
InternalErrorException
- Thrown if the operation fails for any reason.public abstract String[] listDebuggingModules(String id, DebugType[] types) throws NoSuchDataException, InternalErrorException
id
- The game id.types
- A filter which indicates the desired Debug types.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract PlayerManager loadGame(String name) throws NoSuchDataException, InternalErrorException
name
- The name of the game to be loaded.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract PlayerManager resumeGame() throws NoSuchDataException, InternalErrorException
Exception
- Thrown if the operation fails.
NoSuchDataException
- Thrown if there is no game to resume.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract BooleanResponse requestResignation(String id) throws NoSuchDataException, InternalErrorException
id
- The game id.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract void saveGame(PlayerManager pm, String name) throws NoSuchDataException, DataAlreadyExistsException, InternalErrorException
pm
- The PlayerManager to be savedname
- The name to save the game as.
NoSuchDataException
- Thrown if the game does not exist
DataAlreadyExistsException
- Thrown if the new id is already used.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract BooleanResponse takeBackMove(PlayerManager pm)
pm
- The PlayerManager for which the move is to be taken back.
public abstract short getMoveNumber(String id) throws InternalErrorException
id
- - The game id.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract String[] getLanguageNames() throws InternalErrorException
InternalErrorException
- Thrown if the operation fails for any reason.public abstract void setLanguageName(String name) throws NoSuchDataException, InternalErrorException
name
-
NoSuchDataException
- Thrown if the language name does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract String getMessage(String name) throws InternalErrorException
name
- The name of the message.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract MoveDescriptor makeMove(String id, Stone st) throws IllegalMoveException, NoSuchDataException, InternalErrorException
id
- The game id.st
- The stone to be played.
x or y parameters are out of range.
IllegalMoveException
- Thrown if the move is illegal.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract MoveDescriptor validateMove(String id, Stone st) throws IllegalMoveException, NoSuchDataException, InternalErrorException
id
- The game id.st
- The stone to be played.
x or y parameters are out of range.
IllegalMoveException
- Thrown if the move is illegal.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.protected abstract String newGeneratedGame(Color color, Handicap handicap, Mode mode, Rules rules, float komi) throws InternalErrorException
color
- The color of the client .handicap
- The handicap to be used. May be null for no handicap.mode
- One of BEST, FAST, or TOURNAMENT.rules
- The rule set, e.g, Japanese.komi
- The amount of the komi .
InternalErrorException
- Thrown if the operation fails for any reason.protected abstract String newGeneratedGame(Color color, Handicap handicap, Mode mode) throws InternalErrorException
color
- The color of the client .handicap
- The handicap to be used. May be null for no handicap.mode
- One of BEST, FAST, or TOURNAMENT.
InternalErrorException
- Thrown if the operation fails for any reason.protected abstract String newValidatedGame(Color color, Handicap handicap, Mode mode, Rules rules, float komi) throws InternalErrorException
color
- The color of the client .handicap
- The handicap to be used. May be null for no handicap.mode
- One of BEST, FAST, or TOURNAMENT.rules
- The rule set, e.g, Japanese.komi
- The amount of the komi .
InternalErrorException
- Thrown if the operation fails for any reason.protected abstract String newValidatedGame(Color color, Handicap handicap, Mode mode) throws InternalErrorException
color
- The color of the client .handicap
- The handicap to be used. May be null for no handicap.mode
- One of BEST, FAST, or TOURNAMENT.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract MoveDescriptor pass(String id) throws NoSuchDataException, InternalErrorException
id
- The game id.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract MoveDescriptor requestMove(String id) throws IllegalMoveException, NoSuchDataException, InternalErrorException
id
- The game id.
IllegalMoveException
- Thrown if the move is illegal.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract void resignGame(String id) throws NoSuchDataException, InternalErrorException
id
- The game id.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.protected abstract void writeLastGameInformation(String blackId, String whiteId)
protected abstract Color getColor(String id) throws NoSuchDataException, InternalErrorException
id
- The game id
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.protected abstract Handicap getHandicap(String id) throws NoSuchDataException, InternalErrorException
id
- The game id
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.protected abstract Mode getMode(String id) throws NoSuchDataException, InternalErrorException
id
- The game id
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract void registerNonvalidatedPlayerFactory(NonvalidatedPlayerFactory nvpf)
public abstract void onExit()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |