diff options
author | James Moger <james.moger@gitblit.com> | 2014-01-28 13:41:22 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-01-28 13:41:22 -0500 |
commit | ec24beaa1a1d1cfcf2252cd39aaba5a76905ed63 (patch) | |
tree | b271e0c9170ef2bdb8c02e026fc2e4e6c53ceaaf /src/main | |
parent | 7ab32b65fcb20ca68d7afc357befb3a34de662bf (diff) | |
download | gitblit-ec24beaa1a1d1cfcf2252cd39aaba5a76905ed63.tar.gz gitblit-ec24beaa1a1d1cfcf2252cd39aaba5a76905ed63.zip |
issue-323: Synchronize all user service methods
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/gitblit/ConfigUserService.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/main/java/com/gitblit/ConfigUserService.java b/src/main/java/com/gitblit/ConfigUserService.java index e8652252..a2a3277e 100644 --- a/src/main/java/com/gitblit/ConfigUserService.java +++ b/src/main/java/com/gitblit/ConfigUserService.java @@ -133,7 +133,7 @@ public class ConfigUserService implements IUserService { * @return cookie value
*/
@Override
- public String getCookie(UserModel model) {
+ public synchronized String getCookie(UserModel model) {
if (!StringUtils.isEmpty(model.cookie)) {
return model.cookie;
}
@@ -195,7 +195,7 @@ public class ConfigUserService implements IUserService { * @return true if update is successful
*/
@Override
- public boolean updateUserModel(UserModel model) {
+ public synchronized boolean updateUserModel(UserModel model) {
return updateUserModel(model.username, model);
}
@@ -325,7 +325,7 @@ public class ConfigUserService implements IUserService { * @return true if successful
*/
@Override
- public boolean deleteUserModel(UserModel model) {
+ public synchronized boolean deleteUserModel(UserModel model) {
return deleteUser(model.username);
}
@@ -372,7 +372,7 @@ public class ConfigUserService implements IUserService { * @since 0.8.0
*/
@Override
- public List<String> getAllTeamNames() {
+ public synchronized List<String> getAllTeamNames() {
read();
List<String> list = new ArrayList<String>(teams.keySet());
Collections.sort(list);
@@ -447,7 +447,7 @@ public class ConfigUserService implements IUserService { * @since 0.8.0
*/
@Override
- public boolean updateTeamModel(TeamModel model) {
+ public synchronized boolean updateTeamModel(TeamModel model) {
return updateTeamModel(model.name, model);
}
@@ -459,7 +459,7 @@ public class ConfigUserService implements IUserService { * @since 1.2.0
*/
@Override
- public boolean updateTeamModels(Collection<TeamModel> models) {
+ public synchronized boolean updateTeamModels(Collection<TeamModel> models) {
try {
read();
for (TeamModel team : models) {
@@ -485,7 +485,7 @@ public class ConfigUserService implements IUserService { * @since 0.8.0
*/
@Override
- public boolean updateTeamModel(String teamname, TeamModel model) {
+ public synchronized boolean updateTeamModel(String teamname, TeamModel model) {
TeamModel original = null;
try {
read();
@@ -514,7 +514,7 @@ public class ConfigUserService implements IUserService { * @since 0.8.0
*/
@Override
- public boolean deleteTeamModel(TeamModel model) {
+ public synchronized boolean deleteTeamModel(TeamModel model) {
return deleteTeam(model.name);
}
@@ -526,7 +526,7 @@ public class ConfigUserService implements IUserService { * @since 0.8.0
*/
@Override
- public boolean deleteTeam(String teamname) {
+ public synchronized boolean deleteTeam(String teamname) {
try {
// Read realm file
read();
@@ -545,7 +545,7 @@ public class ConfigUserService implements IUserService { * @return list of all usernames
*/
@Override
- public List<String> getAllUsernames() {
+ public synchronized List<String> getAllUsernames() {
read();
List<String> list = new ArrayList<String>(users.keySet());
Collections.sort(list);
|