Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
wistefan committed Jul 3, 2024
1 parent f10fdc8 commit da6714c
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions src/main/java/org/fiware/odrl/PolicyResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,10 @@ public Response getPolicies(Integer page, Integer pageSize) {
.getPolicies(Optional.ofNullable(page).orElse(0), Optional.ofNullable(pageSize).orElse(25))
.entrySet()
.stream()

.map(policyEntry -> {
var id = policyEntry.getKey();
var odrl = policyEntry.getValue().odrl().policy();
var rego = policyEntry.getValue().rego().policy();
log.warn("Org: {}:{}:{}", id, odrl, rego);
var policy = new Policy()
.id(id)
.odrl(odrl)
.rego(rego);
try {
log.warn("The mapper {}", objectMapper.getClass().getName());
log.warn("The policy {} : {}", policy.getId(), objectMapper.writeValueAsString(policy));
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return policy;
})
.map(policyEntry -> new Policy()
.id(policyEntry.getKey())
.odrl(policyEntry.getValue().odrl().policy())
.rego(policyEntry.getValue().rego().policy()))
.toList();

return Response.ok(policyList).build();
Expand Down

0 comments on commit da6714c

Please sign in to comment.