Merge remote-tracking branch 'eclipse/master' into BUG/TARGET_TABLE_PERFOMANCE

# Conflicts:
#
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/push/DelayedEventBusPush
Strategy.java
This commit is contained in:
Kai Zimmermann
2016-03-29 14:04:12 +02:00
83 changed files with 392 additions and 3016 deletions

View File

@@ -97,9 +97,9 @@ public class SMTypeFilterButtons extends AbstractFilterButtons {
}
@Override
protected boolean isClickedByDefault(final Long buttonId) {
protected boolean isClickedByDefault(final String typeName) {
return artifactUploadState.getSoftwareModuleFilters().getSoftwareModuleType().isPresent() && artifactUploadState
.getSoftwareModuleFilters().getSoftwareModuleType().get().getId().equals(buttonId);
.getSoftwareModuleFilters().getSoftwareModuleType().get().getName().equals(typeName);
}
@Override

View File

@@ -161,7 +161,6 @@ public class SoftwareModuleDetailsTable extends Table {
if (null != distributionSet) {
if (isUnassignSoftModAllowed && permissionChecker.hasUpdateDistributionPermission()) {
try {
distributionSetManagement.checkDistributionSetAlreadyUse(distributionSet);
isTargetAssigned = false;
} catch (final EntityLockedException exception) {
isTargetAssigned = true;

View File

@@ -114,7 +114,7 @@ public abstract class AbstractFilterButtons extends Table {
typeButton.addClickListener(event -> filterButtonClickBehaviour.processFilterButtonClick(event));
if (typeButton.getData().equals(SPUIDefinitions.NO_TAG_BUTTON_ID) && isNoTagSateSelected()) {
filterButtonClickBehaviour.setDefaultClickedButton(typeButton);
} else if (id != null && isClickedByDefault(id)) {
} else if (id != null && isClickedByDefault(name)) {
filterButtonClickBehaviour.setDefaultClickedButton(typeButton);
}
final DragAndDropWrapper wrapper = createDragAndDropWrapper(typeButton, name, id);
@@ -205,10 +205,11 @@ public abstract class AbstractFilterButtons extends Table {
/**
* Check if button should be displayed as clicked by default.
*
* @param id
* @return
* @param buttonCaption
* button caption
* @return true if button is clicked
*/
protected abstract boolean isClickedByDefault(final Long buttonId);
protected abstract boolean isClickedByDefault(final String buttonCaption);
/**
* Get filter button Id.

View File

@@ -12,10 +12,7 @@ import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import com.vaadin.data.Container;
import com.vaadin.data.Container.Indexed;
import com.vaadin.shared.ui.grid.HeightMode;
import com.vaadin.ui.Grid;
import com.vaadin.ui.Label;
import com.vaadin.ui.themes.ValoTheme;
/**
* Abstract table class.

View File

@@ -79,10 +79,9 @@ public class DSTypeFilterButtons extends AbstractFilterButtons {
}
@Override
protected boolean isClickedByDefault(final Long buttonId) {
protected boolean isClickedByDefault(final String typeName) {
return manageDistUIState.getManageDistFilters().getClickedDistSetType() != null
&& manageDistUIState.getManageDistFilters().getClickedDistSetType().getId().equals(buttonId);
&& manageDistUIState.getManageDistFilters().getClickedDistSetType().getName().equals(typeName);
}
@Override

View File

@@ -82,10 +82,9 @@ public class DistSMTypeFilterButtons extends AbstractFilterButtons {
}
@Override
protected boolean isClickedByDefault(final Long buttonId) {
protected boolean isClickedByDefault(final String typeName) {
return manageDistUIState.getSoftwareModuleFilters().getSoftwareModuleType().isPresent()
&& manageDistUIState.getSoftwareModuleFilters().getSoftwareModuleType().get().getId().equals(buttonId);
&& manageDistUIState.getSoftwareModuleFilters().getSoftwareModuleType().get().getName().equals(typeName);
}
@Override

View File

@@ -16,7 +16,6 @@ import javax.annotation.PreDestroy;
import org.eclipse.hawkbit.eventbus.event.DistributionSetTagCreatedBulkEvent;
import org.eclipse.hawkbit.eventbus.event.DistributionSetTagDeletedEvent;
import org.eclipse.hawkbit.eventbus.event.DistributionSetTagUpdateEvent;
import org.eclipse.hawkbit.repository.TagManagement;
import org.eclipse.hawkbit.repository.model.DistributionSetTag;
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterButtonClickBehaviour;
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterButtons;
@@ -58,9 +57,6 @@ public class DistributionTagButtons extends AbstractFilterButtons {
@Autowired
private DistributionTagDropEvent spDistTagDropEvent;
@Autowired
private transient TagManagement tagMgmtService;
@Autowired
private ManagementUIState managementUIState;
@@ -121,10 +117,9 @@ public class DistributionTagButtons extends AbstractFilterButtons {
}
@Override
protected boolean isClickedByDefault(final Long buttonId) {
final DistributionSetTag dsTagObject = tagMgmtService.findDistributionSetTagById(buttonId);
protected boolean isClickedByDefault(final String tagName) {
return null != managementUIState.getDistributionTableFilters().getDistSetTags()
&& managementUIState.getDistributionTableFilters().getDistSetTags().contains(dsTagObject.getName());
&& managementUIState.getDistributionTableFilters().getDistSetTags().contains(tagName);
}
@Override

View File

@@ -19,7 +19,6 @@ import org.eclipse.hawkbit.eventbus.event.TargetTagCreatedBulkEvent;
import org.eclipse.hawkbit.eventbus.event.TargetTagDeletedEvent;
import org.eclipse.hawkbit.eventbus.event.TargetTagUpdateEvent;
import org.eclipse.hawkbit.repository.SpPermissionChecker;
import org.eclipse.hawkbit.repository.TagManagement;
import org.eclipse.hawkbit.repository.TargetManagement;
import org.eclipse.hawkbit.repository.model.TargetIdName;
import org.eclipse.hawkbit.repository.model.TargetTag;
@@ -70,9 +69,6 @@ public class TargetTagFilterButtons extends AbstractFilterButtons {
@Autowired
private ManagementUIState managementUIState;
@Autowired
private transient TagManagement tagMgmtService;
@Autowired
private ManagementViewAcceptCriteria managementViewAcceptCriteria;
@@ -139,10 +135,9 @@ public class TargetTagFilterButtons extends AbstractFilterButtons {
}
@Override
protected boolean isClickedByDefault(final Long buttonId) {
final TargetTag newTagClickedObj = tagMgmtService.findTargetTagById(buttonId);
return managementUIState.getTargetTableFilters().getClickedTargetTags() != null && managementUIState
.getTargetTableFilters().getClickedTargetTags().contains(newTagClickedObj.getName());
protected boolean isClickedByDefault(final String tagName) {
return managementUIState.getTargetTableFilters().getClickedTargetTags() != null
&& managementUIState.getTargetTableFilters().getClickedTargetTags().contains(tagName);
}
@Override

View File

@@ -42,15 +42,15 @@ import com.vaadin.ui.UI;
* {@link com.google.common.eventbus.EventBus} and store them first in an queue
* where they will dispatched every 2 seconds to the {@link EventBus} in a
* Vaadin access thread {@link UI#access(Runnable)}.
*
*
* This strategy avoids blocking UIs when too many events are fired and
* dispatched to the UI thread. The UI will freeze in the time. To avoid that
* all events are collected first and same events are merged to a list of events
* before they dispatched to the UI thread.
*
*
* The strategy also verifies the current tenant in the session with the tenant
* in the event and only forwards event from the right tenant to the UI.
*
*
*/
public class DelayedEventBusPushStrategy implements EventPushStrategy {
@@ -68,7 +68,7 @@ public class DelayedEventBusPushStrategy implements EventPushStrategy {
/**
* Constructor.
*
*
* @param eventBus
* the session event bus to where the events should be dispatched
* @param systemEventBus
@@ -130,7 +130,7 @@ public class DelayedEventBusPushStrategy implements EventPushStrategy {
/**
* Checks if the tenant within the event is equal with the current tenant in
* the context.
*
*
* @param userContext
* the security context of the current session
* @param event