private <T extends Serializable> TenantConfigurationValue<T> getConfigValue(final String key, final Class<T> valueType) { return config.getConfigurationValue(key, valueType); }
@Override public ResponseEntity<MgmtSystemTenantConfigurationValue> getTenantConfigurationValue( @PathVariable("keyName") final String keyName) { LOG.debug("{} config value getted, return status {}", keyName, HttpStatus.OK); return ResponseEntity.ok(MgmtTenantManagementMapper.toResponse(keyName, tenantConfigurationManagement.getConfigurationValue(keyName))); }
/** * Returns true, if rollout approval is enabled and rollout creator doesn't have * approval role. */ @Override public boolean isApprovalNeeded(final Rollout rollout) { final UserDetails userDetails = this.getActor(rollout); final boolean approvalEnabled = this.tenantConfigurationManagement .getConfigurationValue(TenantConfigurationKey.ROLLOUT_APPROVAL_ENABLED, Boolean.class).getValue(); return approvalEnabled && userDetails.getAuthorities().stream() .noneMatch(authority -> SpPermission.APPROVE_ROLLOUT.equals(authority.getAuthority())); }
@Override public String run() { return systemSecurityContext.runAsSystem(() -> tenantConfigurationManagement.getConfigurationValue( TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_AUTHORITY_NAME, String.class).getValue()); } }
@Override public String getPollingTime() { return systemSecurityContext.runAsSystem(() -> tenantConfigurationManagement .getConfigurationValue(TenantConfigurationKey.POLLING_TIME_INTERVAL, String.class).getValue()); }
@Override public String getPollingTime() { return systemSecurityContext.runAsSystem(() -> tenantConfigurationManagement .getConfigurationValue(TenantConfigurationKey.POLLING_TIME_INTERVAL, String.class).getValue()); }
/** * Returns the configured minimum polling interval. * * @return current {@link TenantConfigurationKey#MIN_POLLING_TIME_INTERVAL}. */ @Override public String getMinPollingTime() { return systemSecurityContext.runAsSystem(() -> tenantConfigurationManagement .getConfigurationValue(TenantConfigurationKey.MIN_POLLING_TIME_INTERVAL, String.class).getValue()); }
/** * Returns the count to be used for reducing polling interval while calling * {@link ControllerManagement#getPollingTimeForAction()}. * * @return configured value of * {@link TenantConfigurationKey#MAINTENANCE_WINDOW_POLL_COUNT}. */ @Override public int getMaintenanceWindowPollCount() { return systemSecurityContext.runAsSystem(() -> tenantConfigurationManagement .getConfigurationValue(TenantConfigurationKey.MAINTENANCE_WINDOW_POLL_COUNT, Integer.class).getValue()); }
@Override public boolean isConfigEnabled() { final TenantConfigurationValue<Boolean> enabled = tenantConfigurationManagement .getConfigurationValue(configurationKey, Boolean.class); return enabled.getValue() && !enabled.isGlobal(); }
private String getCaRootAuthorityValue() { return getTenantConfigurationManagement() .getConfigurationValue(TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_AUTHORITY_NAME, String.class) .getValue(); }
private String getSecurityTokenKey() { return getTenantConfigurationManagement().getConfigurationValue( TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY, String.class).getValue(); }
@Override public boolean isConfigEnabled() { final TenantConfigurationValue<Boolean> enabled = tenantConfigurationManagement .getConfigurationValue(configurationKey, Boolean.class); return enabled.getValue() && !enabled.isGlobal(); }
static Map<String, MgmtSystemTenantConfigurationValue> toResponse( final TenantConfigurationManagement tenantConfigurationManagement, final TenantConfigurationProperties tenantConfigurationProperties) { return tenantConfigurationProperties.getConfigurationKeys().stream() .collect(Collectors.toMap(TenantConfigurationKey::getKeyName, key -> toResponse(key.getKeyName(), tenantConfigurationManagement.getConfigurationValue(key.getKeyName())))); }
@Override public void undo() { configurationEnabledChange = false; configurationEnabled = getTenantConfigurationManagement() .getConfigurationValue(getConfigurationKey(), Boolean.class).getValue(); }
@Override public void undo() { configurationEnabledChange = false; configurationEnabled = getTenantConfigurationManagement() .getConfigurationValue(getConfigurationKey(), Boolean.class).getValue(); } }
@Override public void undo() { configurationEnabledChange = false; configurationEnabled = getTenantConfigurationManagement() .getConfigurationValue(getConfigurationKey(), Boolean.class).getValue(); } }
@Override public void undo() { configurationEnabledChange = false; configurationEnabled = getTenantConfigurationManagement() .getConfigurationValue(getConfigurationKey(), Boolean.class).getValue(); }
@Override public void undo() { configurationEnabledChange = false; configurationEnabled = getTenantConfigurationManagement() .getConfigurationValue(getConfigurationKey(), Boolean.class).getValue(); } }
@Override public void undo() { configurationEnabledChange = false; configurationCaRootAuthorityChanged = false; configurationEnabled = getTenantConfigurationManagement() .getConfigurationValue(getConfigurationKey(), Boolean.class).getValue(); caRootAuthorityTextField.setValue(getCaRootAuthorityValue()); }
@Override public void undo() { configurationEnabledChange = false; configurationCaRootAuthorityChanged = false; configurationEnabled = getTenantConfigurationManagement() .getConfigurationValue(getConfigurationKey(), Boolean.class).getValue(); caRootAuthorityTextField.setValue(getCaRootAuthorityValue()); }