@@ -17,7 +17,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import org.eclipse.hawkbit.artifact.repository.model.DbArtifact;
|
||||
import org.eclipse.hawkbit.ddi.dl.rest.api.DdiDlArtifactStoreControllerRestApi;
|
||||
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.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.jpa.cache.CacheWriteNotify;
|
||||
@@ -149,10 +149,10 @@ public class DdiArtifactStoreController implements DdiDlArtifactStoreControllerR
|
||||
actionStatus.setStatus(Status.DOWNLOAD);
|
||||
|
||||
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());
|
||||
} else {
|
||||
actionStatus.addMessage(Constants.SERVER_MESSAGE_PREFIX + "Target downloads: " + request.getRequestURI());
|
||||
actionStatus.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "Target downloads: " + request.getRequestURI());
|
||||
}
|
||||
controllerManagement.addInformationalActionStatus(actionStatus);
|
||||
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.rest.api.DdiRootControllerRestApi;
|
||||
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.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||
@@ -185,10 +185,10 @@ public class DdiRootController implements DdiRootControllerRestApi {
|
||||
statusMessage.setStatus(Status.DOWNLOAD);
|
||||
|
||||
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());
|
||||
} else {
|
||||
statusMessage.addMessage(Constants.SERVER_MESSAGE_PREFIX + "Target downloads " + request.getRequestURI());
|
||||
statusMessage.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "Target downloads " + request.getRequestURI());
|
||||
}
|
||||
controllerManagement.addInformationalActionStatus(statusMessage);
|
||||
return action;
|
||||
@@ -251,7 +251,7 @@ public class DdiRootController implements DdiRootControllerRestApi {
|
||||
|
||||
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.");
|
||||
|
||||
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,
|
||||
targetid, feedback.getStatus().getExecution());
|
||||
actionStatus.setStatus(Status.CANCELED);
|
||||
actionStatus.addMessage(Constants.SERVER_MESSAGE_PREFIX + "Target confirmed cancelation.");
|
||||
actionStatus.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "Target confirmed cancelation.");
|
||||
break;
|
||||
case REJECTED:
|
||||
LOG.info("Controller reported internal error (actionid: {}, targetid: {}) as we got {} report.", actionid,
|
||||
targetid, feedback.getStatus().getExecution());
|
||||
actionStatus.setStatus(Status.WARNING);
|
||||
actionStatus.addMessage(Constants.SERVER_MESSAGE_PREFIX + "Target REJECTED update.");
|
||||
actionStatus.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "Target REJECTED update.");
|
||||
break;
|
||||
case CLOSED:
|
||||
handleClosedUpdateStatus(feedback, targetid, actionid, actionStatus);
|
||||
@@ -340,7 +340,7 @@ public class DdiRootController implements DdiRootControllerRestApi {
|
||||
targetid, feedback.getStatus().getExecution());
|
||||
actionStatus.setStatus(Status.RUNNING);
|
||||
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,
|
||||
@@ -349,10 +349,10 @@ public class DdiRootController implements DdiRootControllerRestApi {
|
||||
feedback.getStatus().getExecution());
|
||||
if (feedback.getStatus().getResult().getFinished() == FinalResult.FAILURE) {
|
||||
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 {
|
||||
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);
|
||||
|
||||
controllerManagement.registerRetrieved(action, Constants.SERVER_MESSAGE_PREFIX
|
||||
controllerManagement.registerRetrieved(action, RepositoryConstants.SERVER_MESSAGE_PREFIX
|
||||
+ "Target retrieved cancel action and should start now the cancelation.");
|
||||
|
||||
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.Status;
|
||||
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.LocalArtifact;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
@@ -113,7 +113,7 @@ public class DdiDeploymentBaseTest extends AbstractRestIntegrationTestWithMongoD
|
||||
assertThat(deploymentManagement.countActionStatusAll()).isEqualTo(0);
|
||||
|
||||
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);
|
||||
|
||||
final Action action = deploymentManagement.findActiveActionsByTarget(savedTarget).get(0);
|
||||
@@ -250,7 +250,7 @@ public class DdiDeploymentBaseTest extends AbstractRestIntegrationTestWithMongoD
|
||||
assertThat(deploymentManagement.countActionStatusAll()).isEqualTo(0);
|
||||
|
||||
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);
|
||||
|
||||
final Action action = deploymentManagement.findActiveActionsByTarget(savedTarget).get(0);
|
||||
|
||||
Reference in New Issue
Block a user