Clean Code Refactoring
Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
@@ -298,20 +298,7 @@ public class AmqpMessageHandlerService {
|
||||
*/
|
||||
private void updateActionStatus(final Message message) {
|
||||
final ActionUpdateStatus actionUpdateStatus = convertMessage(message, ActionUpdateStatus.class);
|
||||
final Long actionId = actionUpdateStatus.getActionId();
|
||||
LOG.debug("Target notifies intermediate about action {} with status {}.", actionId, actionUpdateStatus
|
||||
.getActionStatus().name());
|
||||
|
||||
if (actionId == null) {
|
||||
logAndThrowMessageError(message, "Invalid message no action id");
|
||||
}
|
||||
|
||||
final Action action = controllerManagement.findActionWithDetails(actionId);
|
||||
|
||||
if (action == null) {
|
||||
logAndThrowMessageError(message, "Got intermediate notification about action " + actionId
|
||||
+ " but action does not exist");
|
||||
}
|
||||
final Action action = checkActionExist(message, actionUpdateStatus);
|
||||
|
||||
final ActionStatus actionStatus = new ActionStatus();
|
||||
final List<String> messageText = actionUpdateStatus.getMessage();
|
||||
@@ -362,6 +349,29 @@ public class AmqpMessageHandlerService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
* @param actionUpdateStatus
|
||||
* @return
|
||||
*/
|
||||
private Action checkActionExist(final Message message, final ActionUpdateStatus actionUpdateStatus) {
|
||||
final Long actionId = actionUpdateStatus.getActionId();
|
||||
LOG.debug("Target notifies intermediate about action {} with status {}.", actionId, actionUpdateStatus
|
||||
.getActionStatus().name());
|
||||
|
||||
if (actionId == null) {
|
||||
logAndThrowMessageError(message, "Invalid message no action id");
|
||||
}
|
||||
|
||||
final Action action = controllerManagement.findActionWithDetails(actionId);
|
||||
|
||||
if (action == null) {
|
||||
logAndThrowMessageError(message, "Got intermediate notification about action " + actionId
|
||||
+ " but action does not exist");
|
||||
}
|
||||
return action;
|
||||
}
|
||||
|
||||
private void handleCancelRejected(final Message message, final Action action, final ActionStatus actionStatus) {
|
||||
if (action.isCancelingOrCanceled()) {
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ public class RepositoryApplicationConfiguration extends JpaBaseConfiguration {
|
||||
@Override
|
||||
protected Map<String, Object> getVendorProperties() {
|
||||
|
||||
final Map<String, Object> properties = new HashMap<String, Object>();
|
||||
final Map<String, Object> properties = new HashMap<>();
|
||||
// Turn off dynamic weaving to disable LTW lookup in static weaving mode
|
||||
properties.put("eclipselink.weaving", "false");
|
||||
// needed for reports
|
||||
|
||||
Reference in New Issue
Block a user