Split into separate maven modules.
Signed-off-by: Kai Zimmermann <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.hawkbit</groupId>
|
||||
<artifactId>hawkbit-repository</artifactId>
|
||||
<artifactId>hawkbit-repository-jpa</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.hawkbit</groupId>
|
||||
<artifactId>hawkbit-repository</artifactId>
|
||||
<artifactId>hawkbit-repository-jpa</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -93,7 +93,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.hawkbit</groupId>
|
||||
<artifactId>hawkbit-repository</artifactId>
|
||||
<artifactId>hawkbit-repository-jpa</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.hawkbit</groupId>
|
||||
<artifactId>hawkbit-repository</artifactId>
|
||||
<artifactId>hawkbit-repository-jpa</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -90,7 +90,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.hawkbit</groupId>
|
||||
<artifactId>hawkbit-repository</artifactId>
|
||||
<artifactId>hawkbit-repository-jpa</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
</dependency>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.hawkbit</groupId>
|
||||
<artifactId>hawkbit-repository</artifactId>
|
||||
<artifactId>hawkbit-repository-jpa</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.hawkbit</groupId>
|
||||
<artifactId>hawkbit-repository</artifactId>
|
||||
<artifactId>hawkbit-repository-jpa</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -92,7 +92,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.hawkbit</groupId>
|
||||
<artifactId>hawkbit-repository</artifactId>
|
||||
<artifactId>hawkbit-repository-jpa</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
|
||||
@@ -32,9 +32,8 @@ import org.eclipse.hawkbit.repository.OffsetBasedPageRequest;
|
||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||
import org.eclipse.hawkbit.repository.SystemManagement;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.TargetWithActionType;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||
import org.eclipse.hawkbit.repository.jpa.TargetWithActionType;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.DsMetadataCompositeKey;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetMetadata;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
@@ -94,7 +93,8 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi {
|
||||
if (rsqlParam != null) {
|
||||
findDsPage = this.distributionSetManagement.findDistributionSetsAll(rsqlParam, pageable, false);
|
||||
} else {
|
||||
findDsPage = this.distributionSetManagement.findDistributionSetsByDeletedAndOrCompleted(pageable, false, null);
|
||||
findDsPage = this.distributionSetManagement.findDistributionSetsByDeletedAndOrCompleted(pageable, false,
|
||||
null);
|
||||
}
|
||||
|
||||
final List<MgmtDistributionSet> rest = MgmtDistributionSetMapper.toResponseFromDsList(findDsPage.getContent());
|
||||
@@ -273,8 +273,7 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi {
|
||||
// check if distribution set exists otherwise throw exception
|
||||
// immediately
|
||||
final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId);
|
||||
final DistributionSetMetadata findOne = this.distributionSetManagement
|
||||
.findOne(new DsMetadataCompositeKey(ds, metadataKey));
|
||||
final DistributionSetMetadata findOne = this.distributionSetManagement.findOne(ds, metadataKey);
|
||||
return ResponseEntity.<MgmtMetadata> ok(MgmtDistributionSetMapper.toResponseDsMetadata(findOne));
|
||||
}
|
||||
|
||||
@@ -295,7 +294,7 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi {
|
||||
// check if distribution set exists otherwise throw exception
|
||||
// immediately
|
||||
final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId);
|
||||
this.distributionSetManagement.deleteDistributionSetMetadata(new DsMetadataCompositeKey(ds, metadataKey));
|
||||
this.distributionSetManagement.deleteDistributionSetMetadata(ds, metadataKey);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import org.eclipse.hawkbit.repository.ArtifactManagement;
|
||||
import org.eclipse.hawkbit.repository.OffsetBasedPageRequest;
|
||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.SwMetadataCompositeKey;
|
||||
import org.eclipse.hawkbit.repository.model.Artifact;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleMetadata;
|
||||
@@ -246,7 +245,7 @@ public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestApi {
|
||||
public ResponseEntity<Void> deleteMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId,
|
||||
@PathVariable("metadataKey") final String metadataKey) {
|
||||
final SoftwareModule sw = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null);
|
||||
softwareManagement.deleteSoftwareModuleMetadata(new SwMetadataCompositeKey(sw, metadataKey));
|
||||
softwareManagement.deleteSoftwareModuleMetadata(sw, metadataKey);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ import org.eclipse.hawkbit.TestDataUtil;
|
||||
import org.eclipse.hawkbit.WithUser;
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.DsMetadataCompositeKey;
|
||||
import org.eclipse.hawkbit.repository.model.Action.Status;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetMetadata;
|
||||
@@ -685,10 +684,8 @@ public class MgmtDistributionSetResourceTest extends AbstractRestIntegrationTest
|
||||
.andExpect(jsonPath("[1]key", equalTo(knownKey2)))
|
||||
.andExpect(jsonPath("[1]value", equalTo(knownValue2)));
|
||||
|
||||
final DistributionSetMetadata metaKey1 = distributionSetManagement
|
||||
.findOne(new DsMetadataCompositeKey(testDS, knownKey1));
|
||||
final DistributionSetMetadata metaKey2 = distributionSetManagement
|
||||
.findOne(new DsMetadataCompositeKey(testDS, knownKey2));
|
||||
final DistributionSetMetadata metaKey1 = distributionSetManagement.findOne(testDS, knownKey1);
|
||||
final DistributionSetMetadata metaKey2 = distributionSetManagement.findOne(testDS, knownKey2);
|
||||
|
||||
assertThat(metaKey1.getValue()).isEqualTo(knownValue1);
|
||||
assertThat(metaKey2.getValue()).isEqualTo(knownValue2);
|
||||
@@ -715,8 +712,7 @@ public class MgmtDistributionSetResourceTest extends AbstractRestIntegrationTest
|
||||
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
|
||||
.andExpect(jsonPath("key", equalTo(knownKey))).andExpect(jsonPath("value", equalTo(updateValue)));
|
||||
|
||||
final DistributionSetMetadata assertDS = distributionSetManagement
|
||||
.findOne(new DsMetadataCompositeKey(testDS, knownKey));
|
||||
final DistributionSetMetadata assertDS = distributionSetManagement.findOne(testDS, knownKey);
|
||||
assertThat(assertDS.getValue()).isEqualTo(updateValue);
|
||||
|
||||
}
|
||||
@@ -737,7 +733,7 @@ public class MgmtDistributionSetResourceTest extends AbstractRestIntegrationTest
|
||||
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk());
|
||||
|
||||
try {
|
||||
distributionSetManagement.findOne(new DsMetadataCompositeKey(testDS, knownKey));
|
||||
distributionSetManagement.findOne(testDS, knownKey);
|
||||
fail("expected EntityNotFoundException but didn't throw");
|
||||
} catch (final EntityNotFoundException e) {
|
||||
// ok as expected
|
||||
|
||||
40
hawkbit-repository/hawkbit-repository-api/pom.xml
Normal file
40
hawkbit-repository/hawkbit-repository-api/pom.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<!--
|
||||
|
||||
Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License v1.0
|
||||
which accompanies this distribution, and is available at
|
||||
http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.eclipse.hawkbit</groupId>
|
||||
<artifactId>hawkbit-repository</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>hawkbit-repository-api</artifactId>
|
||||
<name>hawkBit :: Repository API</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.hawkbit</groupId>
|
||||
<artifactId>hawkbit-security-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.hateoas</groupId>
|
||||
<artifactId>spring-hateoas</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -16,7 +16,6 @@ import javax.validation.constraints.NotNull;
|
||||
import org.eclipse.hawkbit.im.authentication.SpPermission.SpringEvalExpressions;
|
||||
import org.eclipse.hawkbit.repository.exception.CancelActionNotAllowedException;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||
import org.eclipse.hawkbit.repository.jpa.TargetWithActionType;
|
||||
import org.eclipse.hawkbit.repository.model.Action;
|
||||
import org.eclipse.hawkbit.repository.model.Action.ActionType;
|
||||
import org.eclipse.hawkbit.repository.model.ActionStatus;
|
||||
@@ -101,8 +100,6 @@ public interface DeploymentManagement {
|
||||
DistributionSetAssignmentResult assignDistributionSet(@NotNull Long dsID,
|
||||
@NotEmpty Collection<TargetWithActionType> targets);
|
||||
|
||||
// TODO document: why are rollouts in the signature ? can all the parameters
|
||||
// be null or the list empty?
|
||||
/**
|
||||
* method assigns the {@link DistributionSet} to all {@link Target}s by
|
||||
* their IDs with a specific {@link ActionType} and {@code forcetime}.
|
||||
@@ -190,7 +187,6 @@ public interface DeploymentManagement {
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
|
||||
Long countActionsByTarget(@NotNull Target target);
|
||||
|
||||
// TODO: validate parameters
|
||||
/**
|
||||
* Creates an action entry into the action repository. In case of existing
|
||||
* scheduled actions the scheduled actions gets canceled. A scheduled action
|
||||
@@ -210,8 +206,9 @@ public interface DeploymentManagement {
|
||||
* the roll out group for this action
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
|
||||
void createScheduledAction(Collection<Target> targets, DistributionSet distributionSet, ActionType actionType,
|
||||
long forcedTime, Rollout rollout, RolloutGroup rolloutGroup);
|
||||
void createScheduledAction(@NotEmpty Collection<Target> targets, @NotNull DistributionSet distributionSet,
|
||||
@NotNull ActionType actionType, Long forcedTime, @NotNull Rollout rollout,
|
||||
@NotNull RolloutGroup rolloutGroup);
|
||||
|
||||
/**
|
||||
* Get the {@link Action} entity for given actionId.
|
||||
@@ -12,7 +12,6 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.eclipse.hawkbit.im.authentication.SpPermission.SpringEvalExpressions;
|
||||
@@ -21,8 +20,6 @@ import org.eclipse.hawkbit.repository.exception.DistributionSetCreationFailedMis
|
||||
import org.eclipse.hawkbit.repository.exception.EntityAlreadyExistsException;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityReadOnlyException;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.DistributionSetTypeElement;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.DsMetadataCompositeKey;
|
||||
import org.eclipse.hawkbit.repository.model.Action;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetMetadata;
|
||||
@@ -37,8 +34,6 @@ import org.hibernate.validator.constraints.NotEmpty;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Isolation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* Management service for {@link DistributionSet}s.
|
||||
@@ -176,7 +171,6 @@ public interface DistributionSetManagement {
|
||||
* @return created {@link Entity}
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_CREATE_REPOSITORY)
|
||||
@Transactional(isolation = Isolation.READ_UNCOMMITTED)
|
||||
List<DistributionSetType> createDistributionSetTypes(@NotNull Collection<DistributionSetType> types);
|
||||
|
||||
/**
|
||||
@@ -215,7 +209,7 @@ public interface DistributionSetManagement {
|
||||
* the ID of the distribution set meta data to delete
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
|
||||
void deleteDistributionSetMetadata(@NotNull DsMetadataCompositeKey id);
|
||||
void deleteDistributionSetMetadata(@NotNull final DistributionSet distributionSet, @NotNull final String key);
|
||||
|
||||
/**
|
||||
* Deletes or mark as delete in case the type is in use.
|
||||
@@ -456,7 +450,7 @@ public interface DistributionSetManagement {
|
||||
* in case the meta data does not exists for the given key
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
|
||||
DistributionSetMetadata findOne(@NotNull DsMetadataCompositeKey id);
|
||||
DistributionSetMetadata findOne(@NotNull DistributionSet distributionSet, @NotNull String key);
|
||||
|
||||
/**
|
||||
* Generates an empty {@link DistributionSet} without persisting it.
|
||||
@@ -67,6 +67,10 @@ public interface ReportManagement {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final PerMonth PER_MONTH = new PerMonth();
|
||||
|
||||
private DateTypes() {
|
||||
// Utility class
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PerMonth
|
||||
*/
|
||||
@@ -74,9 +78,6 @@ public interface ReportManagement {
|
||||
return PER_MONTH;
|
||||
}
|
||||
|
||||
private DateTypes() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -18,7 +18,6 @@ import org.eclipse.hawkbit.repository.model.TargetWithActionStatus;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
||||
/**
|
||||
@@ -40,7 +39,6 @@ public interface RolloutGroupManagement {
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
|
||||
Page<RolloutGroup> findAllRolloutGroupsWithDetailedStatus(@NotNull Long rolloutId, @NotNull Pageable pageable);
|
||||
|
||||
// TODO discuss: target read perm missing?
|
||||
/**
|
||||
*
|
||||
* Find all targets with action status by rollout group id. The action
|
||||
@@ -55,7 +53,7 @@ public interface RolloutGroupManagement {
|
||||
* rollout group
|
||||
* @return {@link TargetWithActionStatus} target with action status
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ_AND_TARGET_READ)
|
||||
Page<TargetWithActionStatus> findAllTargetsWithActionStatus(@NotNull PageRequest pageRequest,
|
||||
@NotNull RolloutGroup rolloutGroup);
|
||||
|
||||
@@ -100,7 +98,6 @@ public interface RolloutGroupManagement {
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
|
||||
Page<RolloutGroup> findRolloutGroupsByRolloutId(@NotNull Long rolloutId, @NotNull Pageable pageable);
|
||||
|
||||
// TODO discuss: target read perm missing?
|
||||
/**
|
||||
* Get targets of specified rollout group.
|
||||
*
|
||||
@@ -111,10 +108,9 @@ public interface RolloutGroupManagement {
|
||||
*
|
||||
* @return Page<Target> list of targets of a rollout group
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ_AND_TARGET_READ)
|
||||
Page<Target> findRolloutGroupTargets(@NotNull RolloutGroup rolloutGroup, @NotNull Pageable page);
|
||||
|
||||
// TODO discuss: target read perm missing?
|
||||
/**
|
||||
* Get targets of specified rollout group.
|
||||
*
|
||||
@@ -127,7 +123,7 @@ public interface RolloutGroupManagement {
|
||||
*
|
||||
* @return Page<Target> list of targets of a rollout group
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ_AND_TARGET_READ)
|
||||
Page<Target> findRolloutGroupTargets(@NotNull RolloutGroup rolloutGroup, @NotNull String rsqlParam,
|
||||
@NotNull Pageable pageable);
|
||||
|
||||
@@ -11,14 +11,12 @@ package org.eclipse.hawkbit.repository;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.eclipse.hawkbit.im.authentication.SpPermission.SpringEvalExpressions;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityAlreadyExistsException;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.SwMetadataCompositeKey;
|
||||
import org.eclipse.hawkbit.repository.model.CustomSoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.AssignedSoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleMetadata;
|
||||
@@ -159,7 +157,7 @@ public interface SoftwareManagement {
|
||||
* the ID of the software module meta data to delete
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
|
||||
void deleteSoftwareModuleMetadata(@NotNull SwMetadataCompositeKey id);
|
||||
void deleteSoftwareModuleMetadata(@NotNull SoftwareModule softwareModule, @NotNull String key);
|
||||
|
||||
/**
|
||||
* Deletes {@link SoftwareModule}s which is any if the given ids.
|
||||
@@ -312,7 +310,7 @@ public interface SoftwareManagement {
|
||||
* @return the page of found {@link SoftwareModule}
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
|
||||
Slice<CustomSoftwareModule> findSoftwareModuleOrderBySetAssignmentAndModuleNameAscModuleVersionAsc(
|
||||
Slice<AssignedSoftwareModule> findSoftwareModuleOrderBySetAssignmentAndModuleNameAscModuleVersionAsc(
|
||||
@NotNull Pageable pageable, @NotNull Long orderByDistributionId, String searchText,
|
||||
SoftwareModuleType type);
|
||||
|
||||
@@ -12,7 +12,6 @@ import java.net.URI;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.eclipse.hawkbit.im.authentication.SpPermission.SpringEvalExpressions;
|
||||
@@ -6,14 +6,14 @@
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.jpa;
|
||||
package org.eclipse.hawkbit.repository;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.Action;
|
||||
import org.eclipse.hawkbit.repository.model.Action.ActionType;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
|
||||
/**
|
||||
* A custom JPA database return value object with the proper constructor so JPA
|
||||
* is able to parse the result-set directly into this object.
|
||||
* A custom view on {@link Target} with {@link ActionType}.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -6,7 +6,7 @@
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.rsql;
|
||||
package org.eclipse.hawkbit.repository.exception;
|
||||
|
||||
import org.eclipse.hawkbit.exception.SpServerError;
|
||||
import org.eclipse.hawkbit.exception.SpServerRtException;
|
||||
@@ -6,7 +6,7 @@
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.rsql;
|
||||
package org.eclipse.hawkbit.repository.exception;
|
||||
|
||||
import org.eclipse.hawkbit.exception.SpServerError;
|
||||
import org.eclipse.hawkbit.exception.SpServerRtException;
|
||||
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.model;
|
||||
|
||||
/**
|
||||
* View for querying {@link Action} include the count of the action's
|
||||
* {@link ActionStatus} entries.
|
||||
*
|
||||
*/
|
||||
public interface ActionWithStatusCount {
|
||||
|
||||
/**
|
||||
* @return {@link Action}
|
||||
*/
|
||||
Action getAction();
|
||||
|
||||
/**
|
||||
* @return {@link DistributionSet} ID.
|
||||
*/
|
||||
Long getDsId();
|
||||
|
||||
/**
|
||||
* @return {@link DistributionSet} name.
|
||||
*/
|
||||
String getDsName();
|
||||
|
||||
/**
|
||||
* @return {@link DistributionSet} version.
|
||||
*/
|
||||
String getDsVersion();
|
||||
|
||||
/**
|
||||
* @return number of {@link ActionStatus} entries
|
||||
*/
|
||||
Long getActionStatusCount();
|
||||
|
||||
/**
|
||||
* @return name of the {@link Rollout}.
|
||||
*/
|
||||
String getRolloutName();
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import java.io.Serializable;
|
||||
* Use to display software modules for the selected distribution.
|
||||
*
|
||||
*/
|
||||
public class CustomSoftwareModule implements Serializable {
|
||||
public class AssignedSoftwareModule implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6144585781451168439L;
|
||||
|
||||
@@ -31,22 +31,28 @@ public class CustomSoftwareModule implements Serializable {
|
||||
* as true if the software module is assigned and false if not
|
||||
* assigned.
|
||||
*/
|
||||
public CustomSoftwareModule(final SoftwareModule softwareModule, final boolean assigned) {
|
||||
public AssignedSoftwareModule(final SoftwareModule softwareModule, final boolean assigned) {
|
||||
this.softwareModule = softwareModule;
|
||||
this.assigned = assigned;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link SoftwareModule}
|
||||
*/
|
||||
public SoftwareModule getSoftwareModule() {
|
||||
return softwareModule;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>true</code> if assigned
|
||||
*/
|
||||
public boolean isAssigned() {
|
||||
return assigned;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CustomSoftwareModule [softwareModule=" + softwareModule + ", assigned=" + assigned + "]";
|
||||
return "AssignedSoftwareModule [softwareModule=" + softwareModule + ", assigned=" + assigned + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -66,10 +72,10 @@ public class CustomSoftwareModule implements Serializable {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (!(obj instanceof CustomSoftwareModule)) {
|
||||
if (!(obj instanceof AssignedSoftwareModule)) {
|
||||
return false;
|
||||
}
|
||||
final CustomSoftwareModule other = (CustomSoftwareModule) obj;
|
||||
final AssignedSoftwareModule other = (AssignedSoftwareModule) obj;
|
||||
if (assigned != other.assigned) {
|
||||
return false;
|
||||
}
|
||||
@@ -19,7 +19,6 @@ public class AssignmentResult<T extends BaseEntity> {
|
||||
private final int total;
|
||||
private final int assigned;
|
||||
private final int alreadyAssigned;
|
||||
|
||||
private final int unassigned;
|
||||
private final List<T> assignedEntity;
|
||||
private final List<T> unassignedEntity;
|
||||
@@ -47,28 +46,45 @@ public class AssignmentResult<T extends BaseEntity> {
|
||||
this.assignedEntity = assignedEntity;
|
||||
this.unassignedEntity = unassignedEntity;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return number of newly assigned elements.
|
||||
*/
|
||||
public int getAssigned() {
|
||||
return assigned;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return total number (assigned and already assigned).
|
||||
*/
|
||||
public int getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return number of already assigned/ignored elements.
|
||||
*/
|
||||
public int getAlreadyAssigned() {
|
||||
return alreadyAssigned;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return number of unsassigned elements
|
||||
*/
|
||||
public int getUnassigned() {
|
||||
return unassigned;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link List} of assigned entity.
|
||||
*/
|
||||
public List<T> getAssignedEntity() {
|
||||
return assignedEntity;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return {@link List} of unassigned entity.
|
||||
*/
|
||||
public List<T> getUnassignedEntity() {
|
||||
return unassignedEntity;
|
||||
}
|
||||
@@ -10,8 +10,6 @@ package org.eclipse.hawkbit.repository.model;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.hawkbit.repository.jpa.model.DistributionSetTypeElement;
|
||||
|
||||
/**
|
||||
* A {@link DistributionSetType} is an abstract definition for
|
||||
* {@link DistributionSet} that defines what {@link SoftwareModule}s can be
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user