public class Chad extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ADMIN_LOGGED_IN |
| Constructor and Description |
|---|
Chad() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAdminUser(String username,
String password) |
void |
changePassword(String username,
String oldPassword,
String newPassword) |
String |
createPoll(String title,
String description,
boolean isSingleVote,
String[] choices)
Create a new poll.
|
void |
deleteAdminUser(String username) |
ChadPollResult |
getResult(String pollId) |
ChadPoll[] |
getStartedPolls() |
ChadPoll[] |
getStoppedPolls() |
boolean |
isEligibleForVoting(String pollId)
isEligibleForVoting method will check if the User is eligible for voting.
|
String[] |
listAdminUsers() |
ChadPoll[] |
listPolls() |
boolean |
login(String username,
String password) |
void |
logout() |
void |
startPoll(String pollId)
Start a poll.
|
void |
stopPoll(String pollId)
Stop a poll.
|
String |
vote(String pollId,
String[] choices)
Vote
|
public static final String ADMIN_LOGGED_IN
public String createPoll(String title, String description, boolean isSingleVote, String[] choices) throws ChadAuthenticationException, DuplicatePollException, ChadChoiceException
title - description - isSingleVote - choices - ChadAuthenticationException - If the invoking user is not authenticatedDuplicatePollException - If a poll with title title already existsChadChoiceException - If choices contains repeating items or
If the number of choices are 1 or lessIllegalArgumentException - If the title is null or empty and/orpublic void startPoll(String pollId) throws ChadAuthenticationException
pollId - ChadAuthenticationExceptionpublic void stopPoll(String pollId) throws ChadAuthenticationException
pollId - ChadAuthenticationExceptionpublic void addAdminUser(String username, String password) throws Exception
Exceptionpublic void changePassword(String username, String oldPassword, String newPassword) throws Exception
Exceptionpublic void logout()
public ChadPoll[] getStartedPolls()
public ChadPoll[] getStoppedPolls()
public ChadPoll[] listPolls()
public boolean isEligibleForVoting(String pollId) throws org.apache.axis2.AxisFault
pollId - org.apache.axis2.AxisFaultpublic String vote(String pollId, String[] choices) throws org.apache.axis2.AxisFault
pollId - choices - org.apache.axis2.AxisFaultpublic ChadPollResult getResult(String pollId)
pollId - Copyright © 2015 WSO2 Inc. All rights reserved.