final String boardName = getMandatoryParameter(params, "BoardName");
if (!Board.isNameValid(boardName)) {
throw new InvalidParameterException("BoardName parameter is not valid");
}
Board board;
synchronized(mFreetalk.getMessageManager()) {
try {
mFreetalk.getMessageManager().getBoardByName(boardName);
throw new InvalidParameterException("Board with same name already exists");
} catch (final NoSuchBoardException e) {
}
board = mFreetalk.getMessageManager().getOrCreateBoard(boardName);
}
// board can't be null when we come here
final SimpleFieldSet sfs = new SimpleFieldSet(true);
sfs.putOverwrite("Message", "CreateBoardReply");
sfs.putOverwrite("BoardCreated", "true");
sfs.putOverwrite("StoredBoardName", board.getName());
sfs.putOverwrite("ID", board.getID());
replysender.send(sfs);
} catch(final Exception e) {
final SimpleFieldSet sfs = new SimpleFieldSet(true);
sfs.putOverwrite("Message", "CreateBoardReply");