SystemManagement getTenantMetadata - fetch details, added method getTenantMetadataWithoutDetails (#2194)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -144,8 +144,7 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi {
|
||||
public ResponseEntity<List<MgmtDistributionSet>> createDistributionSets(final List<MgmtDistributionSetRequestBodyPost> sets) {
|
||||
log.debug("creating {} distribution sets", sets.size());
|
||||
// set default Ds type if ds type is null
|
||||
final String defaultDsKey = systemSecurityContext
|
||||
.runAsSystem(systemManagement.getTenantMetadata().getDefaultDsType()::getKey);
|
||||
final String defaultDsKey = systemSecurityContext.runAsSystem(systemManagement.getTenantMetadata().getDefaultDsType()::getKey);
|
||||
sets.stream().filter(ds -> ds.getType() == null).forEach(ds -> ds.setType(defaultDsKey));
|
||||
|
||||
//check if there is already deleted DS Type
|
||||
|
||||
@@ -115,8 +115,7 @@ public class MgmtTenantManagementResource implements MgmtTenantManagementRestApi
|
||||
}
|
||||
|
||||
//Try update TenantMetadata first
|
||||
final Serializable defaultDsTypeValueUpdate = configurationValueMap.remove(
|
||||
MgmtTenantManagementMapper.DEFAULT_DISTRIBUTION_SET_TYPE_KEY);
|
||||
final Serializable defaultDsTypeValueUpdate = configurationValueMap.remove(MgmtTenantManagementMapper.DEFAULT_DISTRIBUTION_SET_TYPE_KEY);
|
||||
Long oldDefaultDsType = null;
|
||||
MgmtSystemTenantConfigurationValue updatedDefaultDsType = null;
|
||||
if (defaultDsTypeValueUpdate != null) {
|
||||
@@ -150,14 +149,14 @@ public class MgmtTenantManagementResource implements MgmtTenantManagementRestApi
|
||||
return MgmtTenantManagementMapper.DEFAULT_DISTRIBUTION_SET_TYPE_KEY.equals(keyName);
|
||||
}
|
||||
|
||||
private MgmtSystemTenantConfigurationValue loadTenantConfigurationValueBy(String keyName) {
|
||||
private MgmtSystemTenantConfigurationValue loadTenantConfigurationValueBy(final String keyName) {
|
||||
//Check if requested key is TenantConfiguration or TenantMetadata, load it and return it as rest response
|
||||
final MgmtSystemTenantConfigurationValue response;
|
||||
if (isDefaultDistributionSetTypeKey(keyName)) {
|
||||
response = MgmtTenantManagementMapper.toResponseDefaultDsType(systemManagement.getTenantMetadata().getDefaultDsType().getId());
|
||||
} else {
|
||||
response = MgmtTenantManagementMapper.toResponseTenantConfigurationValue(keyName,
|
||||
tenantConfigurationManagement.getConfigurationValue(keyName));
|
||||
response = MgmtTenantManagementMapper.toResponseTenantConfigurationValue(
|
||||
keyName, tenantConfigurationManagement.getConfigurationValue(keyName));
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -361,5 +361,4 @@ public class MgmtTenantManagementResourceTest extends AbstractManagementApiInteg
|
||||
private Long getActualDefaultDsType() {
|
||||
return systemManagement.getTenantMetadata().getDefaultDsType().getId();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user