Revision 61372
Added by Konstantinos Spyrou almost 3 years ago
AaiRoleMappingService.java | ||
---|---|---|
7 | 7 |
import org.springframework.stereotype.Service; |
8 | 8 |
|
9 | 9 |
import java.net.URLEncoder; |
10 |
import java.util.Collection; |
|
11 |
import java.util.stream.Collectors; |
|
10 | 12 |
|
11 | 13 |
@Service("roleMappingService") |
12 | 14 |
public class AaiRoleMappingService implements RoleMappingService { |
... | ... | |
35 | 37 |
} |
36 | 38 |
|
37 | 39 |
@Override |
40 |
public Collection<String> getRepoIdsByRoleIds(Collection<String> roleIds) { |
|
41 |
return roleIds |
|
42 |
.stream() |
|
43 |
.map(this::getRepoIdByRoleId) |
|
44 |
.collect(Collectors.toList()); |
|
45 |
} |
|
46 |
|
|
47 |
@Override |
|
38 | 48 |
public String getRoleIdByRepoId(String repoId) { |
39 | 49 |
String roleId = ""; |
40 | 50 |
String prefix = production ? null : "beta." + "datasource"; |
... | ... | |
48 | 58 |
} |
49 | 59 |
|
50 | 60 |
@Override |
61 |
public Collection<String> getRoleIdsByRepoIds(Collection<String> repoIds) { |
|
62 |
return repoIds |
|
63 |
.stream() |
|
64 |
.map(this::getRoleIdByRepoId) |
|
65 |
.collect(Collectors.toList()); |
|
66 |
} |
|
67 |
|
|
68 |
@Override |
|
51 | 69 |
public String convertAuthorityIdToRepoId(String authorityId) { |
52 | 70 |
String repo = ""; |
53 | 71 |
if (authorityId != null) { |
Also available in: Unified diff
1. optimization in retrieval time of repositories/snippets of authenticated user
2. Marked with FIXME methods that need attention