Integrated Maintenance Window fields in Management API and UI (#677)

* Added Maintenance Window properties to API and UI

* extended Management API with Maintenance Window schedule, duration, timezone and nextAt properties
* extended integration tests for the above properties
* extended Management UI with Maintenance Window column in Action History grid, added tooltip for next execution
* general refactoring

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch-si.com>

* fixed Sonar issues

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch-si.com>

* changed the documentation help link for maintenance window

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch-si.com>

* added licence header, first refactoring after partial PR review

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch-si.com>

* changes related to PR review findings

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch-si.com>

* last PR review findings

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch-si.com>
This commit is contained in:
Bondar Bogdan
2018-05-15 11:12:33 +02:00
committed by Dominic Schabel
parent 1deb47a4db
commit b5114081be
22 changed files with 474 additions and 210 deletions

View File

@@ -55,7 +55,7 @@ public final class MaintenanceScheduleHelper {
* start time of a maintenance window calculated based on the
* cron expression is relative to this time zone.
*
* @return {@link Optional<ZonedDateTime>} of the next available window. In
* @return { @link Optional<ZonedDateTime>} of the next available window. In
* case there is none, or there are maintenance window validation
* errors, returns empty value.
*

View File

@@ -8,6 +8,8 @@
*/
package org.eclipse.hawkbit.repository.model;
import java.time.ZonedDateTime;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
/**
@@ -18,7 +20,7 @@ public interface Action extends TenantAwareBaseEntity {
/**
* Maximum length of controllerId.
*/
int MAINTENANCE_SCHEDULE_CRON_LENGTH = 128;
int MAINTENANCE_WINDOW_SCHEDULE_LENGTH = 128;
/**
* Maximum length of controllerId.
@@ -81,6 +83,21 @@ public interface Action extends TenantAwareBaseEntity {
*/
Rollout getRollout();
/**
* @return maintenance window schedule related to this {@link Action}.
*/
String getMaintenanceWindowSchedule();
/**
* @return maintenance window duration related to this {@link Action}.
*/
String getMaintenanceWindowDuration();
/**
* @return maintenance window time zone related to this {@link Action}.
*/
String getMaintenanceWindowTimeZone();
/**
* checks if the {@link #getForcedTime()} is hit by the given
* {@code hitTimeMillis}, by means if the given milliseconds are greater
@@ -215,6 +232,15 @@ public interface Action extends TenantAwareBaseEntity {
TIMEFORCED;
}
/**
* Returns the start time of next available maintenance window for the
* {@link Action} as {@link ZonedDateTime}. If a maintenance window is
* already active, the start time of currently active window is returned.
*
* @return the start time as { @link Optional<ZonedDateTime>}.
*/
Optional<ZonedDateTime> getMaintenanceWindowStartTime();
/**
* The method checks whether the action has a maintenance schedule defined
* for it. A maintenance schedule defines a set of maintenance windows