@@ -17,7 +17,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import org.eclipse.hawkbit.artifact.repository.model.DbArtifact;
|
import org.eclipse.hawkbit.artifact.repository.model.DbArtifact;
|
||||||
import org.eclipse.hawkbit.ddi.dl.rest.api.DdiDlArtifactStoreControllerRestApi;
|
import org.eclipse.hawkbit.ddi.dl.rest.api.DdiDlArtifactStoreControllerRestApi;
|
||||||
import org.eclipse.hawkbit.repository.ArtifactManagement;
|
import org.eclipse.hawkbit.repository.ArtifactManagement;
|
||||||
import org.eclipse.hawkbit.repository.Constants;
|
import org.eclipse.hawkbit.repository.RepositoryConstants;
|
||||||
import org.eclipse.hawkbit.repository.ControllerManagement;
|
import org.eclipse.hawkbit.repository.ControllerManagement;
|
||||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
import org.eclipse.hawkbit.repository.jpa.cache.CacheWriteNotify;
|
import org.eclipse.hawkbit.repository.jpa.cache.CacheWriteNotify;
|
||||||
@@ -149,10 +149,10 @@ public class DdiArtifactStoreController implements DdiDlArtifactStoreControllerR
|
|||||||
actionStatus.setStatus(Status.DOWNLOAD);
|
actionStatus.setStatus(Status.DOWNLOAD);
|
||||||
|
|
||||||
if (range != null) {
|
if (range != null) {
|
||||||
actionStatus.addMessage(Constants.SERVER_MESSAGE_PREFIX + "Target downloads range " + range + " of: "
|
actionStatus.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "Target downloads range " + range + " of: "
|
||||||
+ request.getRequestURI());
|
+ request.getRequestURI());
|
||||||
} else {
|
} else {
|
||||||
actionStatus.addMessage(Constants.SERVER_MESSAGE_PREFIX + "Target downloads: " + request.getRequestURI());
|
actionStatus.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "Target downloads: " + request.getRequestURI());
|
||||||
}
|
}
|
||||||
controllerManagement.addInformationalActionStatus(actionStatus);
|
controllerManagement.addInformationalActionStatus(actionStatus);
|
||||||
return action;
|
return action;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import org.eclipse.hawkbit.ddi.json.model.DdiDeploymentBase;
|
|||||||
import org.eclipse.hawkbit.ddi.json.model.DdiResult.FinalResult;
|
import org.eclipse.hawkbit.ddi.json.model.DdiResult.FinalResult;
|
||||||
import org.eclipse.hawkbit.ddi.rest.api.DdiRootControllerRestApi;
|
import org.eclipse.hawkbit.ddi.rest.api.DdiRootControllerRestApi;
|
||||||
import org.eclipse.hawkbit.repository.ArtifactManagement;
|
import org.eclipse.hawkbit.repository.ArtifactManagement;
|
||||||
import org.eclipse.hawkbit.repository.Constants;
|
import org.eclipse.hawkbit.repository.RepositoryConstants;
|
||||||
import org.eclipse.hawkbit.repository.ControllerManagement;
|
import org.eclipse.hawkbit.repository.ControllerManagement;
|
||||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
@@ -185,10 +185,10 @@ public class DdiRootController implements DdiRootControllerRestApi {
|
|||||||
statusMessage.setStatus(Status.DOWNLOAD);
|
statusMessage.setStatus(Status.DOWNLOAD);
|
||||||
|
|
||||||
if (range != null) {
|
if (range != null) {
|
||||||
statusMessage.addMessage(Constants.SERVER_MESSAGE_PREFIX + "Target downloads range " + range + " of: "
|
statusMessage.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "Target downloads range " + range + " of: "
|
||||||
+ request.getRequestURI());
|
+ request.getRequestURI());
|
||||||
} else {
|
} else {
|
||||||
statusMessage.addMessage(Constants.SERVER_MESSAGE_PREFIX + "Target downloads " + request.getRequestURI());
|
statusMessage.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "Target downloads " + request.getRequestURI());
|
||||||
}
|
}
|
||||||
controllerManagement.addInformationalActionStatus(statusMessage);
|
controllerManagement.addInformationalActionStatus(statusMessage);
|
||||||
return action;
|
return action;
|
||||||
@@ -251,7 +251,7 @@ public class DdiRootController implements DdiRootControllerRestApi {
|
|||||||
|
|
||||||
LOG.debug("Found an active UpdateAction for target {}. returning deyploment: {}", targetid, base);
|
LOG.debug("Found an active UpdateAction for target {}. returning deyploment: {}", targetid, base);
|
||||||
|
|
||||||
controllerManagement.registerRetrieved(action, Constants.SERVER_MESSAGE_PREFIX
|
controllerManagement.registerRetrieved(action, RepositoryConstants.SERVER_MESSAGE_PREFIX
|
||||||
+ "Target retrieved update action and should start now the download.");
|
+ "Target retrieved update action and should start now the download.");
|
||||||
|
|
||||||
return new ResponseEntity<>(base, HttpStatus.OK);
|
return new ResponseEntity<>(base, HttpStatus.OK);
|
||||||
@@ -306,13 +306,13 @@ public class DdiRootController implements DdiRootControllerRestApi {
|
|||||||
LOG.debug("Controller confirmed cancel (actionid: {}, targetid: {}) as we got {} report.", actionid,
|
LOG.debug("Controller confirmed cancel (actionid: {}, targetid: {}) as we got {} report.", actionid,
|
||||||
targetid, feedback.getStatus().getExecution());
|
targetid, feedback.getStatus().getExecution());
|
||||||
actionStatus.setStatus(Status.CANCELED);
|
actionStatus.setStatus(Status.CANCELED);
|
||||||
actionStatus.addMessage(Constants.SERVER_MESSAGE_PREFIX + "Target confirmed cancelation.");
|
actionStatus.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "Target confirmed cancelation.");
|
||||||
break;
|
break;
|
||||||
case REJECTED:
|
case REJECTED:
|
||||||
LOG.info("Controller reported internal error (actionid: {}, targetid: {}) as we got {} report.", actionid,
|
LOG.info("Controller reported internal error (actionid: {}, targetid: {}) as we got {} report.", actionid,
|
||||||
targetid, feedback.getStatus().getExecution());
|
targetid, feedback.getStatus().getExecution());
|
||||||
actionStatus.setStatus(Status.WARNING);
|
actionStatus.setStatus(Status.WARNING);
|
||||||
actionStatus.addMessage(Constants.SERVER_MESSAGE_PREFIX + "Target REJECTED update.");
|
actionStatus.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "Target REJECTED update.");
|
||||||
break;
|
break;
|
||||||
case CLOSED:
|
case CLOSED:
|
||||||
handleClosedUpdateStatus(feedback, targetid, actionid, actionStatus);
|
handleClosedUpdateStatus(feedback, targetid, actionid, actionStatus);
|
||||||
@@ -340,7 +340,7 @@ public class DdiRootController implements DdiRootControllerRestApi {
|
|||||||
targetid, feedback.getStatus().getExecution());
|
targetid, feedback.getStatus().getExecution());
|
||||||
actionStatus.setStatus(Status.RUNNING);
|
actionStatus.setStatus(Status.RUNNING);
|
||||||
actionStatus
|
actionStatus
|
||||||
.addMessage(Constants.SERVER_MESSAGE_PREFIX + "Target reported " + feedback.getStatus().getExecution());
|
.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "Target reported " + feedback.getStatus().getExecution());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void handleClosedUpdateStatus(final DdiActionFeedback feedback, final String targetid,
|
private static void handleClosedUpdateStatus(final DdiActionFeedback feedback, final String targetid,
|
||||||
@@ -349,10 +349,10 @@ public class DdiRootController implements DdiRootControllerRestApi {
|
|||||||
feedback.getStatus().getExecution());
|
feedback.getStatus().getExecution());
|
||||||
if (feedback.getStatus().getResult().getFinished() == FinalResult.FAILURE) {
|
if (feedback.getStatus().getResult().getFinished() == FinalResult.FAILURE) {
|
||||||
actionStatus.setStatus(Status.ERROR);
|
actionStatus.setStatus(Status.ERROR);
|
||||||
actionStatus.addMessage(Constants.SERVER_MESSAGE_PREFIX + "Target reported CLOSED with ERROR!");
|
actionStatus.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "Target reported CLOSED with ERROR!");
|
||||||
} else {
|
} else {
|
||||||
actionStatus.setStatus(Status.FINISHED);
|
actionStatus.setStatus(Status.FINISHED);
|
||||||
actionStatus.addMessage(Constants.SERVER_MESSAGE_PREFIX + "Target reported CLOSED with OK!");
|
actionStatus.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "Target reported CLOSED with OK!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -390,7 +390,7 @@ public class DdiRootController implements DdiRootControllerRestApi {
|
|||||||
|
|
||||||
LOG.debug("Found an active CancelAction for target {}. returning cancel: {}", targetid, cancel);
|
LOG.debug("Found an active CancelAction for target {}. returning cancel: {}", targetid, cancel);
|
||||||
|
|
||||||
controllerManagement.registerRetrieved(action, Constants.SERVER_MESSAGE_PREFIX
|
controllerManagement.registerRetrieved(action, RepositoryConstants.SERVER_MESSAGE_PREFIX
|
||||||
+ "Target retrieved cancel action and should start now the cancelation.");
|
+ "Target retrieved cancel action and should start now the cancelation.");
|
||||||
|
|
||||||
return new ResponseEntity<>(cancel, HttpStatus.OK);
|
return new ResponseEntity<>(cancel, HttpStatus.OK);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import org.eclipse.hawkbit.repository.model.Action;
|
|||||||
import org.eclipse.hawkbit.repository.model.Action.ActionType;
|
import org.eclipse.hawkbit.repository.model.Action.ActionType;
|
||||||
import org.eclipse.hawkbit.repository.model.Action.Status;
|
import org.eclipse.hawkbit.repository.model.Action.Status;
|
||||||
import org.eclipse.hawkbit.repository.model.ActionStatus;
|
import org.eclipse.hawkbit.repository.model.ActionStatus;
|
||||||
import org.eclipse.hawkbit.repository.model.Constants;
|
import org.eclipse.hawkbit.repository.model.RepositoryModelConstants;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||||
import org.eclipse.hawkbit.repository.model.LocalArtifact;
|
import org.eclipse.hawkbit.repository.model.LocalArtifact;
|
||||||
import org.eclipse.hawkbit.repository.model.Target;
|
import org.eclipse.hawkbit.repository.model.Target;
|
||||||
@@ -113,7 +113,7 @@ public class DdiDeploymentBaseTest extends AbstractRestIntegrationTestWithMongoD
|
|||||||
assertThat(deploymentManagement.countActionStatusAll()).isEqualTo(0);
|
assertThat(deploymentManagement.countActionStatusAll()).isEqualTo(0);
|
||||||
|
|
||||||
List<Target> saved = deploymentManagement.assignDistributionSet(ds.getId(), ActionType.FORCED,
|
List<Target> saved = deploymentManagement.assignDistributionSet(ds.getId(), ActionType.FORCED,
|
||||||
Constants.NO_FORCE_TIME, savedTarget.getControllerId()).getAssignedEntity();
|
RepositoryModelConstants.NO_FORCE_TIME, savedTarget.getControllerId()).getAssignedEntity();
|
||||||
assertThat(deploymentManagement.findActiveActionsByTarget(savedTarget)).hasSize(1);
|
assertThat(deploymentManagement.findActiveActionsByTarget(savedTarget)).hasSize(1);
|
||||||
|
|
||||||
final Action action = deploymentManagement.findActiveActionsByTarget(savedTarget).get(0);
|
final Action action = deploymentManagement.findActiveActionsByTarget(savedTarget).get(0);
|
||||||
@@ -250,7 +250,7 @@ public class DdiDeploymentBaseTest extends AbstractRestIntegrationTestWithMongoD
|
|||||||
assertThat(deploymentManagement.countActionStatusAll()).isEqualTo(0);
|
assertThat(deploymentManagement.countActionStatusAll()).isEqualTo(0);
|
||||||
|
|
||||||
List<Target> saved = deploymentManagement.assignDistributionSet(ds.getId(), ActionType.SOFT,
|
List<Target> saved = deploymentManagement.assignDistributionSet(ds.getId(), ActionType.SOFT,
|
||||||
Constants.NO_FORCE_TIME, savedTarget.getControllerId()).getAssignedEntity();
|
RepositoryModelConstants.NO_FORCE_TIME, savedTarget.getControllerId()).getAssignedEntity();
|
||||||
assertThat(deploymentManagement.findActiveActionsByTarget(savedTarget)).hasSize(1);
|
assertThat(deploymentManagement.findActiveActionsByTarget(savedTarget)).hasSize(1);
|
||||||
|
|
||||||
final Action action = deploymentManagement.findActiveActionsByTarget(savedTarget).get(0);
|
final Action action = deploymentManagement.findActiveActionsByTarget(savedTarget).get(0);
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import org.eclipse.hawkbit.dmf.json.model.DownloadAndUpdateRequest;
|
|||||||
import org.eclipse.hawkbit.dmf.json.model.SoftwareModule;
|
import org.eclipse.hawkbit.dmf.json.model.SoftwareModule;
|
||||||
import org.eclipse.hawkbit.eventbus.EventSubscriber;
|
import org.eclipse.hawkbit.eventbus.EventSubscriber;
|
||||||
import org.eclipse.hawkbit.eventbus.event.CancelTargetAssignmentEvent;
|
import org.eclipse.hawkbit.eventbus.event.CancelTargetAssignmentEvent;
|
||||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
|
||||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetAssignDistributionSetEvent;
|
import org.eclipse.hawkbit.repository.eventbus.event.TargetAssignDistributionSetEvent;
|
||||||
import org.eclipse.hawkbit.repository.model.LocalArtifact;
|
import org.eclipse.hawkbit.repository.model.LocalArtifact;
|
||||||
import org.eclipse.hawkbit.util.IpUtil;
|
import org.eclipse.hawkbit.util.IpUtil;
|
||||||
@@ -53,14 +52,11 @@ public class AmqpMessageDispatcherService extends BaseAmqpService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private AmqpSenderService amqpSenderService;
|
private AmqpSenderService amqpSenderService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SoftwareManagement softwareManagement;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param messageConverter
|
* @param rabbitTemplate
|
||||||
* message converter
|
* the rabbitTemplate
|
||||||
*/
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
public AmqpMessageDispatcherService(final RabbitTemplate rabbitTemplate) {
|
public AmqpMessageDispatcherService(final RabbitTemplate rabbitTemplate) {
|
||||||
@@ -118,7 +114,7 @@ public class AmqpMessageDispatcherService extends BaseAmqpService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private MessageProperties createConnectorMessageProperties(final String tenant, final String controllerId,
|
private static MessageProperties createConnectorMessageProperties(final String tenant, final String controllerId,
|
||||||
final EventTopic topic) {
|
final EventTopic topic) {
|
||||||
final MessageProperties messageProperties = createMessageProperties();
|
final MessageProperties messageProperties = createMessageProperties();
|
||||||
messageProperties.setHeader(MessageHeaderKey.TOPIC, topic);
|
messageProperties.setHeader(MessageHeaderKey.TOPIC, topic);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
|||||||
* Repository constants.
|
* Repository constants.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public final class Constants {
|
public final class RepositoryConstants {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prefix that the server puts in front of
|
* Prefix that the server puts in front of
|
||||||
@@ -30,7 +30,7 @@ public final class Constants {
|
|||||||
*/
|
*/
|
||||||
public static final int DEFAULT_DS_TYPES_IN_TENANT = 2;
|
public static final int DEFAULT_DS_TYPES_IN_TENANT = 2;
|
||||||
|
|
||||||
private Constants() {
|
private RepositoryConstants() {
|
||||||
// Utility class.
|
// Utility class.
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ public interface SystemManagement {
|
|||||||
/**
|
/**
|
||||||
* Returns {@link TenantMetaData} of given and current tenant. Creates for
|
* Returns {@link TenantMetaData} of given and current tenant. Creates for
|
||||||
* new tenants also two {@link SoftwareModuleType} (os and app) and
|
* new tenants also two {@link SoftwareModuleType} (os and app) and
|
||||||
* {@link Constants#DEFAULT_DS_TYPES_IN_TENANT} {@link DistributionSetType}s
|
* {@link RepositoryConstants#DEFAULT_DS_TYPES_IN_TENANT} {@link DistributionSetType}s
|
||||||
* (os and os_app).
|
* (os and os_app).
|
||||||
*
|
*
|
||||||
* DISCLAIMER: this variant is used during initial login (where the tenant
|
* DISCLAIMER: this variant is used during initial login (where the tenant
|
||||||
|
|||||||
@@ -601,4 +601,4 @@ public interface TargetManagement {
|
|||||||
+ SpringEvalExpressions.IS_CONTROLLER)
|
+ SpringEvalExpressions.IS_CONTROLLER)
|
||||||
List<Target> updateTargets(@NotNull Collection<Target> targets);
|
List<Target> updateTargets(@NotNull Collection<Target> targets);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,4 +45,4 @@ public interface ActionWithStatusCount {
|
|||||||
*/
|
*/
|
||||||
String getRolloutName();
|
String getRolloutName();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,4 +39,4 @@ public interface Artifact extends TenantAwareBaseEntity {
|
|||||||
*/
|
*/
|
||||||
Long getSize();
|
Long getSize();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,4 +46,4 @@ public interface BaseEntity extends Serializable, Identifiable<Long> {
|
|||||||
*/
|
*/
|
||||||
long getOptLockRevision();
|
long getOptLockRevision();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,4 +129,4 @@ public interface DistributionSet extends NamedVersionedEntity {
|
|||||||
*/
|
*/
|
||||||
boolean isComplete();
|
boolean isComplete();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,4 +19,4 @@ public interface DistributionSetMetadata extends MetaData {
|
|||||||
*/
|
*/
|
||||||
DistributionSet getDistributionSet();
|
DistributionSet getDistributionSet();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,4 +22,4 @@ public interface DistributionSetTag extends Tag {
|
|||||||
*/
|
*/
|
||||||
List<DistributionSet> getAssignedToDistributionSet();
|
List<DistributionSet> getAssignedToDistributionSet();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,4 +170,4 @@ public interface DistributionSetType extends NamedEntity {
|
|||||||
*/
|
*/
|
||||||
void setColour(final String colour);
|
void setColour(final String colour);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,4 +38,4 @@ public interface ExternalArtifact extends Artifact {
|
|||||||
*/
|
*/
|
||||||
void setUrlSuffix(String urlSuffix);
|
void setUrlSuffix(String urlSuffix);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,4 +36,4 @@ public interface MetaData extends Serializable {
|
|||||||
*/
|
*/
|
||||||
void setValue(String value);
|
void setValue(String value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,4 +25,4 @@ public interface NamedVersionedEntity extends NamedEntity {
|
|||||||
*/
|
*/
|
||||||
void setVersion(String version);
|
void setVersion(String version);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ package org.eclipse.hawkbit.repository.model;
|
|||||||
* Repository model constants.
|
* Repository model constants.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public final class Constants {
|
public final class RepositoryModelConstants {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* indicating that target action has no force time which is only needed in
|
* indicating that target action has no force time which is only needed in
|
||||||
@@ -20,7 +20,7 @@ public final class Constants {
|
|||||||
*/
|
*/
|
||||||
public static final Long NO_FORCE_TIME = 0L;
|
public static final Long NO_FORCE_TIME = 0L;
|
||||||
|
|
||||||
private Constants() {
|
private RepositoryModelConstants() {
|
||||||
// Utility class.
|
// Utility class.
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,4 +156,4 @@ public interface Rollout extends NamedEntity {
|
|||||||
ERROR_STARTING;
|
ERROR_STARTING;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,4 +108,4 @@ public interface SoftwareModule extends NamedVersionedEntity {
|
|||||||
*/
|
*/
|
||||||
List<DistributionSet> getAssignedTo();
|
List<DistributionSet> getAssignedTo();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,4 +25,4 @@ public interface SoftwareModuleMetadata extends MetaData {
|
|||||||
*/
|
*/
|
||||||
void setSoftwareModule(SoftwareModule softwareModule);
|
void setSoftwareModule(SoftwareModule softwareModule);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,4 +57,4 @@ public interface SoftwareModuleType extends NamedEntity {
|
|||||||
*/
|
*/
|
||||||
void setColour(final String colour);
|
void setColour(final String colour);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,4 +24,4 @@ public interface Tag extends NamedEntity {
|
|||||||
*/
|
*/
|
||||||
void setColour(String colour);
|
void setColour(String colour);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,4 +56,4 @@ public interface TargetFilterQuery extends TenantAwareBaseEntity {
|
|||||||
*/
|
*/
|
||||||
void setQuery(String query);
|
void setQuery(String query);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,4 +68,4 @@ public interface TargetInfo extends Serializable {
|
|||||||
*/
|
*/
|
||||||
boolean isRequestControllerAttributes();
|
boolean isRequestControllerAttributes();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,4 +21,4 @@ public interface TargetTag extends Tag {
|
|||||||
*/
|
*/
|
||||||
List<Target> getAssignedToTargets();
|
List<Target> getAssignedToTargets();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class TargetWithActionStatus {
|
|||||||
|
|
||||||
private Target target;
|
private Target target;
|
||||||
|
|
||||||
private Status status = null;
|
private Status status;
|
||||||
|
|
||||||
public TargetWithActionStatus(final Target target) {
|
public TargetWithActionStatus(final Target target) {
|
||||||
this.target = target;
|
this.target = target;
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class TargetWithActionType {
|
|||||||
if (actionType == ActionType.TIMEFORCED) {
|
if (actionType == ActionType.TIMEFORCED) {
|
||||||
return forceTime;
|
return forceTime;
|
||||||
}
|
}
|
||||||
return Constants.NO_FORCE_TIME;
|
return RepositoryModelConstants.NO_FORCE_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -19,4 +19,4 @@ public interface TenantAwareBaseEntity extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
String getTenant();
|
String getTenant();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,4 +37,4 @@ public interface TenantConfiguration extends TenantAwareBaseEntity {
|
|||||||
*/
|
*/
|
||||||
void setValue(String value);
|
void setValue(String value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,4 +31,4 @@ public interface TenantMetaData extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
String getTenant();
|
String getTenant();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import javax.persistence.criteria.CriteriaQuery;
|
|||||||
import javax.persistence.criteria.Root;
|
import javax.persistence.criteria.Root;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.Constants;
|
import org.eclipse.hawkbit.repository.RepositoryConstants;
|
||||||
import org.eclipse.hawkbit.repository.ControllerManagement;
|
import org.eclipse.hawkbit.repository.ControllerManagement;
|
||||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||||
import org.eclipse.hawkbit.repository.TenantConfigurationManagement;
|
import org.eclipse.hawkbit.repository.TenantConfigurationManagement;
|
||||||
@@ -216,7 +216,7 @@ public class JpaControllerManagement implements ControllerManagement {
|
|||||||
handleFinishedCancelation(actionStatus, action);
|
handleFinishedCancelation(actionStatus, action);
|
||||||
break;
|
break;
|
||||||
case RETRIEVED:
|
case RETRIEVED:
|
||||||
actionStatus.addMessage(Constants.SERVER_MESSAGE_PREFIX + "Cancellation request retrieved.");
|
actionStatus.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "Cancellation request retrieved.");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// do nothing
|
// do nothing
|
||||||
@@ -230,7 +230,7 @@ public class JpaControllerManagement implements ControllerManagement {
|
|||||||
private void handleFinishedCancelation(final ActionStatus actionStatus, final JpaAction action) {
|
private void handleFinishedCancelation(final ActionStatus actionStatus, final JpaAction action) {
|
||||||
// in case of successful cancellation we also report the success at
|
// in case of successful cancellation we also report the success at
|
||||||
// the canceled action itself.
|
// the canceled action itself.
|
||||||
actionStatus.addMessage(Constants.SERVER_MESSAGE_PREFIX + "Cancellation completion is finished sucessfully.");
|
actionStatus.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "Cancellation completion is finished sucessfully.");
|
||||||
DeploymentHelper.successCancellation(action, actionRepository, targetManagement, targetInfoRepository,
|
DeploymentHelper.successCancellation(action, actionRepository, targetManagement, targetInfoRepository,
|
||||||
entityManager);
|
entityManager);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ public class JpaDeploymentManagement implements DeploymentManagement {
|
|||||||
|
|
||||||
return assignDistributionSetByTargetId((JpaDistributionSet) pset,
|
return assignDistributionSetByTargetId((JpaDistributionSet) pset,
|
||||||
targets.stream().map(target -> target.getControllerId()).collect(Collectors.toList()),
|
targets.stream().map(target -> target.getControllerId()).collect(Collectors.toList()),
|
||||||
ActionType.FORCED, org.eclipse.hawkbit.repository.model.Constants.NO_FORCE_TIME);
|
ActionType.FORCED, org.eclipse.hawkbit.repository.model.RepositoryModelConstants.NO_FORCE_TIME);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ public class JpaDeploymentManagement implements DeploymentManagement {
|
|||||||
@CacheEvict(value = { "distributionUsageAssigned" }, allEntries = true)
|
@CacheEvict(value = { "distributionUsageAssigned" }, allEntries = true)
|
||||||
public DistributionSetAssignmentResult assignDistributionSet(final Long dsID, final String... targetIDs) {
|
public DistributionSetAssignmentResult assignDistributionSet(final Long dsID, final String... targetIDs) {
|
||||||
return assignDistributionSet(dsID, ActionType.FORCED,
|
return assignDistributionSet(dsID, ActionType.FORCED,
|
||||||
org.eclipse.hawkbit.repository.model.Constants.NO_FORCE_TIME, targetIDs);
|
org.eclipse.hawkbit.repository.model.RepositoryModelConstants.NO_FORCE_TIME, targetIDs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ package org.eclipse.hawkbit.repository.jpa.cache;
|
|||||||
import org.eclipse.hawkbit.repository.jpa.model.CacheFieldEntityListener;
|
import org.eclipse.hawkbit.repository.jpa.model.CacheFieldEntityListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constants for cache keys used in multiple classes.
|
* RepositoryConstants for cache keys used in multiple classes.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -842,7 +842,7 @@ public class DeploymentManagementTest extends AbstractJpaIntegrationTest {
|
|||||||
final DistributionSet ds = testdataFactory.createDistributionSet("a");
|
final DistributionSet ds = testdataFactory.createDistributionSet("a");
|
||||||
// assign ds to create an action
|
// assign ds to create an action
|
||||||
final DistributionSetAssignmentResult assignDistributionSet = deploymentManagement.assignDistributionSet(
|
final DistributionSetAssignmentResult assignDistributionSet = deploymentManagement.assignDistributionSet(
|
||||||
ds.getId(), ActionType.SOFT, org.eclipse.hawkbit.repository.model.Constants.NO_FORCE_TIME,
|
ds.getId(), ActionType.SOFT, org.eclipse.hawkbit.repository.model.RepositoryModelConstants.NO_FORCE_TIME,
|
||||||
target.getControllerId());
|
target.getControllerId());
|
||||||
final Action action = deploymentManagement.findActionWithDetails(assignDistributionSet.getActions().get(0));
|
final Action action = deploymentManagement.findActionWithDetails(assignDistributionSet.getActions().get(0));
|
||||||
// verify preparation
|
// verify preparation
|
||||||
@@ -865,7 +865,7 @@ public class DeploymentManagementTest extends AbstractJpaIntegrationTest {
|
|||||||
final DistributionSet ds = testdataFactory.createDistributionSet("a");
|
final DistributionSet ds = testdataFactory.createDistributionSet("a");
|
||||||
// assign ds to create an action
|
// assign ds to create an action
|
||||||
final DistributionSetAssignmentResult assignDistributionSet = deploymentManagement.assignDistributionSet(
|
final DistributionSetAssignmentResult assignDistributionSet = deploymentManagement.assignDistributionSet(
|
||||||
ds.getId(), ActionType.FORCED, org.eclipse.hawkbit.repository.model.Constants.NO_FORCE_TIME,
|
ds.getId(), ActionType.FORCED, org.eclipse.hawkbit.repository.model.RepositoryModelConstants.NO_FORCE_TIME,
|
||||||
target.getControllerId());
|
target.getControllerId());
|
||||||
final Action action = deploymentManagement.findActionWithDetails(assignDistributionSet.getActions().get(0));
|
final Action action = deploymentManagement.findActionWithDetails(assignDistributionSet.getActions().get(0));
|
||||||
// verify perparation
|
// verify perparation
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ package org.eclipse.hawkbit.repository.util;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.ExcludePathAwareShallowETagFilter;
|
import org.eclipse.hawkbit.ExcludePathAwareShallowETagFilter;
|
||||||
import org.eclipse.hawkbit.repository.ArtifactManagement;
|
import org.eclipse.hawkbit.repository.ArtifactManagement;
|
||||||
import org.eclipse.hawkbit.repository.Constants;
|
import org.eclipse.hawkbit.repository.RepositoryConstants;
|
||||||
import org.eclipse.hawkbit.repository.ControllerManagement;
|
import org.eclipse.hawkbit.repository.ControllerManagement;
|
||||||
import org.eclipse.hawkbit.repository.DeploymentManagement;
|
import org.eclipse.hawkbit.repository.DeploymentManagement;
|
||||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||||
@@ -72,7 +72,7 @@ public abstract class AbstractIntegrationTest implements EnvironmentAware {
|
|||||||
* {@link TestdataFactory#findOrCreateDefaultTestDsType()} and two
|
* {@link TestdataFactory#findOrCreateDefaultTestDsType()} and two
|
||||||
* {@link SystemManagement#getTenantMetadata()};
|
* {@link SystemManagement#getTenantMetadata()};
|
||||||
*/
|
*/
|
||||||
protected static final int DEFAULT_DS_TYPES = Constants.DEFAULT_DS_TYPES_IN_TENANT + 1;
|
protected static final int DEFAULT_DS_TYPES = RepositoryConstants.DEFAULT_DS_TYPES_IN_TENANT + 1;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
protected EntityFactory entityFactory;
|
protected EntityFactory entityFactory;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import org.eclipse.hawkbit.repository.DistributionSetAssignmentResult;
|
|||||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||||
import org.eclipse.hawkbit.repository.model.Action.ActionType;
|
import org.eclipse.hawkbit.repository.model.Action.ActionType;
|
||||||
import org.eclipse.hawkbit.repository.model.Constants;
|
import org.eclipse.hawkbit.repository.model.RepositoryModelConstants;
|
||||||
import org.eclipse.hawkbit.repository.model.TargetIdName;
|
import org.eclipse.hawkbit.repository.model.TargetIdName;
|
||||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||||
import org.eclipse.hawkbit.ui.common.confirmwindow.layout.AbstractConfirmationWindowLayout;
|
import org.eclipse.hawkbit.ui.common.confirmwindow.layout.AbstractConfirmationWindowLayout;
|
||||||
@@ -148,7 +148,7 @@ public class ManangementConfirmationWindowLayout extends AbstractConfirmationWin
|
|||||||
final long forcedTimeStamp = (((ActionTypeOptionGroupLayout.ActionTypeOption) actionTypeOptionGroupLayout
|
final long forcedTimeStamp = (((ActionTypeOptionGroupLayout.ActionTypeOption) actionTypeOptionGroupLayout
|
||||||
.getActionTypeOptionGroup().getValue()) == ActionTypeOption.AUTO_FORCED)
|
.getActionTypeOptionGroup().getValue()) == ActionTypeOption.AUTO_FORCED)
|
||||||
? actionTypeOptionGroupLayout.getForcedTimeDateField().getValue().getTime()
|
? actionTypeOptionGroupLayout.getForcedTimeDateField().getValue().getTime()
|
||||||
: Constants.NO_FORCE_TIME;
|
: RepositoryModelConstants.NO_FORCE_TIME;
|
||||||
|
|
||||||
final Map<Long, ArrayList<TargetIdName>> saveAssignedList = new HashMap<>();
|
final Map<Long, ArrayList<TargetIdName>> saveAssignedList = new HashMap<>();
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import org.eclipse.hawkbit.repository.EntityFactory;
|
|||||||
import org.eclipse.hawkbit.repository.RolloutManagement;
|
import org.eclipse.hawkbit.repository.RolloutManagement;
|
||||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||||
import org.eclipse.hawkbit.repository.model.Action.ActionType;
|
import org.eclipse.hawkbit.repository.model.Action.ActionType;
|
||||||
import org.eclipse.hawkbit.repository.model.Constants;
|
import org.eclipse.hawkbit.repository.model.RepositoryModelConstants;
|
||||||
import org.eclipse.hawkbit.repository.model.Rollout;
|
import org.eclipse.hawkbit.repository.model.Rollout;
|
||||||
import org.eclipse.hawkbit.repository.model.Rollout.RolloutStatus;
|
import org.eclipse.hawkbit.repository.model.Rollout.RolloutStatus;
|
||||||
import org.eclipse.hawkbit.repository.model.RolloutGroup;
|
import org.eclipse.hawkbit.repository.model.RolloutGroup;
|
||||||
@@ -465,7 +465,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
return (((ActionTypeOptionGroupLayout.ActionTypeOption) actionTypeOptionGroupLayout.getActionTypeOptionGroup()
|
return (((ActionTypeOptionGroupLayout.ActionTypeOption) actionTypeOptionGroupLayout.getActionTypeOptionGroup()
|
||||||
.getValue()) == ActionTypeOption.AUTO_FORCED)
|
.getValue()) == ActionTypeOption.AUTO_FORCED)
|
||||||
? actionTypeOptionGroupLayout.getForcedTimeDateField().getValue().getTime()
|
? actionTypeOptionGroupLayout.getForcedTimeDateField().getValue().getTime()
|
||||||
: Constants.NO_FORCE_TIME;
|
: RepositoryModelConstants.NO_FORCE_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ActionType getActionType() {
|
private ActionType getActionType() {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
package org.eclipse.hawkbit.ui.utils;
|
package org.eclipse.hawkbit.ui.utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constants required for Button.
|
* RepositoryConstants required for Button.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ package org.eclipse.hawkbit.ui.utils;
|
|||||||
import com.vaadin.ui.themes.ValoTheme;
|
import com.vaadin.ui.themes.ValoTheme;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constants required for Label.
|
* RepositoryConstants required for Label.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
package org.eclipse.hawkbit.ui.utils;
|
package org.eclipse.hawkbit.ui.utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constants required for Style.
|
* RepositoryConstants required for Style.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
package org.eclipse.hawkbit.ui.utils;
|
package org.eclipse.hawkbit.ui.utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constants required for Target.
|
* RepositoryConstants required for Target.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user