Merge pull request #88 from bsinno/fix-small-code-issues
Fixed small code issues
This commit is contained in:
@@ -20,13 +20,49 @@ import java.time.temporal.TemporalAccessor;
|
||||
* {@link #DURATION_FORMAT}.
|
||||
*
|
||||
*/
|
||||
public class DurationHelper {
|
||||
public final class DurationHelper {
|
||||
|
||||
/**
|
||||
* Duration validation utility class. Checks if the requested duration is in
|
||||
* the defined min/max range.
|
||||
*
|
||||
*/
|
||||
public static class DurationRangeValidator {
|
||||
final Duration min;
|
||||
final Duration max;
|
||||
|
||||
private DurationRangeValidator(final Duration min, final Duration max) {
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
public boolean isWithinRange(final Duration duration) {
|
||||
return duration.compareTo(min) > 0 && duration.compareTo(max) < 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Format of the String expected in configuration file and in the database.
|
||||
*/
|
||||
public static final String DURATION_FORMAT = "HH:mm:ss";
|
||||
|
||||
private DurationHelper() {
|
||||
// utility class
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link DurationRangeValidator}.
|
||||
*
|
||||
* @param min
|
||||
* imum of range.
|
||||
* @param max
|
||||
* imum of range.
|
||||
* @return {@link DurationRangeValidator} range.
|
||||
*/
|
||||
public static DurationRangeValidator durationRangeValidator(final Duration min, final Duration max) {
|
||||
return new DurationRangeValidator(min, max);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a Duration into a formatted String
|
||||
*
|
||||
@@ -35,7 +71,7 @@ public class DurationHelper {
|
||||
* @return String in the duration format, specified at
|
||||
* {@link #DURATION_FORMAT}
|
||||
*/
|
||||
public String durationToFormattedString(final Duration duration) {
|
||||
public static String durationToFormattedString(final Duration duration) {
|
||||
if (duration == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -52,7 +88,7 @@ public class DurationHelper {
|
||||
* @throws DateTimeParseException
|
||||
* when String is in wrong format
|
||||
*/
|
||||
public Duration formattedStringToDuration(final String formattedDuration) throws DateTimeParseException {
|
||||
public static Duration formattedStringToDuration(final String formattedDuration) {
|
||||
if (formattedDuration == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -72,25 +108,8 @@ public class DurationHelper {
|
||||
* count of seconds
|
||||
* @return duration
|
||||
*/
|
||||
public Duration getDurationByTimeValues(final long hours, final long minutes, final long seconds) {
|
||||
public static Duration getDurationByTimeValues(final long hours, final long minutes, final long seconds) {
|
||||
return Duration.ofHours(hours).plusMinutes(minutes).plusSeconds(seconds);
|
||||
}
|
||||
|
||||
public DurationRangeValidator durationRangeValidator(final Duration min, final Duration max) {
|
||||
return new DurationRangeValidator(min, max);
|
||||
}
|
||||
|
||||
public static class DurationRangeValidator {
|
||||
final Duration min;
|
||||
final Duration max;
|
||||
|
||||
private DurationRangeValidator(final Duration min, final Duration max) {
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
public boolean isWithinRange(final Duration duration) {
|
||||
return duration.compareTo(min) > 0 && duration.compareTo(max) < 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
*/
|
||||
public class TenantConfigurationPollingDurationValidator implements TenantConfigurationValidator {
|
||||
|
||||
private final DurationHelper durationHelper = new DurationHelper();
|
||||
|
||||
private final Duration minDuration;
|
||||
|
||||
private final Duration maxDuration;
|
||||
@@ -36,8 +34,8 @@ public class TenantConfigurationPollingDurationValidator implements TenantConfig
|
||||
*/
|
||||
@Autowired
|
||||
public TenantConfigurationPollingDurationValidator(final ControllerPollProperties properties) {
|
||||
minDuration = durationHelper.formattedStringToDuration(properties.getMinPollingTime());
|
||||
maxDuration = durationHelper.formattedStringToDuration(properties.getMaxPollingTime());
|
||||
minDuration = DurationHelper.formattedStringToDuration(properties.getMinPollingTime());
|
||||
maxDuration = DurationHelper.formattedStringToDuration(properties.getMaxPollingTime());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -47,18 +45,18 @@ public class TenantConfigurationPollingDurationValidator implements TenantConfig
|
||||
|
||||
final Duration tenantConfigurationValue;
|
||||
try {
|
||||
tenantConfigurationValue = durationHelper.formattedStringToDuration(tenantConfigurationString);
|
||||
tenantConfigurationValue = DurationHelper.formattedStringToDuration(tenantConfigurationString);
|
||||
} catch (final DateTimeParseException ex) {
|
||||
throw new TenantConfigurationValidatorException(
|
||||
String.format("The given configuration value is expected as a string in the format %s.",
|
||||
DurationHelper.DURATION_FORMAT));
|
||||
}
|
||||
|
||||
if (!durationHelper.durationRangeValidator(minDuration, maxDuration).isWithinRange(tenantConfigurationValue)) {
|
||||
if (!DurationHelper.durationRangeValidator(minDuration, maxDuration).isWithinRange(tenantConfigurationValue)) {
|
||||
throw new TenantConfigurationValidatorException(
|
||||
String.format("The given configuration value is not in the allowed range from %s to %s.",
|
||||
durationHelper.durationToFormattedString(minDuration),
|
||||
durationHelper.durationToFormattedString(maxDuration)));
|
||||
DurationHelper.durationToFormattedString(minDuration),
|
||||
DurationHelper.durationToFormattedString(maxDuration)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,8 +27,6 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
|
||||
* {@link TenantAware#getCurrentTenant()} in the eclipselink session. This has
|
||||
* to be done in eclipselink after a {@link Transaction} has been started.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class MultiTenantJpaTransactionManager extends JpaTransactionManager {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -44,13 +42,8 @@ public class MultiTenantJpaTransactionManager extends JpaTransactionManager {
|
||||
.getResource(getEntityManagerFactory());
|
||||
final EntityManager em = emHolder.getEntityManager();
|
||||
|
||||
if (!definition.getName().startsWith(SystemManagement.class.getCanonicalName() + ".findTenants")
|
||||
&& !definition.getName().startsWith(SystemManagement.class.getCanonicalName() + ".deleteTenant")
|
||||
&& !definition.getName()
|
||||
.startsWith(SystemManagement.class.getCanonicalName() + ".currentTenantKeyGenerator")
|
||||
&& !definition.getName().startsWith(RolloutManagement.class.getCanonicalName() + ".rolloutScheduler")
|
||||
&& !definition.getName()
|
||||
.startsWith(SystemManagement.class.getCanonicalName() + ".getOrCreateTenantMetadata")) {
|
||||
if (notTenantManagement(definition) && notCurrentTenantKeyGenerator(definition)
|
||||
&& notRolloutScheduler(definition) && notGetOrCreateTenantMetadata(definition)) {
|
||||
|
||||
final String currentTenant = tenantAware.getCurrentTenant();
|
||||
if (currentTenant == null) {
|
||||
@@ -60,4 +53,23 @@ public class MultiTenantJpaTransactionManager extends JpaTransactionManager {
|
||||
em.setProperty(PersistenceUnitProperties.MULTITENANT_PROPERTY_DEFAULT, currentTenant.toUpperCase());
|
||||
}
|
||||
}
|
||||
|
||||
private boolean notGetOrCreateTenantMetadata(final TransactionDefinition definition) {
|
||||
return !definition.getName()
|
||||
.startsWith(SystemManagement.class.getCanonicalName() + ".getOrCreateTenantMetadata");
|
||||
}
|
||||
|
||||
private boolean notRolloutScheduler(final TransactionDefinition definition) {
|
||||
return !definition.getName().startsWith(RolloutManagement.class.getCanonicalName() + ".rolloutScheduler");
|
||||
}
|
||||
|
||||
private boolean notCurrentTenantKeyGenerator(final TransactionDefinition definition) {
|
||||
return !definition.getName()
|
||||
.startsWith(SystemManagement.class.getCanonicalName() + ".currentTenantKeyGenerator");
|
||||
}
|
||||
|
||||
private boolean notTenantManagement(final TransactionDefinition definition) {
|
||||
return !definition.getName().startsWith(SystemManagement.class.getCanonicalName() + ".deleteTenant")
|
||||
&& !definition.getName().startsWith(SystemManagement.class.getCanonicalName() + ".findTenants");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit;
|
||||
package org.eclipse.hawkbit.repository;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -10,7 +10,6 @@ package org.eclipse.hawkbit.repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.hawkbit.RolloutProperties;
|
||||
import org.eclipse.hawkbit.security.SystemSecurityContext;
|
||||
import org.eclipse.hawkbit.tenancy.TenantAware;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -122,9 +122,6 @@ public class TargetInfo implements Persistable<Long>, Serializable {
|
||||
@Column(name = "request_controller_attributes", nullable = false)
|
||||
private boolean requestControllerAttributes = true;
|
||||
|
||||
@Transient
|
||||
private final DurationHelper durationHelper = new DurationHelper();
|
||||
|
||||
/**
|
||||
* Constructor for {@link TargetStatus}.
|
||||
*
|
||||
@@ -324,9 +321,9 @@ public class TargetInfo implements Persistable<Long>, Serializable {
|
||||
return null;
|
||||
}
|
||||
|
||||
final Duration pollTime = durationHelper.formattedStringToDuration(TenantConfigurationManagement.getInstance()
|
||||
final Duration pollTime = DurationHelper.formattedStringToDuration(TenantConfigurationManagement.getInstance()
|
||||
.getConfigurationValue(TenantConfigurationKey.POLLING_TIME_INTERVAL, String.class).getValue());
|
||||
final Duration overdueTime = durationHelper.formattedStringToDuration(TenantConfigurationManagement
|
||||
final Duration overdueTime = DurationHelper.formattedStringToDuration(TenantConfigurationManagement
|
||||
.getInstance().getConfigurationValue(TenantConfigurationKey.POLLING_OVERDUE_TIME_INTERVAL, String.class)
|
||||
.getValue());
|
||||
final LocalDateTime currentDate = LocalDateTime.now();
|
||||
|
||||
@@ -31,8 +31,6 @@ import ru.yandex.qatools.allure.annotations.Stories;
|
||||
@Stories("Tenant Configuration Management")
|
||||
public class TenantConfigurationManagementTest extends AbstractIntegrationTestWithMongoDB {
|
||||
|
||||
final DurationHelper durationHelper = new DurationHelper();
|
||||
|
||||
@Test
|
||||
@Description("Tests that tenant specific configuration can be persisted and in case the tenant does not have specific configuration the default from environment is used instead.")
|
||||
public void storeTenantSpecificConfigurationAsString() {
|
||||
@@ -167,8 +165,8 @@ public class TenantConfigurationManagementTest extends AbstractIntegrationTestWi
|
||||
public void storesTooSmallDurationAsPollingInterval() {
|
||||
final TenantConfigurationKey configKey = TenantConfigurationKey.POLLING_TIME_INTERVAL;
|
||||
|
||||
final String tooSmallDuration = durationHelper
|
||||
.durationToFormattedString(durationHelper.getDurationByTimeValues(0, 0, 1));
|
||||
final String tooSmallDuration = DurationHelper
|
||||
.durationToFormattedString(DurationHelper.getDurationByTimeValues(0, 0, 1));
|
||||
tenantConfigurationManagement.addOrUpdateConfiguration(configKey, tooSmallDuration);
|
||||
}
|
||||
|
||||
@@ -177,15 +175,15 @@ public class TenantConfigurationManagementTest extends AbstractIntegrationTestWi
|
||||
public void storesCorrectDurationAsPollingInterval() {
|
||||
final TenantConfigurationKey configKey = TenantConfigurationKey.POLLING_TIME_INTERVAL;
|
||||
|
||||
final Duration duration = durationHelper.getDurationByTimeValues(1, 2, 0);
|
||||
final Duration duration = DurationHelper.getDurationByTimeValues(1, 2, 0);
|
||||
assertThat(duration).isEqualTo(Duration.ofHours(1).plusMinutes(2));
|
||||
|
||||
tenantConfigurationManagement.addOrUpdateConfiguration(configKey,
|
||||
durationHelper.durationToFormattedString(duration));
|
||||
DurationHelper.durationToFormattedString(duration));
|
||||
|
||||
final String storedDurationString = tenantConfigurationManagement.getConfigurationValue(configKey, String.class)
|
||||
.getValue();
|
||||
assertThat(duration).isEqualTo(durationHelper.formattedStringToDuration(storedDurationString));
|
||||
assertThat(duration).isEqualTo(DurationHelper.formattedStringToDuration(storedDurationString));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -142,6 +142,11 @@ public class HawkbitSecurityProperties {
|
||||
this.maxAttributeEntriesPerTarget = maxAttributeEntriesPerTarget;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration for hawkBits DOS prevention filter. This is usually an
|
||||
* infrastructure topic but might be useful in some cases.
|
||||
*
|
||||
*/
|
||||
public static class Filter {
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,22 +19,6 @@ import org.springframework.stereotype.Component;
|
||||
@ConfigurationProperties("hawkbit.server.ui")
|
||||
public class UiProperties {
|
||||
|
||||
private final Links links = new Links();
|
||||
private final Login login = new Login();
|
||||
private final Demo demo = new Demo();
|
||||
|
||||
public Login getLogin() {
|
||||
return login;
|
||||
}
|
||||
|
||||
public Links getLinks() {
|
||||
return links;
|
||||
}
|
||||
|
||||
public Demo getDemo() {
|
||||
return demo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Demo account login information.
|
||||
*
|
||||
@@ -55,54 +39,37 @@ public class UiProperties {
|
||||
*/
|
||||
private String password = "";
|
||||
|
||||
public String getTenant() {
|
||||
return tenant;
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setTenant(final String tenant) {
|
||||
this.tenant = tenant;
|
||||
public String getTenant() {
|
||||
return tenant;
|
||||
}
|
||||
|
||||
public String getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(final String user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(final String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
}
|
||||
public void setTenant(final String tenant) {
|
||||
this.tenant = tenant;
|
||||
}
|
||||
|
||||
public void setUser(final String user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* Links to potentially other systems (e.g. support, user management,
|
||||
* documentation etc.).
|
||||
*
|
||||
*/
|
||||
public static class Links {
|
||||
private final Documentation documentation = new Documentation();
|
||||
|
||||
/**
|
||||
* Link to product support.
|
||||
*/
|
||||
private String support = "";
|
||||
|
||||
/**
|
||||
* Link to request a system account, access.
|
||||
*/
|
||||
private String requestAccount = "";
|
||||
|
||||
public Documentation getDocumentation() {
|
||||
return documentation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration of UI documentation links.
|
||||
*
|
||||
@@ -152,111 +119,120 @@ public class UiProperties {
|
||||
return deploymentView;
|
||||
}
|
||||
|
||||
public void setDeploymentView(final String deploymentView) {
|
||||
this.deploymentView = deploymentView;
|
||||
}
|
||||
|
||||
public String getDistributionView() {
|
||||
return distributionView;
|
||||
}
|
||||
|
||||
public void setDistributionView(final String distributionView) {
|
||||
this.distributionView = distributionView;
|
||||
}
|
||||
|
||||
public String getUploadView() {
|
||||
return uploadView;
|
||||
}
|
||||
|
||||
public void setUploadView(final String uploadView) {
|
||||
this.uploadView = uploadView;
|
||||
}
|
||||
|
||||
public String getSystemConfigurationView() {
|
||||
return systemConfigurationView;
|
||||
}
|
||||
|
||||
public void setSystemConfigurationView(final String systemConfigurationView) {
|
||||
this.systemConfigurationView = systemConfigurationView;
|
||||
}
|
||||
|
||||
public String getSecurity() {
|
||||
return security;
|
||||
}
|
||||
|
||||
public void setSecurity(final String security) {
|
||||
this.security = security;
|
||||
}
|
||||
|
||||
public String getTargetfilterView() {
|
||||
return targetfilterView;
|
||||
}
|
||||
|
||||
public void setTargetfilterView(final String targetfilterView) {
|
||||
this.targetfilterView = targetfilterView;
|
||||
}
|
||||
|
||||
public String getRolloutView() {
|
||||
return rolloutView;
|
||||
}
|
||||
|
||||
public void setRolloutView(final String rolloutView) {
|
||||
this.rolloutView = rolloutView;
|
||||
}
|
||||
|
||||
public String getRoot() {
|
||||
return root;
|
||||
}
|
||||
|
||||
public String getSecurity() {
|
||||
return security;
|
||||
}
|
||||
|
||||
public String getSystemConfigurationView() {
|
||||
return systemConfigurationView;
|
||||
}
|
||||
|
||||
public String getTargetfilterView() {
|
||||
return targetfilterView;
|
||||
}
|
||||
|
||||
public String getUploadView() {
|
||||
return uploadView;
|
||||
}
|
||||
|
||||
public void setDeploymentView(final String deploymentView) {
|
||||
this.deploymentView = deploymentView;
|
||||
}
|
||||
|
||||
public void setDistributionView(final String distributionView) {
|
||||
this.distributionView = distributionView;
|
||||
}
|
||||
|
||||
public void setRolloutView(final String rolloutView) {
|
||||
this.rolloutView = rolloutView;
|
||||
}
|
||||
|
||||
public void setRoot(final String root) {
|
||||
this.root = root;
|
||||
}
|
||||
|
||||
public void setSecurity(final String security) {
|
||||
this.security = security;
|
||||
}
|
||||
|
||||
public void setSystemConfigurationView(final String systemConfigurationView) {
|
||||
this.systemConfigurationView = systemConfigurationView;
|
||||
}
|
||||
|
||||
public void setTargetfilterView(final String targetfilterView) {
|
||||
this.targetfilterView = targetfilterView;
|
||||
}
|
||||
|
||||
public void setUploadView(final String uploadView) {
|
||||
this.uploadView = uploadView;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private final Documentation documentation = new Documentation();
|
||||
|
||||
/**
|
||||
* Link to product support.
|
||||
*/
|
||||
private String support = "";
|
||||
|
||||
/**
|
||||
* Link to request a system account, access.
|
||||
*/
|
||||
private String requestAccount = "";
|
||||
|
||||
/**
|
||||
* Link to user management.
|
||||
*/
|
||||
private String userManagement = "";
|
||||
|
||||
public String getSupport() {
|
||||
return support;
|
||||
}
|
||||
|
||||
public void setSupport(final String support) {
|
||||
this.support = support;
|
||||
public Documentation getDocumentation() {
|
||||
return documentation;
|
||||
}
|
||||
|
||||
public String getRequestAccount() {
|
||||
return requestAccount;
|
||||
}
|
||||
|
||||
public void setRequestAccount(final String requestAccount) {
|
||||
this.requestAccount = requestAccount;
|
||||
public String getSupport() {
|
||||
return support;
|
||||
}
|
||||
|
||||
public String getUserManagement() {
|
||||
return userManagement;
|
||||
}
|
||||
|
||||
public void setRequestAccount(final String requestAccount) {
|
||||
this.requestAccount = requestAccount;
|
||||
}
|
||||
|
||||
public void setSupport(final String support) {
|
||||
this.support = support;
|
||||
}
|
||||
|
||||
public void setUserManagement(final String userManagement) {
|
||||
this.userManagement = userManagement;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration of login view.
|
||||
*
|
||||
*/
|
||||
public static class Login {
|
||||
|
||||
private final Cookie cookie = new Cookie();
|
||||
|
||||
public Cookie getCookie() {
|
||||
return cookie;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cookie configuration for login credential cookie.
|
||||
*
|
||||
@@ -275,6 +251,30 @@ public class UiProperties {
|
||||
this.secure = secure;
|
||||
}
|
||||
}
|
||||
|
||||
private final Cookie cookie = new Cookie();
|
||||
|
||||
public Cookie getCookie() {
|
||||
return cookie;
|
||||
}
|
||||
}
|
||||
|
||||
private final Links links = new Links();
|
||||
|
||||
private final Login login = new Login();
|
||||
|
||||
private final Demo demo = new Demo();
|
||||
|
||||
public Demo getDemo() {
|
||||
return demo;
|
||||
}
|
||||
|
||||
public Links getLinks() {
|
||||
return links;
|
||||
}
|
||||
|
||||
public Login getLogin() {
|
||||
return login;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class PollingConfigurationView extends BaseConfigurationView
|
||||
private I18N i18n;
|
||||
|
||||
@Autowired
|
||||
private ControllerPollProperties controllerPollProperties;
|
||||
private transient ControllerPollProperties controllerPollProperties;
|
||||
|
||||
@Autowired
|
||||
private transient TenantConfigurationManagement tenantConfigurationManagement;
|
||||
@@ -59,31 +59,29 @@ public class PollingConfigurationView extends BaseConfigurationView
|
||||
private Duration tenantPollTime = null;
|
||||
private Duration tenantOverdueTime = null;
|
||||
|
||||
private final DurationHelper durationHelper = new DurationHelper();
|
||||
|
||||
/**
|
||||
* Initialize Authentication Configuration layout.
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
|
||||
minDuration = durationHelper.formattedStringToDuration(controllerPollProperties.getMinPollingTime());
|
||||
maxDuration = durationHelper.formattedStringToDuration(controllerPollProperties.getMaxPollingTime());
|
||||
globalPollTime = durationHelper.formattedStringToDuration(tenantConfigurationManagement
|
||||
minDuration = DurationHelper.formattedStringToDuration(controllerPollProperties.getMinPollingTime());
|
||||
maxDuration = DurationHelper.formattedStringToDuration(controllerPollProperties.getMaxPollingTime());
|
||||
globalPollTime = DurationHelper.formattedStringToDuration(tenantConfigurationManagement
|
||||
.getGlobalConfigurationValue(TenantConfigurationKey.POLLING_TIME_INTERVAL, String.class));
|
||||
globalOverdueTime = durationHelper.formattedStringToDuration(tenantConfigurationManagement
|
||||
globalOverdueTime = DurationHelper.formattedStringToDuration(tenantConfigurationManagement
|
||||
.getGlobalConfigurationValue(TenantConfigurationKey.POLLING_OVERDUE_TIME_INTERVAL, String.class));
|
||||
|
||||
final TenantConfigurationValue<String> pollTimeConfValue = tenantConfigurationManagement
|
||||
.getConfigurationValue(TenantConfigurationKey.POLLING_TIME_INTERVAL, String.class);
|
||||
if (!pollTimeConfValue.isGlobal()) {
|
||||
tenantPollTime = durationHelper.formattedStringToDuration(pollTimeConfValue.getValue());
|
||||
tenantPollTime = DurationHelper.formattedStringToDuration(pollTimeConfValue.getValue());
|
||||
}
|
||||
|
||||
final TenantConfigurationValue<String> overdueTimeConfValue = tenantConfigurationManagement
|
||||
.getConfigurationValue(TenantConfigurationKey.POLLING_OVERDUE_TIME_INTERVAL, String.class);
|
||||
if (!overdueTimeConfValue.isGlobal()) {
|
||||
tenantOverdueTime = durationHelper.formattedStringToDuration(overdueTimeConfValue.getValue());
|
||||
tenantOverdueTime = DurationHelper.formattedStringToDuration(overdueTimeConfValue.getValue());
|
||||
}
|
||||
|
||||
final Panel rootPanel = new Panel();
|
||||
@@ -133,7 +131,7 @@ public class PollingConfigurationView extends BaseConfigurationView
|
||||
tenantConfigurationManagement.deleteConfiguration(key);
|
||||
} else {
|
||||
tenantConfigurationManagement.addOrUpdateConfiguration(key,
|
||||
durationHelper.durationToFormattedString(duration));
|
||||
DurationHelper.durationToFormattedString(duration));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user