|
|
|
@ -78,10 +78,26 @@ public class MobileAppBundleServiceImpl extends AbstractEntityService implements |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void deleteMobileAppBundleById(TenantId tenantId, MobileAppBundleId mobileAppBundleId) { |
|
|
|
log.trace("Executing deleteMobileAppBundleById [{}]", mobileAppBundleId.getId()); |
|
|
|
mobileAppBundleDao.removeById(tenantId, mobileAppBundleId.getId()); |
|
|
|
eventPublisher.publishEvent(DeleteEntityEvent.builder().tenantId(tenantId).entityId(mobileAppBundleId).build()); |
|
|
|
public void updateOauth2Clients(TenantId tenantId, MobileAppBundleId mobileAppBundleId, List<OAuth2ClientId> oAuth2ClientIds) { |
|
|
|
log.trace("Executing updateOauth2Clients, mobileAppId [{}], oAuth2ClientIds [{}]", mobileAppBundleId, oAuth2ClientIds); |
|
|
|
Set<MobileAppBundleOauth2Client> newClientList = oAuth2ClientIds.stream() |
|
|
|
.map(clientId -> new MobileAppBundleOauth2Client(mobileAppBundleId, clientId)) |
|
|
|
.collect(Collectors.toSet()); |
|
|
|
|
|
|
|
List<MobileAppBundleOauth2Client> existingClients = mobileAppBundleDao.findOauth2ClientsByMobileAppBundleId(tenantId, mobileAppBundleId); |
|
|
|
List<MobileAppBundleOauth2Client> toRemoveList = existingClients.stream() |
|
|
|
.filter(client -> !newClientList.contains(client)) |
|
|
|
.toList(); |
|
|
|
newClientList.removeIf(existingClients::contains); |
|
|
|
|
|
|
|
for (MobileAppBundleOauth2Client client : toRemoveList) { |
|
|
|
mobileAppBundleDao.removeOauth2Client(tenantId, client); |
|
|
|
} |
|
|
|
for (MobileAppBundleOauth2Client client : newClientList) { |
|
|
|
mobileAppBundleDao.addOauth2Client(tenantId, client); |
|
|
|
} |
|
|
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(tenantId) |
|
|
|
.entityId(mobileAppBundleId).created(false).build()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@ -108,29 +124,6 @@ public class MobileAppBundleServiceImpl extends AbstractEntityService implements |
|
|
|
return mobileAppBundleInfo; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void updateOauth2Clients(TenantId tenantId, MobileAppBundleId mobileAppBundleId, List<OAuth2ClientId> oAuth2ClientIds) { |
|
|
|
log.trace("Executing updateOauth2Clients, mobileAppId [{}], oAuth2ClientIds [{}]", mobileAppBundleId, oAuth2ClientIds); |
|
|
|
Set<MobileAppBundleOauth2Client> newClientList = oAuth2ClientIds.stream() |
|
|
|
.map(clientId -> new MobileAppBundleOauth2Client(mobileAppBundleId, clientId)) |
|
|
|
.collect(Collectors.toSet()); |
|
|
|
|
|
|
|
List<MobileAppBundleOauth2Client> existingClients = mobileAppBundleDao.findOauth2ClientsByMobileAppBundleId(tenantId, mobileAppBundleId); |
|
|
|
List<MobileAppBundleOauth2Client> toRemoveList = existingClients.stream() |
|
|
|
.filter(client -> !newClientList.contains(client)) |
|
|
|
.toList(); |
|
|
|
newClientList.removeIf(existingClients::contains); |
|
|
|
|
|
|
|
for (MobileAppBundleOauth2Client client : toRemoveList) { |
|
|
|
mobileAppBundleDao.removeOauth2Client(tenantId, client); |
|
|
|
} |
|
|
|
for (MobileAppBundleOauth2Client client : newClientList) { |
|
|
|
mobileAppBundleDao.addOauth2Client(tenantId, client); |
|
|
|
} |
|
|
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(tenantId) |
|
|
|
.entityId(mobileAppBundleId).created(false).build()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public MobileAppBundle findMobileAppBundleByPkgNameAndPlatform(TenantId tenantId, String pkgName, PlatformType platform) { |
|
|
|
log.trace("Executing findMobileAppBundleByPkgNameAndPlatform, tenantId [{}], pkgName [{}], platform [{}]", tenantId, pkgName, platform); |
|
|
|
@ -139,25 +132,27 @@ public class MobileAppBundleServiceImpl extends AbstractEntityService implements |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Optional<HasId<?>> findEntity(TenantId tenantId, EntityId entityId) { |
|
|
|
return Optional.ofNullable(findMobileAppBundleById(tenantId, new MobileAppBundleId(entityId.getId()))); |
|
|
|
public void deleteMobileAppBundleById(TenantId tenantId, MobileAppBundleId mobileAppBundleId) { |
|
|
|
log.trace("Executing deleteMobileAppBundleById [{}]", mobileAppBundleId.getId()); |
|
|
|
mobileAppBundleDao.removeById(tenantId, mobileAppBundleId.getId()); |
|
|
|
eventPublisher.publishEvent(DeleteEntityEvent.builder().tenantId(tenantId).entityId(mobileAppBundleId).build()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void deleteEntity(TenantId tenantId, EntityId id, boolean force) { |
|
|
|
deleteMobileAppBundleById(tenantId, (MobileAppBundleId) id); |
|
|
|
public void deleteByTenantId(TenantId tenantId) { |
|
|
|
log.trace("Executing deleteMobileAppsByTenantId, tenantId [{}]", tenantId); |
|
|
|
mobileAppBundleDao.deleteByTenantId(tenantId); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void deleteMobileAppBundlesByTenantId(TenantId tenantId) { |
|
|
|
log.trace("Executing deleteMobileAppsByTenantId, tenantId [{}]", tenantId); |
|
|
|
mobileAppBundleDao.deleteByTenantId(tenantId); |
|
|
|
public Optional<HasId<?>> findEntity(TenantId tenantId, EntityId entityId) { |
|
|
|
return Optional.ofNullable(findMobileAppBundleById(tenantId, new MobileAppBundleId(entityId.getId()))); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void deleteByTenantId(TenantId tenantId) { |
|
|
|
deleteMobileAppBundlesByTenantId(tenantId); |
|
|
|
@Transactional |
|
|
|
public void deleteEntity(TenantId tenantId, EntityId id, boolean force) { |
|
|
|
deleteMobileAppBundleById(tenantId, (MobileAppBundleId) id); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
|