public class ChadPersistenceManager extends Object
| Constructor and Description |
|---|
ChadPersistenceManager(ChadHibernateConfig hbConfig) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAdminUser(String username,
String password)
Add a new Administrator
|
void |
addPoll(ChadPoll poll)
Add a new Poll
|
void |
changeAdminPassword(String username,
String oldPassword,
String newPassword)
Change the password of the administrator
|
void |
deleteAdminUser(String username)
Delete an administrator
|
AdminUser |
getAdminUser(String username)
Get administrator
|
String[] |
getAdminUsernames()
Get all the usernames of administrators
|
ChadPoll[] |
getAllPolls()
Get all the polls in the system
|
ChadPoll |
getPoll(String pollId)
Retrieve a chad poll
|
ChadPollResult |
getPollResult(String pollId)
Get the result of a poll
|
void |
updatePoll(ChadPoll poll)
Update a poll
|
public ChadPersistenceManager(ChadHibernateConfig hbConfig)
public void addAdminUser(String username, String password) throws UserAlreadyExistsException
username - password - UserAlreadyExistsException - If an administrator with the name username
already existspublic void deleteAdminUser(String username)
username - public void addPoll(ChadPoll poll) throws DuplicatePollException
poll - DuplicatePollException - If a poll with the same Title already existspublic AdminUser getAdminUser(String username)
username - public void changeAdminPassword(String username, String oldPassword, String newPassword) throws ChadAuthenticationException
username - oldPassword - newPassword - ChadAuthenticationException - If the oldPassword is incorrectpublic ChadPoll getPoll(String pollId)
pollId - pollIdpublic String[] getAdminUsernames()
public ChadPoll[] getAllPolls()
public void updatePoll(ChadPoll poll)
poll - public ChadPollResult getPollResult(String pollId)
pollId - Copyright © 2015 WSO2 Inc. All rights reserved.