Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog
All notable changes to this project will be documented in this file.

## [8.4.1](https://github.com/Backbase/stream-services/compare/8.4.0...8.4.1)
### Changed
- added logger for LegalEntitySaga and AccessGroupService to debug
## [8.4.0](https://github.com/Backbase/stream-services/compare/8.3.0...8.4.0)
### Added
- add the investment service integration; part1
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>com.backbase.stream</groupId>
<artifactId>stream-services</artifactId>
<version>8.4.0</version>
<version>8.4.1</version>

<packaging>pom</packaging>
<name>Stream :: Services</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,9 @@ public Mono<JobProfileUser> assignPermissions(StreamTask streamTask, ServiceAgre

public Mono<BatchProductGroupTask> assignPermissionsBatch(BatchProductGroupTask task,
Map<User, Map<BusinessFunctionGroup, List<BaseProductGroup>>> usersPermissions) {

log.info("Assigning permissions batch for task: {}, usersPermissions: {}",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be log all permissions on INFO level?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will revert everything after debugging is complete

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't develop for reverting. Change it to debug and set your log levels at runtime.

task, usersPermissions);
System.out.println("Assigning permissions batch for task: " + task + ", usersPermissions: " + usersPermissions);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use a system output? It's a super weird solution for logging

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will revert everything after debugging is complete

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

system output is to make sure logs are printed without fail and to save some time

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log.debug will also print when the appropriate level is set in configuration.

List<UserWithPermissions> request = usersPermissions.keySet().stream()
.map(user -> new UserWithPermissions(
user, task.getData().getServiceAgreement(),
Expand All @@ -575,6 +577,7 @@ public Mono<BatchProductGroupTask> assignPermissionsBatch(BatchProductGroupTask
.setFunctionGroupId(bfg.getId())
.setFunctionGroupName(bfg.getName())
.setServiceAgreementId(bfg.getServiceAgreementId())
.setServiceAgreementExternalId(task.getData().getServiceAgreement().getExternalId())
.setDataGroups(usersPermissions.get(user).get(bfg).stream()
.map(baseProductGroup -> new UserAssignedDataGroup()
.setDataGroupId(baseProductGroup.getInternalId())
Expand All @@ -585,6 +588,8 @@ public Mono<BatchProductGroupTask> assignPermissionsBatch(BatchProductGroupTask
.collect(Collectors.toList())))
.collect(Collectors.toList())))
.collect(Collectors.toList());
log.info("Assigned permissions request: {}", request);
System.out.println("Assigned permissions request: " + request);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No.


return Mono.just(request)
.flatMap(userPermissionsRequest -> {
Expand All @@ -611,6 +616,7 @@ public Mono<BatchProductGroupTask> assignPermissionsBatch(BatchProductGroupTask
"Assigning permissions: %s",
userPermissionsList.stream().map(this::prettyPrintUserAssignedPermissions)
.collect(Collectors.joining(",")));
log.info("Assigned permissions request: {}", userPermissionsList);
return assignPermissionsIntegrationApi.batchUpdateUserPermissions(map(userPermissionsList))
.map(r -> batchResponseUtils.checkBatchResponseItem(r, "Permissions Update",
r.getStatus().toString(), r.getResourceId(), r.getErrors()))
Expand Down Expand Up @@ -1104,7 +1110,8 @@ public Flux<String> getDataGroupItemIdsByServiceAgreementId(String serviceAgreem
*/
public Mono<List<BusinessFunctionGroup>> setupFunctionGroups(StreamTask streamTask,
ServiceAgreement serviceAgreement, List<BusinessFunctionGroup> businessFunctionGroups) {

log.info("Setup Function Groups for Service Agreement: {}", serviceAgreement.getExternalId());
log.info("Setup Function Groups for businessFunctionGroups: {}", businessFunctionGroups);
streamTask.info(FUNCTION_GROUP, SETUP_FUNCTION_GROUP, "", serviceAgreement.getExternalId(),
serviceAgreement.getInternalId(), "Setting up %s Business Functions for Service Agreement: %s",
businessFunctionGroups.size(), serviceAgreement.getName());
Expand All @@ -1123,6 +1130,7 @@ public Mono<List<BusinessFunctionGroup>> setupFunctionGroups(StreamTask streamTa
List<BusinessFunctionGroup> existingBusinessGroups =
getExistingBusinessGroups(businessFunctionGroups, functionGroups);
log.debug("existingBusinessGroups: {}", existingBusinessGroups);
log.info("existingBusinessGroups: {}", existingBusinessGroups);
return updateBatchBusinessFunctionGroup(streamTask, serviceAgreement, existingBusinessGroups)
.flatMap(updated -> {
bfg.addAll(existingBusinessGroups);
Expand Down Expand Up @@ -1673,7 +1681,8 @@ private Mono<? extends JobRole> updateJobRole(StreamTask streamTask, ServiceAgre

private Mono<List<com.backbase.accesscontrol.functiongroup.api.integration.v1.model.BatchResponseItemExtended>> updateBatchBusinessFunctionGroup(
StreamTask streamTask, ServiceAgreement serviceAgreement, List<BusinessFunctionGroup> existingBusinessGroups) {

log.info("Assigning {} Business Function Groups to Job Profile User: {}", existingBusinessGroups,
existingBusinessGroups);
log.info("Start Job Role updating: {}",
existingBusinessGroups.stream().map(BusinessFunctionGroup::getName).collect(Collectors.toList()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,8 @@ public Mono<LegalEntityTask> setupUserPermissions(LegalEntityTask legalEntityTas

public Mono<LegalEntityTask> setupAdministratorPermissions(LegalEntityTask legalEntityTask) {
// Assign permissions for the user for all business function groups.
log.info("Administrator Permissions {}", legalEntityTask);
System.out.println("Administrator Permissions " + legalEntityTask);
LegalEntity legalEntity = legalEntityTask.getData();
Map<User, Map<BusinessFunctionGroup, List<BaseProductGroup>>> request = nullableCollectionToStream(
legalEntity.getUsers())
Expand All @@ -758,7 +760,11 @@ public Mono<LegalEntityTask> setupAdministratorPermissions(LegalEntityTask legal
));
}
));

log.info("Permissions {}", request);
System.out.println("Permissions " + request);
ServiceAgreement serviceAgg = retrieveServiceAgreement(legalEntity);
log.info("Service Agreement {}", serviceAgg);
System.out.println("Service Agreement " + serviceAgg);
if (request.isEmpty()) {
log.info("Skipping setup of permissions since no declarative business functions were found.");
return Mono.just(legalEntityTask);
Expand Down
Loading