Merge remote-tracking branch 'refs/remotes/eclipse/master'
This commit is contained in:
@@ -298,20 +298,7 @@ public class AmqpMessageHandlerService {
|
|||||||
*/
|
*/
|
||||||
private void updateActionStatus(final Message message) {
|
private void updateActionStatus(final Message message) {
|
||||||
final ActionUpdateStatus actionUpdateStatus = convertMessage(message, ActionUpdateStatus.class);
|
final ActionUpdateStatus actionUpdateStatus = convertMessage(message, ActionUpdateStatus.class);
|
||||||
final Long actionId = actionUpdateStatus.getActionId();
|
final Action action = checkActionExist(message, actionUpdateStatus);
|
||||||
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 ActionStatus actionStatus = new ActionStatus();
|
final ActionStatus actionStatus = new ActionStatus();
|
||||||
final List<String> messageText = actionUpdateStatus.getMessage();
|
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) {
|
private void handleCancelRejected(final Message message, final Action action, final ActionStatus actionStatus) {
|
||||||
if (action.isCancelingOrCanceled()) {
|
if (action.isCancelingOrCanceled()) {
|
||||||
|
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ public class RepositoryApplicationConfiguration extends JpaBaseConfiguration {
|
|||||||
@Override
|
@Override
|
||||||
protected Map<String, Object> getVendorProperties() {
|
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
|
// Turn off dynamic weaving to disable LTW lookup in static weaving mode
|
||||||
properties.put("eclipselink.weaving", "false");
|
properties.put("eclipselink.weaving", "false");
|
||||||
// needed for reports
|
// needed for reports
|
||||||
|
|||||||
@@ -342,33 +342,23 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
|
|||||||
distributionSet.setRequiredMigrationStep(isMigStepReq);
|
distributionSet.setRequiredMigrationStep(isMigStepReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Duplicate check-Name and version for {@link DistributionSet} unique.
|
|
||||||
*
|
|
||||||
* @param name
|
|
||||||
* as String
|
|
||||||
* @param version
|
|
||||||
* as String
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private boolean duplicateCheck(final String name, final String version) {
|
private boolean duplicateCheck(final String name, final String version) {
|
||||||
final DistributionSet existingDs = distributionSetManagement.findDistributionSetByNameAndVersion(name, version);
|
final DistributionSet existingDs = distributionSetManagement.findDistributionSetByNameAndVersion(name, version);
|
||||||
/*
|
|
||||||
* Distribution should not exists with the same name & version. Display
|
|
||||||
* error message, when the "existingDs" is not null and it is add window
|
|
||||||
* (or) when the "existingDs" is not null and it is edit window and the
|
|
||||||
* distribution Id of the edit window is different then the "existingDs"
|
|
||||||
*/
|
|
||||||
if (existingDs != null && (!editDistribution || editDistribution && !existingDs.getId().equals(editDistId))) {
|
|
||||||
distNameTextField.addStyleName("v-textfield-error");
|
|
||||||
distVersionTextField.addStyleName("v-textfield-error");
|
|
||||||
notificationMessage.displayValidationError(
|
|
||||||
i18n.get("message.duplicate.dist", new Object[] { existingDs.getName(), existingDs.getVersion() }));
|
|
||||||
|
|
||||||
return false;
|
if (existingDs == null) {
|
||||||
} else {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (editDistribution && !existingDs.getId().equals(editDistId)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
distNameTextField.addStyleName("v-textfield-error");
|
||||||
|
distVersionTextField.addStyleName("v-textfield-error");
|
||||||
|
notificationMessage.displayValidationError(
|
||||||
|
i18n.get("message.duplicate.dist", new Object[] { existingDs.getName(), existingDs.getVersion() }));
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import java.util.Map;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.eclipse.hawkbit.im.authentication.UserPrincipal;
|
import org.eclipse.hawkbit.im.authentication.UserPrincipal;
|
||||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||||
@@ -437,13 +438,16 @@ public final class HawkbitCommonUtil {
|
|||||||
* @return String formatted text
|
* @return String formatted text
|
||||||
*/
|
*/
|
||||||
public static String getFormattedText(final String orgText) {
|
public static String getFormattedText(final String orgText) {
|
||||||
String formtdTxt = orgText == null ? "" : orgText;
|
if (orgText == null) {
|
||||||
final int txtLengthAllowed = SPUIDefinitions.NAME_DESCRIPTION_LENGTH;
|
return StringUtils.EMPTY;
|
||||||
if (formtdTxt.length() > txtLengthAllowed) {
|
|
||||||
formtdTxt = new StringBuilder(orgText.substring(0, txtLengthAllowed)).append("...").toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return formtdTxt;
|
final int txtLengthAllowed = SPUIDefinitions.NAME_DESCRIPTION_LENGTH;
|
||||||
|
if (orgText.length() > txtLengthAllowed) {
|
||||||
|
return new StringBuilder(orgText.substring(0, txtLengthAllowed)).append("...").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
return orgText;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user