Improved readability of action status messages that are created by the
update server itself. Signed-off-by: Kai Zimmermann <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -63,6 +63,8 @@ public class ControllerManagement {
|
|||||||
private static final Logger LOG = LoggerFactory.getLogger(ControllerManagement.class);
|
private static final Logger LOG = LoggerFactory.getLogger(ControllerManagement.class);
|
||||||
private static final Logger LOG_DOS = LoggerFactory.getLogger("server-security.dos");
|
private static final Logger LOG_DOS = LoggerFactory.getLogger("server-security.dos");
|
||||||
|
|
||||||
|
public static final String SERVER_MESSAGE_PREFIX = "Update Server: ";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private EntityManager entityManager;
|
private EntityManager entityManager;
|
||||||
|
|
||||||
@@ -341,13 +343,14 @@ public class ControllerManagement {
|
|||||||
break;
|
break;
|
||||||
case CANCELED:
|
case CANCELED:
|
||||||
case FINISHED:
|
case FINISHED:
|
||||||
// in case of successful cancelation 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("Cancelation completion is finished sucessfully.");
|
actionStatus.addMessage(
|
||||||
|
ControllerManagement.SERVER_MESSAGE_PREFIX + "Cancellation completion is finished sucessfully.");
|
||||||
deploymentManagement.successCancellation(action);
|
deploymentManagement.successCancellation(action);
|
||||||
break;
|
break;
|
||||||
case RETRIEVED:
|
case RETRIEVED:
|
||||||
actionStatus.addMessage("Cancelation request retrieved");
|
actionStatus.addMessage(ControllerManagement.SERVER_MESSAGE_PREFIX + "Cancellation request retrieved.");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,9 +143,11 @@ public class ArtifactStoreController {
|
|||||||
actionStatus.setStatus(Status.DOWNLOAD);
|
actionStatus.setStatus(Status.DOWNLOAD);
|
||||||
|
|
||||||
if (range != null) {
|
if (range != null) {
|
||||||
actionStatus.addMessage("It is a partial download request: " + range);
|
actionStatus.addMessage(ControllerManagement.SERVER_MESSAGE_PREFIX + "Target downloads range " + range
|
||||||
|
+ " of: " + request.getRequestURI());
|
||||||
} else {
|
} else {
|
||||||
actionStatus.addMessage("Target downloads");
|
actionStatus.addMessage(
|
||||||
|
ControllerManagement.SERVER_MESSAGE_PREFIX + "Target downloads: " + request.getRequestURI());
|
||||||
}
|
}
|
||||||
controllerManagement.addActionStatusMessage(actionStatus);
|
controllerManagement.addActionStatusMessage(actionStatus);
|
||||||
return action;
|
return action;
|
||||||
|
|||||||
@@ -216,9 +216,11 @@ public class RootController {
|
|||||||
statusMessage.setStatus(Status.DOWNLOAD);
|
statusMessage.setStatus(Status.DOWNLOAD);
|
||||||
|
|
||||||
if (range != null) {
|
if (range != null) {
|
||||||
statusMessage.addMessage("It is a partial download request: " + range);
|
statusMessage.addMessage(ControllerManagement.SERVER_MESSAGE_PREFIX + "Target downloads range " + range
|
||||||
|
+ " of: " + request.getRequestURI());
|
||||||
} else {
|
} else {
|
||||||
statusMessage.addMessage("Controller downloads");
|
statusMessage.addMessage(
|
||||||
|
ControllerManagement.SERVER_MESSAGE_PREFIX + "Target downloads: " + request.getRequestURI());
|
||||||
}
|
}
|
||||||
controllerManagement.addActionStatusMessage(statusMessage);
|
controllerManagement.addActionStatusMessage(statusMessage);
|
||||||
return action;
|
return action;
|
||||||
@@ -388,13 +390,13 @@ public class RootController {
|
|||||||
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("Controller confirmed cancelation");
|
actionStatus.addMessage(ControllerManagement.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("Controller reported internal ERROR and REJECTED update.");
|
actionStatus.addMessage(ControllerManagement.SERVER_MESSAGE_PREFIX + "Target REJECTED update.");
|
||||||
break;
|
break;
|
||||||
case CLOSED:
|
case CLOSED:
|
||||||
handleClosedUpdateStatus(feedback, targetid, actionid, actionStatus);
|
handleClosedUpdateStatus(feedback, targetid, actionid, actionStatus);
|
||||||
@@ -421,7 +423,8 @@ public class RootController {
|
|||||||
LOG.debug("Controller reported intermediate status (actionid: {}, targetid: {}) as we got {} report.", actionid,
|
LOG.debug("Controller reported intermediate status (actionid: {}, targetid: {}) as we got {} report.", actionid,
|
||||||
targetid, feedback.getStatus().getExecution());
|
targetid, feedback.getStatus().getExecution());
|
||||||
actionStatus.setStatus(Status.RUNNING);
|
actionStatus.setStatus(Status.RUNNING);
|
||||||
actionStatus.addMessage("Controller reported: " + feedback.getStatus().getExecution());
|
actionStatus.addMessage(
|
||||||
|
ControllerManagement.SERVER_MESSAGE_PREFIX + "Target reported: " + feedback.getStatus().getExecution());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void handleClosedUpdateStatus(final ActionFeedback feedback, final String targetid,
|
private static void handleClosedUpdateStatus(final ActionFeedback feedback, final String targetid,
|
||||||
@@ -430,10 +433,10 @@ public class RootController {
|
|||||||
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("Controller reported CLOSED with ERROR!");
|
actionStatus.addMessage(ControllerManagement.SERVER_MESSAGE_PREFIX + "Target reported CLOSED with ERROR!");
|
||||||
} else {
|
} else {
|
||||||
actionStatus.setStatus(Status.FINISHED);
|
actionStatus.setStatus(Status.FINISHED);
|
||||||
actionStatus.addMessage("Controller reported CLOSED with OK!");
|
actionStatus.addMessage(ControllerManagement.SERVER_MESSAGE_PREFIX + "Target reported CLOSED with OK!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user