Initial Contribution of the rollout-management feature
- Repository functionality for rollout, rolloutgroup entities - Rollout scheduler to watch and handle running rollouts and start next group of rollout - Vaadin view to administrate rollouts and reflect the current rollout status - REST resources to cover rollout creation, updating, starting, pausing and resuming Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.eventbus.event;
|
||||
|
||||
/**
|
||||
* Abstract event definition class which holds the necessary revsion and tenant
|
||||
* information which every event needs.
|
||||
*
|
||||
* @author Michael Hirsch
|
||||
* @see AbstractDistributedEvent for events which should be distributed to other
|
||||
* cluster nodes
|
||||
*/
|
||||
public class AbstractEvent implements Event {
|
||||
|
||||
private final long revision;
|
||||
private final String tenant;
|
||||
|
||||
/**
|
||||
* @param revision
|
||||
* the revision number of the event
|
||||
* @param tenant
|
||||
* the tenant of the event
|
||||
*/
|
||||
protected AbstractEvent(final long revision, final String tenant) {
|
||||
this.revision = revision;
|
||||
this.tenant = tenant;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getRevision() {
|
||||
return revision;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTenant() {
|
||||
return tenant;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,7 +17,7 @@ import java.net.URI;
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class CancelTargetAssignmentEvent {
|
||||
public class CancelTargetAssignmentEvent extends AbstractEvent {
|
||||
|
||||
private final String controllerId;
|
||||
private final Long actionId;
|
||||
@@ -26,6 +26,10 @@ public class CancelTargetAssignmentEvent {
|
||||
/**
|
||||
* Creates a new {@link CancelTargetAssignmentEvent}.
|
||||
*
|
||||
* @param revision
|
||||
* the revision for this event
|
||||
* @param tenant
|
||||
* the tenant for this event
|
||||
* @param controllerId
|
||||
* the ID of the controller
|
||||
* @param actionId
|
||||
@@ -33,7 +37,9 @@ public class CancelTargetAssignmentEvent {
|
||||
* @param targetAdress
|
||||
* the targetAdress of the target
|
||||
*/
|
||||
public CancelTargetAssignmentEvent(final String controllerId, final Long actionId, final URI targetAdress) {
|
||||
public CancelTargetAssignmentEvent(final long revision, final String tenant, final String controllerId,
|
||||
final Long actionId, final URI targetAdress) {
|
||||
super(revision, tenant);
|
||||
this.controllerId = controllerId;
|
||||
this.actionId = actionId;
|
||||
this.targetAdress = targetAdress;
|
||||
|
||||
@@ -174,7 +174,13 @@ public enum SpServerError {
|
||||
*
|
||||
*/
|
||||
SP_REPO_ENTITY_READ_ONLY("hawkbit.server.error.entityreadonly",
|
||||
"The given entity is read only and the change cannot be completed.");
|
||||
"The given entity is read only and the change cannot be completed."),
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
SP_ROLLOUT_ILLEGAL_STATE("hawkbit.server.error.rollout.illegalstate",
|
||||
"The rollout is currently in the wrong state for the current operation");
|
||||
|
||||
private final String key;
|
||||
private final String message;
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository;
|
||||
|
||||
/**
|
||||
* Describing the fields of the Rollout model which can be used in the REST API
|
||||
* e.g. for sorting etc.
|
||||
*
|
||||
*/
|
||||
public enum RolloutFields implements FieldNameProvider {
|
||||
/**
|
||||
* The name field.
|
||||
*/
|
||||
NAME("name"),
|
||||
/**
|
||||
* The description field.
|
||||
*/
|
||||
DESCRIPTION("description"),
|
||||
/**
|
||||
* The id field.
|
||||
*/
|
||||
ID("id");
|
||||
|
||||
private final String fieldName;
|
||||
|
||||
private RolloutFields(final String fieldName) {
|
||||
this.fieldName = fieldName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFieldName() {
|
||||
return fieldName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository;
|
||||
|
||||
/**
|
||||
* Describing the fields of the RolloutGroup model which can be used in the REST
|
||||
* API e.g. for sorting etc.
|
||||
*
|
||||
*/
|
||||
public enum RolloutGroupFields implements FieldNameProvider {
|
||||
/**
|
||||
* The name field.
|
||||
*/
|
||||
NAME("name"),
|
||||
/**
|
||||
* The description field.
|
||||
*/
|
||||
DESCRIPTION("description"),
|
||||
/**
|
||||
* The id field.
|
||||
*/
|
||||
ID("id");
|
||||
|
||||
private final String fieldName;
|
||||
|
||||
private RolloutGroupFields(final String fieldName) {
|
||||
this.fieldName = fieldName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFieldName() {
|
||||
return fieldName;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user