Merge pull request #114 from bsinno/fix-mixed-pollingtime

ok, merging and deleting branch.
This commit is contained in:
Michael Hirsch
2016-03-31 16:56:14 +02:00
4 changed files with 11 additions and 8 deletions

View File

@@ -31,7 +31,7 @@ public class ControllerPollProperties {
* Maximum polling time that can be configured by a tenant in HH:MM:SS
* notation.
*/
private String maxPollingTime = "23:59:00";
private String maxPollingTime = "23:59:59";
/**
* Minimum polling time that can be configured by a tenant in HH:MM:SS

View File

@@ -36,8 +36,15 @@ public final class DurationHelper {
this.max = max;
}
/**
* Checks if the requested duration is in the defined min/max range.
*
* @param duration
* to checked
* @return <code>true</code> if in time range
*/
public boolean isWithinRange(final Duration duration) {
return duration.compareTo(min) > 0 && duration.compareTo(max) < 0;
return duration.compareTo(min) >= 0 && duration.compareTo(max) <= 0;
}
}

View File

@@ -58,12 +58,12 @@ public enum TenantConfigurationKey {
/**
* string value which holds the polling time interval in the format HH:mm:ss
*/
POLLING_TIME_INTERVAL("pollingOverdueTime", "hawkbit.controller.pollingOverdueTime", String.class, null, TenantConfigurationPollingDurationValidator.class),
POLLING_TIME_INTERVAL("pollingTime", "hawkbit.controller.pollingTime", String.class, null, TenantConfigurationPollingDurationValidator.class),
/**
* string value which holds the polling time interval in the format HH:mm:ss
*/
POLLING_OVERDUE_TIME_INTERVAL("pollingTime", "hawkbit.controller.pollingTime", String.class, null, TenantConfigurationPollingDurationValidator.class);
POLLING_OVERDUE_TIME_INTERVAL("pollingOverdueTime", "hawkbit.controller.pollingOverdueTime", String.class, null, TenantConfigurationPollingDurationValidator.class);
private final String keyName;
private final String defaultKeyName;

View File

@@ -64,10 +64,6 @@ import org.springframework.web.bind.annotation.RestController;
*
* Transactional (read-write) as all queries at least update the last poll time.
*
*
*
*
*
*/
@RestController
@RequestMapping(ControllerConstants.BASE_V1_REQUEST_MAPPING)