Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FC Service
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Valerii Kalashnikov
FC Service
Commits
b011a76a
Commit
b011a76a
authored
1 year ago
by
Denis Sukhoroslov
Browse files
Options
Downloads
Patches
Plain Diff
fixing #139
parent
c82aa2d9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fc-service-server/src/main/java/eu/gaiax/difs/fc/server/service/ParticipantsService.java
+20
-12
20 additions, 12 deletions
.../eu/gaiax/difs/fc/server/service/ParticipantsService.java
with
20 additions
and
12 deletions
fc-service-server/src/main/java/eu/gaiax/difs/fc/server/service/ParticipantsService.java
+
20
−
12
View file @
b011a76a
...
...
@@ -160,20 +160,28 @@ public class ParticipantsService implements ParticipantsApiDelegate {
// sorting is not supported yet by keycloak admin API
log
.
debug
(
"getParticipants.enter; got offset: {}, limit: {}"
,
offset
,
limit
);
PaginatedResults
<
ParticipantMetaData
>
results
=
partDao
.
search
(
offset
,
limit
);
//Adding actual SD from sd-store for each sd-hash present in keycloak
SdFilter
filter
=
new
SdFilter
();
filter
.
setLimit
(
results
.
getResults
().
size
());
filter
.
setOffset
(
0
);
filter
.
setHashes
(
results
.
getResults
().
stream
().
map
(
ParticipantMetaData:
:
getSdHash
).
collect
(
Collectors
.
toList
()));
Map
<
String
,
ContentAccessor
>
sdsMap
=
selfDescriptionStore
.
getByFilter
(
filter
,
true
,
true
).
getResults
().
stream
()
.
collect
(
Collectors
.
toMap
(
SelfDescriptionMetadata:
:
getSdHash
,
SelfDescriptionMetadata:
:
getSelfDescription
));
results
.
getResults
().
forEach
(
part
->
{
part
.
setSelfDescription
(
sdsMap
.
get
(
part
.
getSdHash
()).
getContentAsString
());
setParticipantPublicKey
(
part
);
});
log
.
debug
(
"getParticipants.exit; returning results: {}"
,
results
);
int
total
=
(
int
)
results
.
getTotalCount
();
if
(
total
>
0
)
{
//Adding actual SD from sd-store for each sd-hash present in keycloak
SdFilter
filter
=
new
SdFilter
();
filter
.
setLimit
(
results
.
getResults
().
size
());
filter
.
setOffset
(
0
);
filter
.
setHashes
(
results
.
getResults
().
stream
().
map
(
ParticipantMetaData:
:
getSdHash
).
collect
(
Collectors
.
toList
()));
PaginatedResults
<
SelfDescriptionMetadata
>
page
=
selfDescriptionStore
.
getByFilter
(
filter
,
true
,
true
);
if
(
page
.
getTotalCount
()
>
0
)
{
Map
<
String
,
ContentAccessor
>
sdsMap
=
page
.
getResults
().
stream
().
collect
(
Collectors
.
toMap
(
SelfDescriptionMetadata:
:
getSdHash
,
SelfDescriptionMetadata:
:
getSelfDescription
));
results
.
getResults
().
forEach
(
part
->
{
part
.
setSelfDescription
(
sdsMap
.
get
(
part
.
getSdHash
()).
getContentAsString
());
setParticipantPublicKey
(
part
);
});
}
else
{
results
.
getResults
().
clear
();
total
=
0
;
}
}
List
parts
=
results
.
getResults
();
log
.
debug
(
"getParticipants.exit; returning parts: {} from total: {}"
,
parts
.
size
(),
total
);
return
ResponseEntity
.
ok
(
new
Participants
(
total
,
parts
));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment