Merge branch 'master' into Artifiact_upload_directory_upload

This commit is contained in:
asharani-murugesh
2016-02-25 17:07:20 +01:00
29 changed files with 312 additions and 287 deletions

5
.gitignore vendored
View File

@@ -16,6 +16,11 @@
*.jar *.jar
*.war *.war
######################
# Sonar
######################
.sonar_lock
# Eclipse IDE # Eclipse IDE
*.pydevproject *.pydevproject

View File

@@ -0,0 +1,3 @@
# 3rd Party Dependencies
Contains listing of all maven (transient) licenses of the project. Is primary used to identify all changes between eclipse releases.

View File

@@ -15,8 +15,8 @@ hawkbit.server.controller.security.authentication.gatewaytoken.enabled=false
spring.profiles.active=amqp spring.profiles.active=amqp
vaadin.servlet.params.productionMode=false vaadin.servlet.productionMode=false
vaadin.static.servlet.params.productionMode=false vaadin.static.servlet.productionMode=false
## Configuration for RabbitMQ integration ## Configuration for RabbitMQ integration
hawkbit.server.amqp.username=guest hawkbit.server.amqp.username=guest

View File

@@ -88,7 +88,7 @@ public class MongoDBTestRule implements TestRule {
System.setProperty("spring.data.mongodb.port", String.valueOf(port)); System.setProperty("spring.data.mongodb.port", String.valueOf(port));
} }
Version version = Version.V3_1_0; Version version = Version.V3_0_8;
if (System.getProperty("inf.mongodb.version") != null) { if (System.getProperty("inf.mongodb.version") != null) {
version = Version.valueOf("V" + System.getProperty("inf.mongodb.version").trim().replaceAll("\\.", "_")); version = Version.valueOf("V" + System.getProperty("inf.mongodb.version").trim().replaceAll("\\.", "_"));
} }

View File

@@ -29,10 +29,8 @@ flyway.initOnMigrate=true
flyway.sqlMigrationSuffix=${spring.jpa.database}.sql flyway.sqlMigrationSuffix=${spring.jpa.database}.sql
# Vaadin Servlet # Vaadin Servlet
vaadin.static.servlet.params.resourceCacheTime=${spring.resources.cache-period} vaadin.static.servlet.productionMode=true
vaadin.static.servlet.params.productionMode=true vaadin.servlet.productionMode=true
vaadin.servlet.params.productionMode=true
vaadin.servlet.params.resourceCacheTime=${spring.resources.cache-period}
vaadin.servlet.urlMapping=/UI/* vaadin.servlet.urlMapping=/UI/*
vaadin.servlet.params.heartbeatInterval=60 vaadin.servlet.params.heartbeatInterval=60
vaadin.servlet.params.closeIdleSessions=false vaadin.servlet.params.closeIdleSessions=false

View File

@@ -37,19 +37,9 @@ import org.springframework.transaction.annotation.Transactional;
*/ */
@Transactional(readOnly = true) @Transactional(readOnly = true)
public interface ActionRepository extends BaseEntityRepository<Action, Long>, JpaSpecificationExecutor<Action> { public interface ActionRepository extends BaseEntityRepository<Action, Long>, JpaSpecificationExecutor<Action> {
/*
* (non-Javadoc)
*
* @see org.springframework.data.repository.CrudRepository#findAll()
*/
@Override
@EntityGraph(value = "Action.all", type = EntityGraphType.LOAD)
Iterable<Action> findAll();
/** /**
* Retrieves an Action with all lazy attributes. * Retrieves an Action with all lazy attributes.
* *
* @param actionId * @param actionId
* the ID of the action * the ID of the action
* @return the found {@link Action} * @return the found {@link Action}
@@ -67,13 +57,12 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
* the {@link DistributionSet} on which will be filtered * the {@link DistributionSet} on which will be filtered
* @return the found {@link Action}s * @return the found {@link Action}s
*/ */
@EntityGraph(value = "Action.all", type = EntityGraphType.LOAD)
Page<Action> findByDistributionSet(final Pageable pageable, final DistributionSet ds); Page<Action> findByDistributionSet(final Pageable pageable, final DistributionSet ds);
/** /**
* Retrieves all {@link Action}s which are referring the given * Retrieves all {@link Action}s which are referring the given
* {@link Target}. * {@link Target}.
* *
* @param pageable * @param pageable
* page parameters * page parameters
* @param target * @param target
@@ -84,8 +73,9 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
/** /**
* Retrieves all {@link Action}s which are active and referring the given * Retrieves all {@link Action}s which are active and referring the given
* {@link Target} in a specified order. * {@link Target} in a specified order. Loads also the lazy
* * {@link Action#getDistributionSet()} field.
*
* @param pageable * @param pageable
* page parameters * page parameters
* @param target * @param target
@@ -125,14 +115,13 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
* @return the found {@link UpdateAction}s * @return the found {@link UpdateAction}s
*/ */
@Query("Select a from Action a where a.target = :target and a.distributionSet = :ds order by a.id") @Query("Select a from Action a where a.target = :target and a.distributionSet = :ds order by a.id")
@EntityGraph(value = "Action.all", type = EntityGraphType.LOAD)
Page<Action> findByTargetAndDistributionSet(final Pageable pageable, @Param("target") final Target target, Page<Action> findByTargetAndDistributionSet(final Pageable pageable, @Param("target") final Target target,
@Param("ds") DistributionSet ds); @Param("ds") DistributionSet ds);
/** /**
* Retrieves all {@link Action}s of a specific target, without pagination * Retrieves all {@link Action}s of a specific target, without pagination
* ordered by action ID. * ordered by action ID.
* *
* @param target * @param target
* to search for * to search for
* @return a list of actions according to the searched target * @return a list of actions according to the searched target
@@ -143,7 +132,7 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
/** /**
* Retrieves all {@link Action}s of a specific target and given active flag * Retrieves all {@link Action}s of a specific target and given active flag
* ordered by action ID. * ordered by action ID.
* *
* @param pageable * @param pageable
* the pagination parameter * the pagination parameter
* @param target * @param target
@@ -159,8 +148,9 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
/** /**
* Retrieves all {@link Action}s of a specific target and given active flag * Retrieves all {@link Action}s of a specific target and given active flag
* ordered by action ID. * ordered by action ID. Loads also the lazy
* * {@link Action#getDistributionSet()} field.
*
* @param target * @param target
* to search for * to search for
* @param active * @param active
@@ -174,7 +164,7 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
/** /**
* Updates all {@link Action} to inactive for all targets with given ID. * Updates all {@link Action} to inactive for all targets with given ID.
* *
* @param keySet * @param keySet
* the list of actions to set inactive * the list of actions to set inactive
* @param targetsIds * @param targetsIds
@@ -190,7 +180,7 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
* Switches the status of actions from one specific status into another, * Switches the status of actions from one specific status into another,
* only if the actions are in a specific status. This should be a atomar * only if the actions are in a specific status. This should be a atomar
* operation. * operation.
* *
* @param statusToSet * @param statusToSet
* the new status the actions should get * the new status the actions should get
* @param targetIds * @param targetIds
@@ -210,7 +200,7 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
* Switches the status of actions from one specific status into another, * Switches the status of actions from one specific status into another,
* only if the actions are in a specific status. This should be a atomar * only if the actions are in a specific status. This should be a atomar
* operation. * operation.
* *
* @param statusToSet * @param statusToSet
* the new status the actions should get * the new status the actions should get
* @param rollout * @param rollout
@@ -227,7 +217,7 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
@Param("active") boolean active, @Param("currentStatus") Action.Status currentStatus); @Param("active") boolean active, @Param("currentStatus") Action.Status currentStatus);
/** /**
* *
* Retrieves all {@link Action}s which are active and referring to the given * Retrieves all {@link Action}s which are active and referring to the given
* target Ids and distribution set required migration step. * target Ids and distribution set required migration step.
* *
@@ -243,36 +233,24 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
/** /**
* Counts all {@link Action}s referring to the given target. * Counts all {@link Action}s referring to the given target.
* *
* @param target * @param target
* the target to count the {@link Action}s * the target to count the {@link Action}s
* @return the count of actions referring to the given target * @return the count of actions referring to the given target
*/ */
Long countByTarget(Target target); Long countByTarget(Target target);
/*
* (non-Javadoc)
*
* @see org.springframework.data.repository.CrudRepository#save(java.lang.
* Iterable)
*/
@Override @Override
@CacheEvict(value = "feedbackReceivedOverTime", allEntries = true) @CacheEvict(value = "feedbackReceivedOverTime", allEntries = true)
<S extends Action> List<S> save(Iterable<S> entities); <S extends Action> List<S> save(Iterable<S> entities);
/*
* (non-Javadoc)
*
* @see
* org.springframework.data.repository.CrudRepository#save(java.lang.Object)
*/
@Override @Override
@CacheEvict(value = "feedbackReceivedOverTime", allEntries = true) @CacheEvict(value = "feedbackReceivedOverTime", allEntries = true)
<S extends Action> S save(S entity); <S extends Action> S save(S entity);
/** /**
* Counts all {@link Action}s referring to the given DistributionSet. * Counts all {@link Action}s referring to the given DistributionSet.
* *
* @param distributionSet * @param distributionSet
* DistributionSet to count the {@link Action}s from * DistributionSet to count the {@link Action}s from
* @return the count of actions referring to the given distributionSet * @return the count of actions referring to the given distributionSet
@@ -281,7 +259,7 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
/** /**
* Counts all {@link Action}s referring to the given rollout. * Counts all {@link Action}s referring to the given rollout.
* *
* @param rollout * @param rollout
* the rollout to count the {@link Action}s from * the rollout to count the {@link Action}s from
* @return the count of actions referring to the given rollout * @return the count of actions referring to the given rollout
@@ -293,7 +271,7 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
* are currently not in the given status. An in-clause statement does not * are currently not in the given status. An in-clause statement does not
* work with the spring-data, so this is specific usecase regarding to the * work with the spring-data, so this is specific usecase regarding to the
* rollout-management to find out actions which are not in specific states. * rollout-management to find out actions which are not in specific states.
* *
* @param rollout * @param rollout
* the rollout the actions are belong to * the rollout the actions are belong to
* @param rolloutGroup * @param rolloutGroup
@@ -312,7 +290,7 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
/** /**
* Counts all actions referring to a given rollout and rolloutgroup. * Counts all actions referring to a given rollout and rolloutgroup.
* *
* @param rollout * @param rollout
* the rollout the actions belong to * the rollout the actions belong to
* @param rolloutGroup * @param rolloutGroup
@@ -323,7 +301,7 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
/** /**
* Counts all actions referring to a given rollout, rolloutgroup and status. * Counts all actions referring to a given rollout, rolloutgroup and status.
* *
* @param rolloutId * @param rolloutId
* the ID of rollout the actions belong to * the ID of rollout the actions belong to
* @param rolloutGroupId * @param rolloutGroupId
@@ -338,7 +316,7 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
/** /**
* Retrieving all actions referring to a given rollout with a specific * Retrieving all actions referring to a given rollout with a specific
* action as parent reference and a specific status. * action as parent reference and a specific status.
* *
* Finding all actions of a specific rolloutgroup parent relation. * Finding all actions of a specific rolloutgroup parent relation.
* *
* @param rollout * @param rollout
@@ -355,7 +333,7 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
/** /**
* Retrieves all actions for a specific rollout and in a specific status. * Retrieves all actions for a specific rollout and in a specific status.
* *
* @param rollout * @param rollout
* the rollout the actions beglong to * the rollout the actions beglong to
* @param actionStatus * @param actionStatus
@@ -367,7 +345,7 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
/** /**
* Get list of objects which has details of status and count of targets in * Get list of objects which has details of status and count of targets in
* each status in specified rollout. * each status in specified rollout.
* *
* @param rolloutId * @param rolloutId
* id of {@link Rollout} * id of {@link Rollout}
* @return list of objects with status and target count * @return list of objects with status and target count
@@ -378,7 +356,7 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
/** /**
* Get list of objects which has details of status and count of targets in * Get list of objects which has details of status and count of targets in
* each status in specified rollout. * each status in specified rollout.
* *
* @param rolloutId * @param rolloutId
* id of {@link Rollout} * id of {@link Rollout}
* @return list of objects with status and target count * @return list of objects with status and target count
@@ -389,7 +367,7 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
/** /**
* Get list of objects which has details of status and count of targets in * Get list of objects which has details of status and count of targets in
* each status in specified rollout group. * each status in specified rollout group.
* *
* @param rolloutGroupId * @param rolloutGroupId
* id of {@link RolloutGroup} * id of {@link RolloutGroup}
* @return list of objects with status and target count * @return list of objects with status and target count
@@ -400,7 +378,7 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
/** /**
* Get list of objects which has details of status and count of targets in * Get list of objects which has details of status and count of targets in
* each status in specified rollout group. * each status in specified rollout group.
* *
* @param rolloutGroupId * @param rolloutGroupId
* list of id of {@link RolloutGroup} * list of id of {@link RolloutGroup}
* @return list of objects with status and target count * @return list of objects with status and target count

View File

@@ -378,11 +378,13 @@ public class DeploymentManagement {
actionStatusRepository.save(actionStatus); actionStatusRepository.save(actionStatus);
}); });
// select updated targets in order to return them // flush to get action IDs
entityManager.flush();
// collect updated target and actions IDs in order to return them
final DistributionSetAssignmentResult result = new DistributionSetAssignmentResult( final DistributionSetAssignmentResult result = new DistributionSetAssignmentResult(
targets.stream().map(target -> target.getControllerId()).collect(Collectors.toList()), targets.size(), targets.stream().map(target -> target.getControllerId()).collect(Collectors.toList()), targets.size(),
controllerIDs.size() - targets.size(), Lists.newArrayList(targetIdsToActions.values()), controllerIDs.size() - targets.size(),
targetManagement); targetIdsToActions.values().stream().map(Action::getId).collect(Collectors.toList()), targetManagement);
LOG.debug("assignDistribution({}) finished {}", set, result); LOG.debug("assignDistribution({}) finished {}", set, result);
@@ -391,13 +393,16 @@ public class DeploymentManagement {
// detaching as it is not necessary to persist the set itself // detaching as it is not necessary to persist the set itself
entityManager.detach(set); entityManager.detach(set);
// send distribution set assignment event sendDistributionSetAssignmentEvent(targets, targetIdsCancellList, targetIdsToActions, softwareModules);
return result;
}
private void sendDistributionSetAssignmentEvent(final List<Target> targets, final Set<Long> targetIdsCancellList,
final Map<String, Action> targetIdsToActions, final List<SoftwareModule> softwareModules) {
targets.stream().filter(t -> !!!targetIdsCancellList.contains(t.getId())) targets.stream().filter(t -> !!!targetIdsCancellList.contains(t.getId()))
.forEach(t -> assignDistributionSetEvent(t, targetIdsToActions.get(t.getControllerId()).getId(), .forEach(t -> assignDistributionSetEvent(t, targetIdsToActions.get(t.getControllerId()).getId(),
softwareModules)); softwareModules));
return result;
} }
/** /**
@@ -709,8 +714,8 @@ public class DeploymentManagement {
} }
/** /**
* Get the {@link Action} entity for given actionId with all lazy * Get the {@link Action} entity for given actionId with all lazy attributes
* attributes. * (i.e. distributionSet, target, target.assignedDs).
* *
* @param actionId * @param actionId
* to be id of the action * to be id of the action

View File

@@ -10,7 +10,6 @@ package org.eclipse.hawkbit.repository;
import java.util.List; import java.util.List;
import org.eclipse.hawkbit.repository.model.Action;
import org.eclipse.hawkbit.repository.model.AssignmentResult; import org.eclipse.hawkbit.repository.model.AssignmentResult;
import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.model.Target;
@@ -19,14 +18,11 @@ import org.eclipse.hawkbit.repository.model.Target;
* information of an assignment and how much of the assignment has been done and * information of an assignment and how much of the assignment has been done and
* how much of the assignments had already been existed. * how much of the assignments had already been existed.
* *
*
*
*
*/ */
public class DistributionSetAssignmentResult extends AssignmentResult { public class DistributionSetAssignmentResult extends AssignmentResult {
private final List<String> assignedTargets; private final List<String> assignedTargets;
private final List<Action> actions; private final List<Long> actions;
private final TargetManagement targetManagement; private final TargetManagement targetManagement;
@@ -48,7 +44,7 @@ public class DistributionSetAssignmentResult extends AssignmentResult {
* *
*/ */
public DistributionSetAssignmentResult(final List<String> assignedTargets, final int assigned, public DistributionSetAssignmentResult(final List<String> assignedTargets, final int assigned,
final int alreadyAssigned, final List<Action> actions, final TargetManagement targetManagement) { final int alreadyAssigned, final List<Long> actions, final TargetManagement targetManagement) {
super(assigned, alreadyAssigned); super(assigned, alreadyAssigned);
this.assignedTargets = assignedTargets; this.assignedTargets = assignedTargets;
this.actions = actions; this.actions = actions;
@@ -63,9 +59,9 @@ public class DistributionSetAssignmentResult extends AssignmentResult {
} }
/** /**
* @return the actionId * @return the actionIds
*/ */
public List<Action> getActions() { public List<Long> getActions() {
return actions; return actions;
} }

View File

@@ -24,6 +24,7 @@ import javax.persistence.ManyToOne;
import javax.persistence.NamedAttributeNode; import javax.persistence.NamedAttributeNode;
import javax.persistence.NamedEntityGraph; import javax.persistence.NamedEntityGraph;
import javax.persistence.NamedEntityGraphs; import javax.persistence.NamedEntityGraphs;
import javax.persistence.NamedSubgraph;
import javax.persistence.OneToMany; import javax.persistence.OneToMany;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Transient; import javax.persistence.Transient;
@@ -34,28 +35,22 @@ import org.eclipse.persistence.annotations.CascadeOnDelete;
/** /**
* <p> * <p>
* Applicable transition changes of the software {@link SoftwareModule} state of * Applicable transition changes of the {@link SoftwareModule}s state of a
* a {@link Target}, e.g. install, uninstall, update, start, stop, and * {@link Target}, e.g. install, uninstall, update and preparations for the
* preparations for the transition change, i.e. download. * transition change, i.e. download.
* </p> * </p>
* *
* <p> * <p>
* Actions are managed by the SP server (SPS) and applied to the edge controller * Actions are managed by the SP server and applied to the targets by the
* by the SP controller (SPC). Actions may also be value added commands that are * client.
* nor directly related to SP, e.g. factory reset.
* <p> * <p>
*
*
*
*
*
*/ */
@Table(name = "sp_action", indexes = { @Index(name = "sp_idx_action_01", columnList = "tenant,distribution_set"), @Table(name = "sp_action", indexes = { @Index(name = "sp_idx_action_01", columnList = "tenant,distribution_set"),
@Index(name = "sp_idx_action_02", columnList = "tenant,target,active"), @Index(name = "sp_idx_action_02", columnList = "tenant,target,active"),
@Index(name = "sp_idx_action_prim", columnList = "tenant,id") }) @Index(name = "sp_idx_action_prim", columnList = "tenant,id") })
@NamedEntityGraphs({ @NamedEntityGraph(name = "Action.ds", attributeNodes = { @NamedAttributeNode("distributionSet") }), @NamedEntityGraphs({ @NamedEntityGraph(name = "Action.ds", attributeNodes = { @NamedAttributeNode("distributionSet") }),
@NamedEntityGraph(name = "Action.all", attributeNodes = { @NamedAttributeNode("distributionSet"), @NamedEntityGraph(name = "Action.all", attributeNodes = { @NamedAttributeNode("distributionSet"),
@NamedAttributeNode("target") }) }) @NamedAttributeNode(value = "target", subgraph = "target.ds") }, subgraphs = @NamedSubgraph(name = "target.ds", attributeNodes = @NamedAttributeNode("assignedDistributionSet") ) ) })
@Entity @Entity
public class Action extends BaseEntity implements Comparable<Action> { public class Action extends BaseEntity implements Comparable<Action> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@@ -55,7 +55,7 @@ public abstract class AbstractIntegrationTestWithMongoDB extends AbstractIntegra
System.setProperty("spring.data.mongodb.port", String.valueOf(port)); System.setProperty("spring.data.mongodb.port", String.valueOf(port));
} }
Version version = Version.V3_0_5; Version version = Version.V3_0_8;
if (System.getProperty("inf.mongodb.version") != null) { if (System.getProperty("inf.mongodb.version") != null) {
version = Version version = Version
.valueOf("V" + System.getProperty("inf.mongodb.version").trim().replaceAll("\\.", "_")); .valueOf("V" + System.getProperty("inf.mongodb.version").trim().replaceAll("\\.", "_"));

View File

@@ -66,6 +66,22 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
@Autowired @Autowired
private EventBus eventBus; private EventBus eventBus;
@Test
@Description("Test verifies that the repistory retrieves the action including all defined (lazy) details.")
public void findActionWithLazyDetails() {
final DistributionSet testDs = TestDataUtil.generateDistributionSet("TestDs", "1.0", softwareManagement,
distributionSetManagement, new ArrayList<DistributionSetTag>());
final List<Target> testTarget = targetManagement.createTargets(TestDataUtil.generateTargets(1));
// one action with one action status is generated
final Long actionId = deploymentManagement.assignDistributionSet(testDs, testTarget).getActions().get(0);
final Action action = deploymentManagement.findActionWithDetails(actionId);
assertThat(action.getDistributionSet()).as("DistributionSet in action").isNotNull();
assertThat(action.getTarget()).as("Target in action").isNotNull();
assertThat(action.getTarget().getAssignedDistributionSet()).as("AssignedDistributionSet of target in action")
.isNotNull();
}
@Test @Test
@Description("Test verifies that the custom query to find all actions include the count of action status is working correctly") @Description("Test verifies that the custom query to find all actions include the count of action status is working correctly")
public void findActionsWithStatusCountByTarget() { public void findActionsWithStatusCountByTarget() {
@@ -73,7 +89,8 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
distributionSetManagement, new ArrayList<DistributionSetTag>()); distributionSetManagement, new ArrayList<DistributionSetTag>());
final List<Target> testTarget = targetManagement.createTargets(TestDataUtil.generateTargets(1)); final List<Target> testTarget = targetManagement.createTargets(TestDataUtil.generateTargets(1));
// one action with one action status is generated // one action with one action status is generated
final Action action = deploymentManagement.assignDistributionSet(testDs, testTarget).getActions().get(0); final Action action = deploymentManagement.findActionWithDetails(
deploymentManagement.assignDistributionSet(testDs, testTarget).getActions().get(0));
// save 2 action status // save 2 action status
actionStatusRepository.save(new ActionStatus(action, Status.RETRIEVED, System.currentTimeMillis())); actionStatusRepository.save(new ActionStatus(action, Status.RETRIEVED, System.currentTimeMillis()));
actionStatusRepository.save(new ActionStatus(action, Status.RUNNING, System.currentTimeMillis())); actionStatusRepository.save(new ActionStatus(action, Status.RUNNING, System.currentTimeMillis()));
@@ -349,7 +366,7 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
* test a simple deployment by calling the * test a simple deployment by calling the
* {@link TargetRepository#assignDistributionSet(DistributionSet, Iterable)} * {@link TargetRepository#assignDistributionSet(DistributionSet, Iterable)}
* and checking the active action and the action history of the targets. * and checking the active action and the action history of the targets.
* *
* @throws InterruptedException * @throws InterruptedException
*/ */
@Test @Test
@@ -805,7 +822,7 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
// assign ds to create an action // assign ds to create an action
final DistributionSetAssignmentResult assignDistributionSet = deploymentManagement final DistributionSetAssignmentResult assignDistributionSet = deploymentManagement
.assignDistributionSet(ds.getId(), ActionType.SOFT, Action.NO_FORCE_TIME, target.getControllerId()); .assignDistributionSet(ds.getId(), ActionType.SOFT, Action.NO_FORCE_TIME, target.getControllerId());
final Action action = assignDistributionSet.getActions().get(0); final Action action = deploymentManagement.findActionWithDetails(assignDistributionSet.getActions().get(0));
// verify preparation // verify preparation
Action findAction = deploymentManagement.findAction(action.getId()); Action findAction = deploymentManagement.findAction(action.getId());
assertThat(findAction.getActionType()).isEqualTo(ActionType.SOFT); assertThat(findAction.getActionType()).isEqualTo(ActionType.SOFT);
@@ -828,7 +845,7 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
// assign ds to create an action // assign ds to create an action
final DistributionSetAssignmentResult assignDistributionSet = deploymentManagement final DistributionSetAssignmentResult assignDistributionSet = deploymentManagement
.assignDistributionSet(ds.getId(), ActionType.FORCED, Action.NO_FORCE_TIME, target.getControllerId()); .assignDistributionSet(ds.getId(), ActionType.FORCED, Action.NO_FORCE_TIME, target.getControllerId());
final Action action = assignDistributionSet.getActions().get(0); final Action action = deploymentManagement.findActionWithDetails(assignDistributionSet.getActions().get(0));
// verify perparation // verify perparation
Action findAction = deploymentManagement.findAction(action.getId()); Action findAction = deploymentManagement.findAction(action.getId());
assertThat(findAction.getActionType()).isEqualTo(ActionType.FORCED); assertThat(findAction.getActionType()).isEqualTo(ActionType.FORCED);
@@ -848,7 +865,7 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
* <p> * <p>
* <b>All created distribution sets are assigned to all targets of the * <b>All created distribution sets are assigned to all targets of the
* target list deployedTargets.</b> * target list deployedTargets.</b>
* *
* @param undeployedTargetPrefix * @param undeployedTargetPrefix
* prefix to be used as target controller prefix * prefix to be used as target controller prefix
* @param noOfUndeployedTargets * @param noOfUndeployedTargets

View File

@@ -138,7 +138,8 @@ public class ReportManagementTest extends AbstractIntegrationTest {
final Target createTarget = targetManagement.createTarget(new Target("t" + month)); final Target createTarget = targetManagement.createTarget(new Target("t" + month));
final DistributionSetAssignmentResult result = deploymentManagement.assignDistributionSet(distributionSet, final DistributionSetAssignmentResult result = deploymentManagement.assignDistributionSet(distributionSet,
Lists.newArrayList(createTarget)); Lists.newArrayList(createTarget));
controllerManagament.registerRetrieved(result.getActions().get(0), controllerManagament.registerRetrieved(
deploymentManagement.findActionWithDetails(result.getActions().get(0)),
"Controller retrieved update action and should start now the download."); "Controller retrieved update action and should start now the download.");
} }
DataReportSeries<LocalDate> feedbackReceivedOverTime = reportManagement DataReportSeries<LocalDate> feedbackReceivedOverTime = reportManagement
@@ -158,7 +159,8 @@ public class ReportManagementTest extends AbstractIntegrationTest {
final Target createTarget = targetManagement.createTarget(new Target("t2" + month)); final Target createTarget = targetManagement.createTarget(new Target("t2" + month));
final DistributionSetAssignmentResult result = deploymentManagement.assignDistributionSet(distributionSet, final DistributionSetAssignmentResult result = deploymentManagement.assignDistributionSet(distributionSet,
Lists.newArrayList(createTarget)); Lists.newArrayList(createTarget));
controllerManagament.registerRetrieved(result.getActions().get(0), controllerManagament.registerRetrieved(
deploymentManagement.findActionWithDetails(result.getActions().get(0)),
"Controller retrieved update action and should start now the download."); "Controller retrieved update action and should start now the download.");
} }
feedbackReceivedOverTime = reportManagement.feedbackReceivedOverTime(DateTypes.perMonth(), from, to); feedbackReceivedOverTime = reportManagement.feedbackReceivedOverTime(DateTypes.perMonth(), from, to);
@@ -572,7 +574,7 @@ public class ReportManagementTest extends AbstractIntegrationTest {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see org.springframework.data.auditing.DateTimeProvider#getNow() * @see org.springframework.data.auditing.DateTimeProvider#getNow()
*/ */
@Override @Override

View File

@@ -174,7 +174,7 @@ public class TargetManagementTest extends AbstractIntegrationTest {
final DistributionSetAssignmentResult result = deploymentManagement.assignDistributionSet(set.getId(), "4711"); final DistributionSetAssignmentResult result = deploymentManagement.assignDistributionSet(set.getId(), "4711");
final Action action = result.getActions().get(0); final Action action = deploymentManagement.findActionWithDetails(result.getActions().get(0));
action.setStatus(Status.FINISHED); action.setStatus(Status.FINISHED);
controllerManagament.addUpdateActionStatus( controllerManagament.addUpdateActionStatus(
new ActionStatus(action, Status.FINISHED, System.currentTimeMillis(), "message"), action); new ActionStatus(action, Status.FINISHED, System.currentTimeMillis(), "message"), action);
@@ -221,7 +221,7 @@ public class TargetManagementTest extends AbstractIntegrationTest {
* verifies, that all {@link TargetTag} of parameter. NOTE: it's accepted * verifies, that all {@link TargetTag} of parameter. NOTE: it's accepted
* that the target have additional tags assigned to them which are not * that the target have additional tags assigned to them which are not
* contained within parameter tags. * contained within parameter tags.
* *
* @param strict * @param strict
* if true, the given targets MUST contain EXACTLY ALL given * if true, the given targets MUST contain EXACTLY ALL given
* tags, AND NO OTHERS. If false, the given targets MUST contain * tags, AND NO OTHERS. If false, the given targets MUST contain

View File

@@ -199,13 +199,14 @@ public final class RepositoryDataGenerator {
} }
private void createActionStatusHistory(final List<Action> actions, final int sizeMultiplikator) { private void createActionStatusHistory(final List<Long> actions, final int sizeMultiplikator) {
final AtomicInteger counter = new AtomicInteger(); final AtomicInteger counter = new AtomicInteger();
int index = 0; int index = 0;
for (final Action actionGiven : actions) { for (final Long actionGiven : actions) {
// retrieved // retrieved
Action action = controllerManagement.registerRetrieved(actionGiven, Action action = controllerManagement.registerRetrieved(
deploymentManagement.findActionWithDetails(actionGiven),
"Controller retrieved update action and should start now the download."); "Controller retrieved update action and should start now the download.");
// download // download
@@ -260,10 +261,11 @@ public final class RepositoryDataGenerator {
} }
} }
private void createSimpleActionStatusHistory(final List<Action> actions) { private void createSimpleActionStatusHistory(final List<Long> actions) {
for (final Action actionGiven : actions) { for (final Long actionGiven : actions) {
// retrieved // retrieved
Action action = controllerManagement.registerRetrieved(actionGiven, Action action = controllerManagement.registerRetrieved(
deploymentManagement.findActionWithDetails(actionGiven),
"Controller retrieved update action and should start now the download."); "Controller retrieved update action and should start now the download.");
// close // close

View File

@@ -56,7 +56,8 @@ public class CancelActionTest extends AbstractIntegrationTest {
final List<Target> toAssign = new ArrayList<Target>(); final List<Target> toAssign = new ArrayList<Target>();
toAssign.add(savedTarget); toAssign.add(savedTarget);
final Action updateAction = deploymentManagement.assignDistributionSet(ds, toAssign).getActions().get(0); final Action updateAction = deploymentManagement
.findActionWithDetails(deploymentManagement.assignDistributionSet(ds, toAssign).getActions().get(0));
final Action cancelAction = deploymentManagement.cancelAction(updateAction, final Action cancelAction = deploymentManagement.cancelAction(updateAction,
targetManagement.findTargetByControllerID(savedTarget.getControllerId())); targetManagement.findTargetByControllerID(savedTarget.getControllerId()));
@@ -112,7 +113,8 @@ public class CancelActionTest extends AbstractIntegrationTest {
final List<Target> toAssign = new ArrayList<Target>(); final List<Target> toAssign = new ArrayList<Target>();
toAssign.add(savedTarget); toAssign.add(savedTarget);
final Action updateAction = deploymentManagement.assignDistributionSet(ds, toAssign).getActions().get(0); final Action updateAction = deploymentManagement
.findActionWithDetails(deploymentManagement.assignDistributionSet(ds, toAssign).getActions().get(0));
long current = System.currentTimeMillis(); long current = System.currentTimeMillis();
mvc.perform(get("/{tenant}/controller/v1/4712", tenantAware.getCurrentTenant())) mvc.perform(get("/{tenant}/controller/v1/4712", tenantAware.getCurrentTenant()))
@@ -227,7 +229,8 @@ public class CancelActionTest extends AbstractIntegrationTest {
final Target savedTarget = targetManagement.createTarget(target); final Target savedTarget = targetManagement.createTarget(target);
final List<Target> toAssign = new ArrayList<Target>(); final List<Target> toAssign = new ArrayList<Target>();
toAssign.add(savedTarget); toAssign.add(savedTarget);
final Action updateAction = deploymentManagement.assignDistributionSet(ds, toAssign).getActions().get(0); final Action updateAction = deploymentManagement
.findActionWithDetails(deploymentManagement.assignDistributionSet(ds, toAssign).getActions().get(0));
return deploymentManagement.cancelAction(updateAction, return deploymentManagement.cancelAction(updateAction,
targetManagement.findTargetByControllerID(savedTarget.getControllerId())); targetManagement.findTargetByControllerID(savedTarget.getControllerId()));
@@ -243,8 +246,8 @@ public class CancelActionTest extends AbstractIntegrationTest {
final Target savedTarget = targetManagement.createTarget(target); final Target savedTarget = targetManagement.createTarget(target);
final Action updateAction = deploymentManagement.assignDistributionSet(ds.getId(), new String[] { "4712" }) final Action updateAction = deploymentManagement.findActionWithDetails(
.getActions().get(0); deploymentManagement.assignDistributionSet(ds.getId(), new String[] { "4712" }).getActions().get(0));
// cancel action manually // cancel action manually
final Action cancelAction = deploymentManagement.cancelAction(updateAction, final Action cancelAction = deploymentManagement.cancelAction(updateAction,
@@ -340,12 +343,12 @@ public class CancelActionTest extends AbstractIntegrationTest {
final Target savedTarget = targetManagement.createTarget(target); final Target savedTarget = targetManagement.createTarget(target);
final Action updateAction = deploymentManagement.assignDistributionSet(ds.getId(), new String[] { "4712" }) final Action updateAction = deploymentManagement.findActionWithDetails(
.getActions().get(0); deploymentManagement.assignDistributionSet(ds.getId(), new String[] { "4712" }).getActions().get(0));
final Action updateAction2 = deploymentManagement.assignDistributionSet(ds2.getId(), new String[] { "4712" }) final Action updateAction2 = deploymentManagement.findActionWithDetails(
.getActions().get(0); deploymentManagement.assignDistributionSet(ds2.getId(), new String[] { "4712" }).getActions().get(0));
final Action updateAction3 = deploymentManagement.assignDistributionSet(ds3.getId(), new String[] { "4712" }) final Action updateAction3 = deploymentManagement.findActionWithDetails(
.getActions().get(0); deploymentManagement.assignDistributionSet(ds3.getId(), new String[] { "4712" }).getActions().get(0));
assertThat(actionStatusRepository.findAll()).hasSize(3); assertThat(actionStatusRepository.findAll()).hasSize(3);
@@ -456,8 +459,8 @@ public class CancelActionTest extends AbstractIntegrationTest {
final List<Target> toAssign = new ArrayList<Target>(); final List<Target> toAssign = new ArrayList<Target>();
toAssign.add(target); toAssign.add(target);
final Action action = deploymentManagement.assignDistributionSet(ds.getId(), new String[] { "4712" }) final Action action = deploymentManagement.findActionWithDetails(
.getActions().get(0); deploymentManagement.assignDistributionSet(ds.getId(), new String[] { "4712" }).getActions().get(0));
final Action cancelAction = deploymentManagement.cancelAction(action, final Action cancelAction = deploymentManagement.cancelAction(action,
targetManagement.findTargetByControllerID(target.getControllerId())); targetManagement.findTargetByControllerID(target.getControllerId()));

View File

@@ -484,7 +484,8 @@ public class DeploymentBaseTest extends AbstractIntegrationTestWithMongoDB {
final DistributionSet savedSet = TestDataUtil.generateDistributionSet("", softwareManagement, final DistributionSet savedSet = TestDataUtil.generateDistributionSet("", softwareManagement,
distributionSetManagement); distributionSetManagement);
final Action action1 = deploymentManagement.assignDistributionSet(savedSet, toAssign).getActions().get(0); final Action action1 = deploymentManagement.findActionWithDetails(
deploymentManagement.assignDistributionSet(savedSet, toAssign).getActions().get(0));
mvc.perform( mvc.perform(
get("/{tenant}/controller/v1/4712/deploymentBase/" + action1.getId(), tenantAware.getCurrentTenant())) get("/{tenant}/controller/v1/4712/deploymentBase/" + action1.getId(), tenantAware.getCurrentTenant()))
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()); .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk());
@@ -544,12 +545,12 @@ public class DeploymentBaseTest extends AbstractIntegrationTestWithMongoDB {
final List<Target> toAssign = new ArrayList<Target>(); final List<Target> toAssign = new ArrayList<Target>();
toAssign.add(savedTarget1); toAssign.add(savedTarget1);
final Action action1 = deploymentManagement.assignDistributionSet(ds1.getId(), new String[] { "4712" }) final Action action1 = deploymentManagement.findActionWithDetails(
.getActions().get(0); deploymentManagement.assignDistributionSet(ds1.getId(), new String[] { "4712" }).getActions().get(0));
final Action action2 = deploymentManagement.assignDistributionSet(ds2.getId(), new String[] { "4712" }) final Action action2 = deploymentManagement.findActionWithDetails(
.getActions().get(0); deploymentManagement.assignDistributionSet(ds2.getId(), new String[] { "4712" }).getActions().get(0));
final Action action3 = deploymentManagement.assignDistributionSet(ds3.getId(), new String[] { "4712" }) final Action action3 = deploymentManagement.findActionWithDetails(
.getActions().get(0); deploymentManagement.assignDistributionSet(ds3.getId(), new String[] { "4712" }).getActions().get(0));
Target myT = targetManagement.findTargetByControllerID("4712"); Target myT = targetManagement.findTargetByControllerID("4712");
assertThat(myT.getTargetInfo().getUpdateStatus()).isEqualTo(TargetUpdateStatus.PENDING); assertThat(myT.getTargetInfo().getUpdateStatus()).isEqualTo(TargetUpdateStatus.PENDING);

View File

@@ -78,7 +78,8 @@ public class SoftwareModuleTable extends AbstractTable {
@Autowired @Autowired
private UploadViewAcceptCriteria uploadViewAcceptCriteria; private UploadViewAcceptCriteria uploadViewAcceptCriteria;
/** /**
* Initialize the filter layout. * Initialize the filter layout.
*/ */
@@ -127,12 +128,7 @@ public class SoftwareModuleTable extends AbstractTable {
*/ */
@Override @Override
protected Container createContainer() { protected Container createContainer() {
final Map<String, Object> queryConfiguration = new HashMap<String, Object>(); final Map<String, Object> queryConfiguration = prepareQueryConfigFilters();
artifactUploadState.getSoftwareModuleFilters().getSearchText()
.ifPresent(value -> queryConfiguration.put(SPUIDefinitions.FILTER_BY_TEXT, value));
artifactUploadState.getSoftwareModuleFilters().getSoftwareModuleType()
.ifPresent(type -> queryConfiguration.put(SPUIDefinitions.BY_SOFTWARE_MODULE_TYPE, type));
final BeanQueryFactory<BaseSwModuleBeanQuery> swQF = new BeanQueryFactory<BaseSwModuleBeanQuery>( final BeanQueryFactory<BaseSwModuleBeanQuery> swQF = new BeanQueryFactory<BaseSwModuleBeanQuery>(
BaseSwModuleBeanQuery.class); BaseSwModuleBeanQuery.class);
@@ -142,6 +138,19 @@ public class SoftwareModuleTable extends AbstractTable {
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF); new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
return container; return container;
} }
private Map<String, Object> prepareQueryConfigFilters() {
final Map<String, Object> queryConfig = new HashMap<String, Object>();
artifactUploadState.getSoftwareModuleFilters().getSearchText()
.ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
artifactUploadState.getSoftwareModuleFilters().getSoftwareModuleType()
.ifPresent(type -> queryConfig.put(SPUIDefinitions.BY_SOFTWARE_MODULE_TYPE, type));
return queryConfig;
}
@Override @Override
protected void addContainerProperties(final Container container) { protected void addContainerProperties(final Container container) {

View File

@@ -219,8 +219,10 @@ public class SoftwareModuleTableHeader extends AbstractTableHeader {
*/ */
@Override @Override
protected void resetSearchText() { protected void resetSearchText() {
artifactUploadState.getSoftwareModuleFilters().setSearchText(null); if(artifactUploadState.getSoftwareModuleFilters().getSearchText().isPresent()){
eventbus.publish(this, SMFilterEvent.REMOVER_FILTER_BY_TEXT); artifactUploadState.getSoftwareModuleFilters().setSearchText(null);
eventbus.publish(this, SMFilterEvent.REMOVER_FILTER_BY_TEXT);
}
} }
/* /*

View File

@@ -11,6 +11,7 @@ package org.eclipse.hawkbit.ui.components;
import java.util.Arrays; import java.util.Arrays;
import java.util.Map; import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonDecorator; import org.eclipse.hawkbit.ui.decorators.SPUIButtonDecorator;
import org.eclipse.hawkbit.ui.decorators.SPUIComboBoxDecorator; import org.eclipse.hawkbit.ui.decorators.SPUIComboBoxDecorator;
@@ -23,7 +24,6 @@ import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import com.vaadin.sass.internal.util.StringUtil;
import com.vaadin.server.ExternalResource; import com.vaadin.server.ExternalResource;
import com.vaadin.server.FontAwesome; import com.vaadin.server.FontAwesome;
import com.vaadin.server.Resource; import com.vaadin.server.Resource;
@@ -108,16 +108,16 @@ public final class SPUIComponentProvider {
final Class<? extends SPUIHeaderLayoutDecorator> tableHeaderLayoutDecorator) { final Class<? extends SPUIHeaderLayoutDecorator> tableHeaderLayoutDecorator) {
// Do we really need this??? // Do we really need this???
HorizontalLayout hLayout = getHorizontalLayout(new SPUIHorizontalLayout().getUiHorizontalLayout().getClass()); HorizontalLayout hLayout = getHorizontalLayout(new SPUIHorizontalLayout().getUiHorizontalLayout().getClass());
if (tableHeaderLayoutDecorator == null) {
return hLayout;
}
try { try {
SPUIHeaderLayoutDecorator layoutDecorator = null; final SPUIHeaderLayoutDecorator layoutDecorator = tableHeaderLayoutDecorator.newInstance();
if (tableHeaderLayoutDecorator != null) { hLayout = layoutDecorator.decorate(hLayout);
layoutDecorator = tableHeaderLayoutDecorator.newInstance();
hLayout = layoutDecorator.decorate(hLayout); } catch (final InstantiationException | IllegalAccessException exception) {
}
} catch (final InstantiationException exception) {
LOG.error("Error occured while creating horizontal decorator " + SPUIHeaderLayoutDecorator.class,
exception);
} catch (final IllegalAccessException exception) {
LOG.error("Error occured while creating horizontal decorator " + SPUIHeaderLayoutDecorator.class, LOG.error("Error occured while creating horizontal decorator " + SPUIHeaderLayoutDecorator.class,
exception); exception);
} }
@@ -324,7 +324,7 @@ public final class SPUIComponentProvider {
* @return Label * @return Label
*/ */
public static Label createNameValueLabel(final String label, final String... values) { public static Label createNameValueLabel(final String label, final String... values) {
final String valueStr = StringUtil.collectionToDelimitedString(Arrays.asList(values), " "); final String valueStr = StringUtils.join(Arrays.asList(values), " ");
final Label nameValueLabel = new Label(getBoldHTMLText(label) + valueStr, ContentMode.HTML); final Label nameValueLabel = new Label(getBoldHTMLText(label) + valueStr, ContentMode.HTML);
nameValueLabel.setSizeFull(); nameValueLabel.setSizeFull();
nameValueLabel.addStyleName(SPUIDefinitions.TEXT_STYLE); nameValueLabel.addStyleName(SPUIDefinitions.TEXT_STYLE);

View File

@@ -114,7 +114,7 @@ public class DistributionSetTable extends AbstractTable {
@Autowired @Autowired
private transient TargetManagement targetManagement; private transient TargetManagement targetManagement;
/** /**
* Initialize the component. * Initialize the component.
*/ */
@@ -157,21 +157,28 @@ public class DistributionSetTable extends AbstractTable {
@Override @Override
protected Container createContainer() { protected Container createContainer() {
final Map<String, Object> queryConfiguration = new HashMap<>(); final Map<String, Object> queryConfiguration = prepareQueryConfigFilters();
manageDistUIState.getManageDistFilters().getSearchText()
.ifPresent(value -> queryConfiguration.put(SPUIDefinitions.FILTER_BY_TEXT, value));
if (null != manageDistUIState.getManageDistFilters().getClickedDistSetType()) {
queryConfiguration.put(SPUIDefinitions.FILTER_BY_DISTRIBUTION_SET_TYPE,
manageDistUIState.getManageDistFilters().getClickedDistSetType());
}
final BeanQueryFactory<ManageDistBeanQuery> distributionQF = new BeanQueryFactory<>(ManageDistBeanQuery.class); final BeanQueryFactory<ManageDistBeanQuery> distributionQF = new BeanQueryFactory<>(ManageDistBeanQuery.class);
distributionQF.setQueryConfiguration(queryConfiguration); distributionQF.setQueryConfiguration(queryConfiguration);
return new LazyQueryContainer( return new LazyQueryContainer(
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_DIST_ID_NAME), new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_DIST_ID_NAME),
distributionQF); distributionQF);
} }
private Map<String, Object> prepareQueryConfigFilters() {
final Map<String, Object> queryConfig = new HashMap<String, Object>();
manageDistUIState.getManageDistFilters().getSearchText()
.ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
if (null != manageDistUIState.getManageDistFilters().getClickedDistSetType()) {
queryConfig.put(SPUIDefinitions.FILTER_BY_DISTRIBUTION_SET_TYPE,
manageDistUIState.getManageDistFilters().getClickedDistSetType());
}
return queryConfig;
}
/* /*
* (non-Javadoc) * (non-Javadoc)

View File

@@ -170,9 +170,10 @@ public class DistributionSetTableHeader extends AbstractTableHeader {
@Override @Override
protected void resetSearchText() { protected void resetSearchText() {
manageDistUIstate.getManageDistFilters().setSearchText(null); if(manageDistUIstate.getManageDistFilters().getSearchText().isPresent()){
eventbus.publish(this, DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT); manageDistUIstate.getManageDistFilters().setSearchText(null);
eventbus.publish(this, DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT);
}
} }
@Override @Override

View File

@@ -94,8 +94,8 @@ public class SwModuleTable extends AbstractTable {
@Autowired @Autowired
private ArtifactDetailsLayout artifactDetailsLayout; private ArtifactDetailsLayout artifactDetailsLayout;
/** /**
* Initialize the filter layout. * Initialize the filter layout.
*/ */
@PostConstruct @PostConstruct
@@ -177,15 +177,7 @@ public class SwModuleTable extends AbstractTable {
*/ */
@Override @Override
protected Container createContainer() { protected Container createContainer() {
final Map<String, Object> queryConfiguration = new HashMap<String, Object>(); final Map<String, Object> queryConfiguration = prepareQueryConfigFilters();
manageDistUIState.getSoftwareModuleFilters().getSearchText()
.ifPresent(value -> queryConfiguration.put(SPUIDefinitions.FILTER_BY_TEXT, value));
manageDistUIState.getSoftwareModuleFilters().getSoftwareModuleType()
.ifPresent(type -> queryConfiguration.put(SPUIDefinitions.BY_SOFTWARE_MODULE_TYPE, type));
manageDistUIState.getLastSelectedDistribution().ifPresent(
distIdName -> queryConfiguration.put(SPUIDefinitions.ORDER_BY_DISTRIBUTION, distIdName.getId()));
final BeanQueryFactory<SwModuleBeanQuery> swQF = new BeanQueryFactory<SwModuleBeanQuery>( final BeanQueryFactory<SwModuleBeanQuery> swQF = new BeanQueryFactory<SwModuleBeanQuery>(
SwModuleBeanQuery.class); SwModuleBeanQuery.class);
@@ -195,6 +187,20 @@ public class SwModuleTable extends AbstractTable {
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF); new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
return container; return container;
} }
private Map<String, Object> prepareQueryConfigFilters() {
final Map<String, Object> queryConfig = new HashMap<String, Object>();
manageDistUIState.getSoftwareModuleFilters().getSearchText()
.ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
manageDistUIState.getSoftwareModuleFilters().getSoftwareModuleType()
.ifPresent(type -> queryConfig.put(SPUIDefinitions.BY_SOFTWARE_MODULE_TYPE, type));
manageDistUIState.getLastSelectedDistribution().ifPresent(
distIdName -> queryConfig.put(SPUIDefinitions.ORDER_BY_DISTRIBUTION, distIdName.getId()));
return queryConfig;
}
/* /*
* (non-Javadoc) * (non-Javadoc)

View File

@@ -203,8 +203,10 @@ public class SwModuleTableHeader extends AbstractTableHeader {
*/ */
@Override @Override
protected void resetSearchText() { protected void resetSearchText() {
manageDistUIState.getSoftwareModuleFilters().setSearchText(null); if(manageDistUIState.getSoftwareModuleFilters().getSearchText().isPresent()){
eventbus.publish(this, SMFilterEvent.REMOVER_FILTER_BY_TEXT); manageDistUIState.getSoftwareModuleFilters().setSearchText(null);
eventbus.publish(this, SMFilterEvent.REMOVER_FILTER_BY_TEXT);
}
} }
/* /*

View File

@@ -112,7 +112,8 @@ public class DistributionTable extends AbstractTable {
private Boolean isDistPinned = false; private Boolean isDistPinned = false;
private Button distributinPinnedBtn; private Button distributinPinnedBtn;
/** /**
* Initialize the distribution table. * Initialize the distribution table.
*/ */
@@ -141,7 +142,7 @@ public class DistributionTable extends AbstractTable {
|| event == DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT || event == DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT
|| event == DistributionTableFilterEvent.FILTER_BY_TAG) { || event == DistributionTableFilterEvent.FILTER_BY_TAG) {
UI.getCurrent().access(() -> refreshFilter()); UI.getCurrent().access(() -> refreshFilter());
} }
} }
@EventBusListenerMethod(scope = EventScope.SESSION) @EventBusListenerMethod(scope = EventScope.SESSION)
@@ -219,18 +220,8 @@ public class DistributionTable extends AbstractTable {
*/ */
@Override @Override
protected Container createContainer() { protected Container createContainer() {
final Map<String, Object> queryConfiguration = new HashMap<String, Object>(); final Map<String, Object> queryConfiguration = prepareQueryConfigFilters();
managementUIState.getDistributionTableFilters().getSearchText()
.ifPresent(value -> queryConfiguration.put(SPUIDefinitions.FILTER_BY_TEXT, value));
managementUIState.getDistributionTableFilters().getPinnedTargetId()
.ifPresent(value -> queryConfiguration.put(SPUIDefinitions.ORDER_BY_PINNED_TARGET, value));
final List<String> list = new ArrayList<String>();
queryConfiguration.put(SPUIDefinitions.FILTER_BY_NO_TAG,
managementUIState.getDistributionTableFilters().isNoTagSelected());
if (!managementUIState.getDistributionTableFilters().getDistSetTags().isEmpty()) {
list.addAll(managementUIState.getDistributionTableFilters().getDistSetTags());
}
queryConfiguration.put(SPUIDefinitions.FILTER_BY_TAG, list);
final BeanQueryFactory<DistributionBeanQuery> distributionQF = new BeanQueryFactory<DistributionBeanQuery>( final BeanQueryFactory<DistributionBeanQuery> distributionQF = new BeanQueryFactory<DistributionBeanQuery>(
DistributionBeanQuery.class); DistributionBeanQuery.class);
distributionQF.setQueryConfiguration(queryConfiguration); distributionQF.setQueryConfiguration(queryConfiguration);
@@ -239,6 +230,22 @@ public class DistributionTable extends AbstractTable {
distributionQF); distributionQF);
return distributionContainer; return distributionContainer;
} }
private Map<String, Object> prepareQueryConfigFilters() {
final Map<String, Object> queryConfig = new HashMap<String, Object>();
managementUIState.getDistributionTableFilters().getSearchText()
.ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
managementUIState.getDistributionTableFilters().getPinnedTargetId()
.ifPresent(value -> queryConfig.put(SPUIDefinitions.ORDER_BY_PINNED_TARGET, value));
final List<String> list = new ArrayList<String>();
queryConfig.put(SPUIDefinitions.FILTER_BY_NO_TAG,
managementUIState.getDistributionTableFilters().isNoTagSelected());
if (!managementUIState.getDistributionTableFilters().getDistSetTags().isEmpty()) {
list.addAll(managementUIState.getDistributionTableFilters().getDistSetTags());
}
queryConfig.put(SPUIDefinitions.FILTER_BY_TAG, list);
return queryConfig;
}
/* /*
* (non-Javadoc) * (non-Javadoc)

View File

@@ -210,8 +210,10 @@ public class DistributionTableHeader extends AbstractTableHeader {
*/ */
@Override @Override
protected void resetSearchText() { protected void resetSearchText() {
managementUIState.getDistributionTableFilters().setSearchText(null); if( managementUIState.getDistributionTableFilters().getSearchText().isPresent()){
eventbus.publish(this, DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT); managementUIState.getDistributionTableFilters().setSearchText(null);
eventbus.publish(this, DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT);
}
} }
/* /*

View File

@@ -15,6 +15,7 @@ import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -73,8 +74,8 @@ import org.vaadin.spring.events.EventBus;
import org.vaadin.spring.events.EventScope; import org.vaadin.spring.events.EventScope;
import org.vaadin.spring.events.annotation.EventBusListenerMethod; import org.vaadin.spring.events.annotation.EventBusListenerMethod;
import com.google.common.base.Strings;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.google.gwt.thirdparty.guava.common.base.Strings;
import com.vaadin.data.Container; import com.vaadin.data.Container;
import com.vaadin.data.Item; import com.vaadin.data.Item;
import com.vaadin.event.Action; import com.vaadin.event.Action;
@@ -104,6 +105,8 @@ import com.vaadin.ui.themes.ValoTheme;
@ViewScope @ViewScope
public class TargetTable extends AbstractTable implements Handler { public class TargetTable extends AbstractTable implements Handler {
private static final String TARGET_PINNED = "targetPinned";
private static final long serialVersionUID = -2300392868806614568L; private static final long serialVersionUID = -2300392868806614568L;
private static final Logger LOG = LoggerFactory.getLogger(TargetTable.class); private static final Logger LOG = LoggerFactory.getLogger(TargetTable.class);
@@ -138,6 +141,8 @@ public class TargetTable extends AbstractTable implements Handler {
private Boolean isTargetPinned = Boolean.FALSE; private Boolean isTargetPinned = Boolean.FALSE;
private ShortcutAction actionSelectAll; private ShortcutAction actionSelectAll;
private ShortcutAction actionUnSelectAll; private ShortcutAction actionUnSelectAll;
@Override @Override
@PostConstruct @PostConstruct
@@ -271,7 +276,7 @@ public class TargetTable extends AbstractTable implements Handler {
final Map<String, Object> queryConfig = prepareQueryConfigFilters(); final Map<String, Object> queryConfig = prepareQueryConfigFilters();
// Create TargetBeanQuery factory with the query config. // Create TargetBeanQuery factory with the query config.
final BeanQueryFactory<TargetBeanQuery> targetQF = new BeanQueryFactory<TargetBeanQuery>(TargetBeanQuery.class); final BeanQueryFactory<TargetBeanQuery> targetQF = new BeanQueryFactory<>(TargetBeanQuery.class);
targetQF.setQueryConfiguration(queryConfig); targetQF.setQueryConfiguration(queryConfig);
// create lazy query container with lazy defination and query // create lazy query container with lazy defination and query
@@ -394,7 +399,7 @@ public class TargetTable extends AbstractTable implements Handler {
*/ */
@Override @Override
protected List<TableColumn> getTableVisibleColumns() { protected List<TableColumn> getTableVisibleColumns() {
final List<TableColumn> columnList = new ArrayList<TableColumn>(); final List<TableColumn> columnList = new ArrayList<>();
if (isMaximized()) { if (isMaximized()) {
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_NAME, i18n.get("header.name"), 0.2f)); columnList.add(new TableColumn(SPUILabelDefinitions.VAR_NAME, i18n.get("header.name"), 0.2f));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_BY, i18n.get("header.createdBy"), 0.1f)); columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_BY, i18n.get("header.createdBy"), 0.1f));
@@ -469,7 +474,7 @@ public class TargetTable extends AbstractTable implements Handler {
} }
private Map<String, Object> prepareQueryConfigFilters() { private Map<String, Object> prepareQueryConfigFilters() {
final Map<String, Object> queryConfig = new HashMap<String, Object>(); final Map<String, Object> queryConfig = new HashMap<>();
managementUIState.getTargetTableFilters().getSearchText() managementUIState.getTargetTableFilters().getSearchText()
.ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value)); .ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
managementUIState.getTargetTableFilters().getDistributionSet() managementUIState.getTargetTableFilters().getDistributionSet()
@@ -481,7 +486,7 @@ public class TargetTable extends AbstractTable implements Handler {
queryConfig.put(SPUIDefinitions.FILTER_BY_NO_TAG, managementUIState.getTargetTableFilters().isNoTagSelected()); queryConfig.put(SPUIDefinitions.FILTER_BY_NO_TAG, managementUIState.getTargetTableFilters().isNoTagSelected());
if (isFilteredByTags()) { if (isFilteredByTags()) {
final List<String> list = new ArrayList<String>(); final List<String> list = new ArrayList<>();
list.addAll(managementUIState.getTargetTableFilters().getClickedTargetTags()); list.addAll(managementUIState.getTargetTableFilters().getClickedTargetTags());
queryConfig.put(SPUIDefinitions.FILTER_BY_TAG, list.toArray(new String[list.size()])); queryConfig.put(SPUIDefinitions.FILTER_BY_TAG, list.toArray(new String[list.size()]));
} }
@@ -522,7 +527,7 @@ public class TargetTable extends AbstractTable implements Handler {
pinBtn.setId(SPUIComponetIdProvider.TARGET_PIN_ICON + "." + itemId); pinBtn.setId(SPUIComponetIdProvider.TARGET_PIN_ICON + "." + itemId);
pinBtn.addClickListener(event -> addPinClickListener(event)); pinBtn.addClickListener(event -> addPinClickListener(event));
if (isPinned(((TargetIdName) itemId).getControllerId())) { if (isPinned(((TargetIdName) itemId).getControllerId())) {
pinBtn.addStyleName("targetPinned"); pinBtn.addStyleName(TARGET_PINNED);
isTargetPinned = Boolean.TRUE; isTargetPinned = Boolean.TRUE;
targetPinnedBtn = pinBtn; targetPinnedBtn = pinBtn;
eventBus.publish(this, PinUnpinEvent.PIN_TARGET); eventBus.publish(this, PinUnpinEvent.PIN_TARGET);
@@ -533,7 +538,7 @@ public class TargetTable extends AbstractTable implements Handler {
} }
private boolean isPinned(final String targetId) { private boolean isPinned(final String targetId) {
boolean result = false; boolean result;
if (managementUIState.getDistributionTableFilters().getPinnedTargetId().isPresent() if (managementUIState.getDistributionTableFilters().getPinnedTargetId().isPresent()
&& targetId.equals(managementUIState.getDistributionTableFilters().getPinnedTargetId().get())) { && targetId.equals(managementUIState.getDistributionTableFilters().getPinnedTargetId().get())) {
result = true; result = true;
@@ -594,7 +599,7 @@ public class TargetTable extends AbstractTable implements Handler {
eventBus.publish(this, PinUnpinEvent.PIN_TARGET); eventBus.publish(this, PinUnpinEvent.PIN_TARGET);
/* change target table styling */ /* change target table styling */
styleTargetTable(); styleTargetTable();
eventBtn.addStyleName("targetPinned"); eventBtn.addStyleName(TARGET_PINNED);
isTargetPinned = Boolean.FALSE; isTargetPinned = Boolean.FALSE;
} }
@@ -605,7 +610,7 @@ public class TargetTable extends AbstractTable implements Handler {
} }
private void resetPinStyle(final Button pinBtn) { private void resetPinStyle(final Button pinBtn) {
pinBtn.removeStyleName("targetPinned"); pinBtn.removeStyleName(TARGET_PINNED);
pinBtn.addStyleName(SPUIStyleDefinitions.TARGET_STATUS_PIN_TOGGLE); pinBtn.addStyleName(SPUIStyleDefinitions.TARGET_STATUS_PIN_TOGGLE);
HawkbitCommonUtil.applyStatusLblStyle(this, pinBtn, pinBtn.getData()); HawkbitCommonUtil.applyStatusLblStyle(this, pinBtn, pinBtn.getData());
} }
@@ -644,7 +649,7 @@ public class TargetTable extends AbstractTable implements Handler {
final com.vaadin.event.dd.TargetDetails taregtDet = event.getTargetDetails(); final com.vaadin.event.dd.TargetDetails taregtDet = event.getTargetDetails();
final Table targetTable = (Table) taregtDet.getTarget(); final Table targetTable = (Table) taregtDet.getTarget();
final Set<TargetIdName> targetSelected = HawkbitCommonUtil.getSelectedTargetDetails(targetTable); final Set<TargetIdName> targetSelected = HawkbitCommonUtil.getSelectedTargetDetails(targetTable);
final Set<String> targetList = new HashSet<String>(); final Set<String> targetList = new HashSet<>();
final AbstractSelectTargetDetails dropData = (AbstractSelectTargetDetails) event.getTargetDetails(); final AbstractSelectTargetDetails dropData = (AbstractSelectTargetDetails) event.getTargetDetails();
final Object targetItemId = dropData.getItemIdOver(); final Object targetItemId = dropData.getItemIdOver();
if (!targetSelected.contains(targetItemId)) { if (!targetSelected.contains(targetItemId)) {
@@ -701,9 +706,8 @@ public class TargetTable extends AbstractTable implements Handler {
private static Set<DistributionSetIdName> getDraggedDistributionSet(final TableTransferable transferable, private static Set<DistributionSetIdName> getDraggedDistributionSet(final TableTransferable transferable,
final Table source) { final Table source) {
@SuppressWarnings("unchecked")
final Set<DistributionSetIdName> distSelected = HawkbitCommonUtil.getSelectedDSDetails(source); final Set<DistributionSetIdName> distSelected = HawkbitCommonUtil.getSelectedDSDetails(source);
final Set<DistributionSetIdName> distributionIdSet = new HashSet<DistributionSetIdName>(); final Set<DistributionSetIdName> distributionIdSet = new HashSet<>();
if (!distSelected.contains(transferable.getData(ITEMID))) { if (!distSelected.contains(transferable.getData(ITEMID))) {
distributionIdSet.add((DistributionSetIdName) transferable.getData(ITEMID)); distributionIdSet.add((DistributionSetIdName) transferable.getData(ITEMID));
} else { } else {
@@ -828,15 +832,11 @@ public class TargetTable extends AbstractTable implements Handler {
} }
} }
/** private static boolean checkFilterEvent(final TargetFilterEvent filterEvent) {
* @param filterEvent boolean isFilterEvent;
* @return boolean isFilter;
*/ boolean isRemoveFilters;
private boolean checkFilterEvent(final TargetFilterEvent filterEvent) { boolean isStatusFilter;
boolean isFilterEvent = false;
boolean isFilter = false;
boolean isRemoveFilters = false;
boolean isStatusFilter = false;
isFilter = filterEvent == TargetFilterEvent.FILTER_BY_TEXT || filterEvent == TargetFilterEvent.FILTER_BY_TAG isFilter = filterEvent == TargetFilterEvent.FILTER_BY_TEXT || filterEvent == TargetFilterEvent.FILTER_BY_TAG
|| filterEvent == TargetFilterEvent.FILTER_BY_DISTRIBUTION || filterEvent == TargetFilterEvent.FILTER_BY_DISTRIBUTION
|| filterEvent == TargetFilterEvent.FILTER_BY_TARGET_FILTER_QUERY; || filterEvent == TargetFilterEvent.FILTER_BY_TARGET_FILTER_QUERY;
@@ -1020,11 +1020,11 @@ public class TargetTable extends AbstractTable implements Handler {
private List<TargetIdName> getTargetIdsBySimpleFilters(final PageRequest pageRequest) { private List<TargetIdName> getTargetIdsBySimpleFilters(final PageRequest pageRequest) {
final Long filterByDistId = managementUIState.getTargetTableFilters().getDistributionSet().isPresent() final Long filterByDistId = managementUIState.getTargetTableFilters().getDistributionSet().isPresent()
? managementUIState.getTargetTableFilters().getDistributionSet().get().getId() : null; ? managementUIState.getTargetTableFilters().getDistributionSet().get().getId() : null;
final List<TargetUpdateStatus> statusList = new ArrayList<TargetUpdateStatus>(); final List<TargetUpdateStatus> statusList = new ArrayList<>();
if (isFilteredByStatus()) { if (isFilteredByStatus()) {
statusList.addAll(managementUIState.getTargetTableFilters().getClickedStatusTargetTags()); statusList.addAll(managementUIState.getTargetTableFilters().getClickedStatusTargetTags());
} }
final List<String> tagList = new ArrayList<String>(); final List<String> tagList = new ArrayList<>();
if (isFilteredByTags()) { if (isFilteredByTags()) {
tagList.addAll(managementUIState.getTargetTableFilters().getClickedTargetTags()); tagList.addAll(managementUIState.getTargetTableFilters().getClickedTargetTags());
} }
@@ -1081,7 +1081,7 @@ public class TargetTable extends AbstractTable implements Handler {
String[] targetTags = null; String[] targetTags = null;
Long distributionId = null; Long distributionId = null;
String searchText = null; String searchText = null;
Boolean noTagClicked = Boolean.FALSE; Boolean noTagClicked;
Long pinnedDistId = null; Long pinnedDistId = null;
if (isFilteredByTags()) { if (isFilteredByTags()) {
@@ -1129,13 +1129,13 @@ public class TargetTable extends AbstractTable implements Handler {
&& !Strings.isNullOrEmpty(managementUIState.getTargetTableFilters().getSearchText().get()); && !Strings.isNullOrEmpty(managementUIState.getTargetTableFilters().getSearchText().get());
} }
private Boolean anyFilterSelected(final Collection<TargetUpdateStatus> status, final Long distributionId, private static Boolean anyFilterSelected(final Collection<TargetUpdateStatus> status, final Long distributionId,
final Boolean noTagClicked, final String[] targetTags, final String searchText) { final Boolean noTagClicked, final String[] targetTags, final String searchText) {
return status == null && distributionId == null && Strings.isNullOrEmpty(searchText) return status == null && distributionId == null && Strings.isNullOrEmpty(searchText)
&& !isTagSelected(targetTags, noTagClicked); && !isTagSelected(targetTags, noTagClicked);
} }
private Boolean isTagSelected(final String[] targetTags, final Boolean noTagClicked) { private static Boolean isTagSelected(final String[] targetTags, final Boolean noTagClicked) {
return targetTags == null && !noTagClicked; return targetTags == null && !noTagClicked;
} }

View File

@@ -258,8 +258,10 @@ public class TargetTableHeader extends AbstractTableHeader {
@Override @Override
protected void resetSearchText() { protected void resetSearchText() {
managementUIState.getTargetTableFilters().setSearchText(null); if(managementUIState.getTargetTableFilters().getSearchText().isPresent()){
eventBus.publish(this, TargetFilterEvent.REMOVE_FILTER_BY_TEXT); managementUIState.getTargetTableFilters().setSearchText(null);
eventBus.publish(this, TargetFilterEvent.REMOVE_FILTER_BY_TEXT);
}
} }
private String getSearchText() { private String getSearchText() {

View File

@@ -15,7 +15,7 @@ import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions; import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import com.google.gwt.thirdparty.guava.common.base.Strings; import com.google.common.base.Strings;
import com.vaadin.server.FontAwesome; import com.vaadin.server.FontAwesome;
import com.vaadin.ui.AbstractTextField.TextChangeEventMode; import com.vaadin.ui.AbstractTextField.TextChangeEventMode;
import com.vaadin.ui.Alignment; import com.vaadin.ui.Alignment;

134
pom.xml
View File

@@ -15,7 +15,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.7.RELEASE</version> <version>1.2.8.RELEASE</version>
</parent> </parent>
<groupId>org.eclipse.hawkbit</groupId> <groupId>org.eclipse.hawkbit</groupId>
@@ -57,42 +57,61 @@
</repositories> </repositories>
<properties> <properties>
<spring.boot.version>1.2.7.RELEASE</spring.boot.version> <java.version>1.8</java.version>
<spring.boot.version>1.2.8.RELEASE</spring.boot.version>
<!-- Spring boot overrides - START --> <!-- Spring boot version overrides (should be reviewed with every boot upgrade) - START -->
<h2.version>1.4.186</h2.version> <!-- Newer versions needed than defined in Boot-->
<jackson.version>2.5.0</jackson.version> <jackson.version>2.5.5</jackson.version>
<hibernate-validator.version>5.2.2.Final</hibernate-validator.version> <hibernate-validator.version>5.2.4.Final</hibernate-validator.version>
<spring-data-releasetrain.version>Fowler-SR1</spring-data-releasetrain.version>
<spring-cloud-connectors.version>1.2.0.RELEASE</spring-cloud-connectors.version> <spring-cloud-connectors.version>1.2.0.RELEASE</spring-cloud-connectors.version>
<mongodb.version>3.0.2</mongodb.version> <!-- Support for MongoDB 3 -->
<!-- Spring boot overrides - END --> <spring-data-releasetrain.version>Fowler-SR1</spring-data-releasetrain.version>
<mongodb.version>3.2.2</mongodb.version>
<!-- Spring boot version overrides - END -->
<!-- Vaadin versions - START --> <!-- Vaadin versions - START -->
<vaadin.spring.version>1.0.0</vaadin.spring.version> <vaadin.spring.version>1.0.0</vaadin.spring.version>
<vaadin.spring.addon.version>0.0.6.RELEASE</vaadin.spring.addon.version> <vaadin.spring.addon.version>0.0.6.RELEASE</vaadin.spring.addon.version>
<vaadin.version>7.5.7</vaadin.version> <vaadin.version>7.5.10</vaadin.version>
<vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version> <vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
<vaadin.addon.vaadin-lazyquerycontainer.version>7.4.0.1</vaadin.addon.vaadin-lazyquerycontainer.version>
<vaadin.addon.flexibleoptiongroup.version>2.2.0</vaadin.addon.flexibleoptiongroup.version>
<vaadin.addon.tokenfield.version>7.0.1</vaadin.addon.tokenfield.version>
<vaadin.addon.dbar-addon.version>1.2.0</vaadin.addon.dbar-addon.version>
<vaadin.addon.contextmenu.version>4.5</vaadin.addon.contextmenu.version>
<!-- Vaadin versions - END --> <!-- Vaadin versions - END -->
<!-- Misc --> <!-- Misc libraries versions - START -->
<fest-assert.version>1.4</fest-assert.version> <fest-assert.version>1.4</fest-assert.version>
<org.easytesting.version>2.0M10</org.easytesting.version> <org.easytesting.version>2.0M10</org.easytesting.version>
<java.version>1.8</java.version>
<allure.version>1.4.15</allure.version> <allure.version>1.4.15</allure.version>
<eclipselink.version>2.6.0</eclipselink.version> <eclipselink.version>2.6.2</eclipselink.version>
<org.powermock.version>1.5.4</org.powermock.version> <org.powermock.version>1.5.4</org.powermock.version>
<pl.pragmatists.version>1.0.2</pl.pragmatists.version> <pl.pragmatists.version>1.0.2</pl.pragmatists.version>
<json-path.version>0.9.1</json-path.version> <json-path.version>0.9.1</json-path.version>
<commons-lang3.version>3.4</commons-lang3.version>
<aspectj.version>1.8.5</aspectj.version> <aspectj.version>1.8.5</aspectj.version>
<guava.version>19.0</guava.version>
<mariadb-java-client.version>1.3.5</mariadb-java-client.version>
<embedded-mongo.version>1.50.2</embedded-mongo.version>
<jersey-client.version>1.18.1</jersey-client.version>
<javax.el-api.version>2.2.4</javax.el-api.version>
<corn-cps.version>1.1.7</corn-cps.version>
<jlorem.version>1.1</jlorem.version>
<json-simple.version>1.1.1</json-simple.version>
<commons-lang3.version>3.4</commons-lang3.version>
<json.version>20141113</json.version>
<rsql-parser.version>2.0.0</rsql-parser.version>
<!-- Misc libraries versions - END -->
<!-- Release --> <!-- Release - START -->
<release.scm.connection>scm:git:https://github.com/eclipse/hawkbit.git</release.scm.connection> <release.scm.connection>scm:git:https://github.com/eclipse/hawkbit.git</release.scm.connection>
<release.scm.developerConnection>scm:git:https://github.com/eclipse/hawkbit.git</release.scm.developerConnection> <release.scm.developerConnection>scm:git:https://github.com/eclipse/hawkbit.git</release.scm.developerConnection>
<release.scm.url>https://github.com/eclipse/hawkbit.git</release.scm.url> <release.scm.url>https://github.com/eclipse/hawkbit.git</release.scm.url>
<!-- Release - END -->
<!-- Sonar --> <!-- Sonar - START-->
<sonar.host.url>https://sonar.eu-gb.mybluemix.net</sonar.host.url> <sonar.host.url>https://sonar.eu-gb.mybluemix.net</sonar.host.url>
<sonar.github.repository>eclipse/hawkbit</sonar.github.repository> <sonar.github.repository>eclipse/hawkbit</sonar.github.repository>
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin> <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
@@ -123,7 +142,7 @@
<!-- Tells Sonar where the Jacoco coverage result file is located for <!-- Tells Sonar where the Jacoco coverage result file is located for
Integration Tests --> Integration Tests -->
<sonar.jacoco.itReportPath>${jacoco.outputDir}/${jacoco.out.it.file}</sonar.jacoco.itReportPath> <sonar.jacoco.itReportPath>${jacoco.outputDir}/${jacoco.out.it.file}</sonar.jacoco.itReportPath>
<guava.version>19.0</guava.version> <!-- Sonar - END-->
</properties> </properties>
@@ -335,7 +354,7 @@
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
<version>1.7.7</version> <version>${slf4j.version}</version>
</dependency> </dependency>
<!-- Vaadin --> <!-- Vaadin -->
<dependency> <dependency>
@@ -363,30 +382,6 @@
<artifactId>vaadin-push</artifactId> <artifactId>vaadin-push</artifactId>
<version>${vaadin.version}</version> <version>${vaadin.version}</version>
</dependency> </dependency>
<!-- Needed when using the widgetset optimizer (custom ConnectorBundleLoaderFactory).
For widgetset compilation, vaadin-client-compiler is automatically added
on the compilation classpath by vaadin-maven-plugin so normally there is
no need for an explicit dependency. -->
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiler</artifactId>
<version>${vaadin.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlets</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency> <dependency>
<groupId>com.vaadin</groupId> <groupId>com.vaadin</groupId>
<artifactId>vaadin-themes</artifactId> <artifactId>vaadin-themes</artifactId>
@@ -395,44 +390,44 @@
<dependency> <dependency>
<groupId>org.vaadin.addons.lazyquerycontainer</groupId> <groupId>org.vaadin.addons.lazyquerycontainer</groupId>
<artifactId>vaadin-lazyquerycontainer</artifactId> <artifactId>vaadin-lazyquerycontainer</artifactId>
<version>7.4.0.1</version> <version>${vaadin.addon.vaadin-lazyquerycontainer.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.vaadin.addons</groupId> <groupId>org.vaadin.addons</groupId>
<artifactId>flexibleoptiongroup</artifactId> <artifactId>flexibleoptiongroup</artifactId>
<version>2.2.0</version> <version>${vaadin.addon.flexibleoptiongroup.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.vaadin.addons</groupId> <groupId>org.vaadin.addons</groupId>
<artifactId>tokenfield</artifactId> <artifactId>tokenfield</artifactId>
<version>7.0.1</version> <version>${vaadin.addon.tokenfield.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.vaadin.alump.distributionbar</groupId> <groupId>org.vaadin.alump.distributionbar</groupId>
<artifactId>dbar-addon</artifactId> <artifactId>dbar-addon</artifactId>
<version>1.2.0</version> <version>${vaadin.addon.dbar-addon.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.vaadin.addons</groupId> <groupId>org.vaadin.addons</groupId>
<artifactId>contextmenu</artifactId> <artifactId>contextmenu</artifactId>
<version>4.5</version> <version>${vaadin.addon.contextmenu.version}</version>
</dependency> </dependency>
<!-- Misc --> <!-- Misc -->
<dependency> <dependency>
<groupId>javax.el</groupId> <groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId> <artifactId>javax.el-api</artifactId>
<version>2.2.4</version> <version>${javax.el-api.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.sf.corn</groupId> <groupId>net.sf.corn</groupId>
<artifactId>corn-cps</artifactId> <artifactId>corn-cps</artifactId>
<version>1.1.7</version> <version>${corn-cps.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net._01001111</groupId> <groupId>net._01001111</groupId>
<artifactId>jlorem</artifactId> <artifactId>jlorem</artifactId>
<version>1.1</version> <version>${jlorem.version}</version>
</dependency> </dependency>
<!-- Spring --> <!-- Spring -->
<dependency> <dependency>
@@ -514,13 +509,6 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!-- Override of classmate version, that is a hibernate validator
dependency. allow PB of CQ -->
<dependency>
<groupId>com.fasterxml</groupId>
<artifactId>classmate</artifactId>
<version>1.3.0</version>
</dependency>
<dependency> <dependency>
<groupId>org.eclipse.persistence</groupId> <groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa</artifactId> <artifactId>org.eclipse.persistence.jpa</artifactId>
@@ -530,7 +518,7 @@
<dependency> <dependency>
<groupId>cz.jirutka.rsql</groupId> <groupId>cz.jirutka.rsql</groupId>
<artifactId>rsql-parser</artifactId> <artifactId>rsql-parser</artifactId>
<version>2.0.0</version> <version>${rsql-parser.version}</version>
</dependency> </dependency>
<!-- JSON PATH, used to e.g. parse vcap services from environment --> <!-- JSON PATH, used to e.g. parse vcap services from environment -->
<dependency> <dependency>
@@ -541,7 +529,7 @@
<dependency> <dependency>
<groupId>com.googlecode.json-simple</groupId> <groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId> <artifactId>json-simple</artifactId>
<version>1.1.1</version> <version>${json-simple.version}</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>junit</groupId> <groupId>junit</groupId>
@@ -549,13 +537,13 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!-- Spring boot overrides - START -->
<dependency> <dependency>
<groupId>xml-apis</groupId> <groupId>org.apache.commons</groupId>
<artifactId>xml-apis</artifactId> <artifactId>commons-lang3</artifactId>
<version>1.4.01</version> <version>${commons-lang3.version}</version>
</dependency> </dependency>
<!-- Spring boot overrides - END -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
@@ -567,22 +555,16 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-testbench</artifactId>
<version>4.0.3</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.json</groupId> <groupId>org.json</groupId>
<artifactId>json</artifactId> <artifactId>json</artifactId>
<version>20141113</version> <version>${json.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>de.flapdoodle.embed</groupId> <groupId>de.flapdoodle.embed</groupId>
<artifactId>de.flapdoodle.embed.mongo</artifactId> <artifactId>de.flapdoodle.embed.mongo</artifactId>
<version>1.50.0</version> <version>${embedded-mongo.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
@@ -606,7 +588,7 @@
<dependency> <dependency>
<groupId>com.sun.jersey</groupId> <groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId> <artifactId>jersey-client</artifactId>
<version>1.18.1</version> <version>${jersey-client.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
@@ -618,13 +600,13 @@
<dependency> <dependency>
<groupId>com.jayway.jsonpath</groupId> <groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path-assert</artifactId> <artifactId>json-path-assert</artifactId>
<version>0.9.1</version> <version>${json-path.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mariadb.jdbc</groupId> <groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId> <artifactId>mariadb-java-client</artifactId>
<version>1.2.3</version> <version>${mariadb-java-client.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>