* @return cookie value\r
*/\r
@Override\r
- public String getCookie(UserModel model) {\r
+ public synchronized String getCookie(UserModel model) {\r
if (!StringUtils.isEmpty(model.cookie)) {\r
return model.cookie;\r
}\r
* @return true if update is successful\r
*/\r
@Override\r
- public boolean updateUserModel(UserModel model) {\r
+ public synchronized boolean updateUserModel(UserModel model) {\r
return updateUserModel(model.username, model);\r
}\r
\r
* @return true if successful\r
*/\r
@Override\r
- public boolean deleteUserModel(UserModel model) {\r
+ public synchronized boolean deleteUserModel(UserModel model) {\r
return deleteUser(model.username);\r
}\r
\r
* @since 0.8.0\r
*/\r
@Override\r
- public List<String> getAllTeamNames() {\r
+ public synchronized List<String> getAllTeamNames() {\r
read();\r
List<String> list = new ArrayList<String>(teams.keySet());\r
Collections.sort(list);\r
* @since 0.8.0\r
*/\r
@Override\r
- public boolean updateTeamModel(TeamModel model) {\r
+ public synchronized boolean updateTeamModel(TeamModel model) {\r
return updateTeamModel(model.name, model);\r
}\r
\r
* @since 1.2.0\r
*/\r
@Override\r
- public boolean updateTeamModels(Collection<TeamModel> models) {\r
+ public synchronized boolean updateTeamModels(Collection<TeamModel> models) {\r
try {\r
read();\r
for (TeamModel team : models) {\r
* @since 0.8.0\r
*/\r
@Override\r
- public boolean updateTeamModel(String teamname, TeamModel model) {\r
+ public synchronized boolean updateTeamModel(String teamname, TeamModel model) {\r
TeamModel original = null;\r
try {\r
read();\r
* @since 0.8.0\r
*/\r
@Override\r
- public boolean deleteTeamModel(TeamModel model) {\r
+ public synchronized boolean deleteTeamModel(TeamModel model) {\r
return deleteTeam(model.name);\r
}\r
\r
* @since 0.8.0\r
*/\r
@Override\r
- public boolean deleteTeam(String teamname) {\r
+ public synchronized boolean deleteTeam(String teamname) {\r
try {\r
// Read realm file\r
read();\r
* @return list of all usernames\r
*/\r
@Override\r
- public List<String> getAllUsernames() {\r
+ public synchronized List<String> getAllUsernames() {\r
read();\r
List<String> list = new ArrayList<String>(users.keySet());\r
Collections.sort(list);\r