Remove unlimited collections from the repository API (#496)
* Started to get rid of unlimited collections Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Align API usage. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * fix compile issues. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix tests. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Remove comments Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Performance optimizations. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Remove dead code. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Allign method names Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Wait until the action update event is processed Conflicts: hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/integration/AmqpMessageHandlerServiceIntegrationTest.java Signed-off-by: SirWayne <dennis.melzer@bosch-si.com> * Started new tag APIs Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Quotas into central interface. Tag tests added. Event names fixed. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Simplified consumer run for every tenant. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * remove unused fields. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Alligned beans. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Deprecated client methods for old resources. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix new foreach method. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix transaction for foreach. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Extended DS creating to handle larger volumes. Fix on Readme. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fixed simulator bug and cleaned up tests. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix in sorting. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Remove configuration processor. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix wrong usage of sanitize. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Missing brackets. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix README API compatability. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix misinterpretation of pessimistic locking exceptions. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix stability sentence. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Code cleanup. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fixed page calculation Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
package org.eclipse.hawkbit.repository;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@@ -24,7 +24,6 @@ import org.eclipse.hawkbit.repository.model.Action;
|
||||
import org.eclipse.hawkbit.repository.model.Action.ActionType;
|
||||
import org.eclipse.hawkbit.repository.model.Action.Status;
|
||||
import org.eclipse.hawkbit.repository.model.ActionStatus;
|
||||
import org.eclipse.hawkbit.repository.model.ActionWithStatusCount;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetAssignmentResult;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
||||
@@ -71,6 +70,7 @@ public interface DeploymentManagement {
|
||||
DistributionSetAssignmentResult assignDistributionSet(@NotNull Long dsID, @NotNull ActionType actionType,
|
||||
long forcedTimestamp, @NotEmpty Collection<String> controllerIDs);
|
||||
|
||||
|
||||
/**
|
||||
* method assigns the {@link DistributionSet} to all {@link Target}s by
|
||||
* their IDs with a specific {@link ActionType} and {@code forcetime}.
|
||||
@@ -274,22 +274,6 @@ public interface DeploymentManagement {
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
|
||||
Page<ActionStatus> findActionStatusByAction(@NotNull Pageable pageReq, @NotNull Long actionId);
|
||||
|
||||
/**
|
||||
* Retrieves all {@link ActionStatus} inclusive their messages by a specific
|
||||
* {@link Action}.
|
||||
*
|
||||
* @param pageable
|
||||
* the page request parameter for paging and sorting the result
|
||||
* @param actionId
|
||||
* the {@link Action} to retrieve the {@link ActionStatus} from
|
||||
* @return a page of {@link ActionStatus} by a speciifc {@link Action}
|
||||
*
|
||||
* @throws EntityNotFoundException
|
||||
* if action with given ID does not exist
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
|
||||
Page<ActionStatus> findActionStatusByActionWithMessages(@NotNull Pageable pageable, @NotNull Long actionId);
|
||||
|
||||
/**
|
||||
* Retrieves all messages for an {@link ActionStatus}.
|
||||
*
|
||||
@@ -303,20 +287,6 @@ public interface DeploymentManagement {
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
|
||||
Page<String> findMessagesByActionStatusId(@NotNull Pageable pageable, @NotNull Long actionStatusId);
|
||||
|
||||
/**
|
||||
* Retrieves all {@link Action}s of a specific target ordered by action ID.
|
||||
*
|
||||
* @param controllerId
|
||||
* the target associated with the actions
|
||||
* @return a list of actions associated with the given target ordered by
|
||||
* action ID
|
||||
*
|
||||
* @throws EntityNotFoundException
|
||||
* if target with given ID does not exist
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
|
||||
List<ActionWithStatusCount> findActionsWithStatusCountByTargetOrderByIdDesc(@NotNull String controllerId);
|
||||
|
||||
/**
|
||||
* Get the {@link Action} entity for given actionId with all lazy attributes
|
||||
* (i.e. distributionSet, target, target.assignedDs).
|
||||
@@ -331,7 +301,9 @@ public interface DeploymentManagement {
|
||||
/**
|
||||
* Retrieves all active {@link Action}s of a specific target ordered by
|
||||
* action ID.
|
||||
*
|
||||
*
|
||||
* @param pageable
|
||||
* the page request parameter for paging and sorting the result
|
||||
* @param controllerId
|
||||
* the target associated with the actions
|
||||
* @return a list of actions associated with the given target
|
||||
@@ -340,12 +312,14 @@ public interface DeploymentManagement {
|
||||
* if target with given ID does not exist
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
|
||||
List<Action> findActiveActionsByTarget(@NotEmpty String controllerId);
|
||||
Page<Action> findActiveActionsByTarget(@NotNull Pageable pageable, @NotEmpty String controllerId);
|
||||
|
||||
/**
|
||||
* Retrieves all inactive {@link Action}s of a specific target ordered by
|
||||
* action ID.
|
||||
*
|
||||
* @param pageable
|
||||
* the page request parameter for paging and sorting the result
|
||||
* @param controllerId
|
||||
* the target associated with the actions
|
||||
* @return a list of actions associated with the given target
|
||||
@@ -354,7 +328,7 @@ public interface DeploymentManagement {
|
||||
* if target with given ID does not exist
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
|
||||
List<Action> findInActiveActionsByTarget(@NotEmpty String controllerId);
|
||||
Page<Action> findInActiveActionsByTarget(@NotNull Pageable pageable, @NotEmpty String controllerId);
|
||||
|
||||
/**
|
||||
* Force cancels given {@link Action} for given {@link Target}. Force
|
||||
|
||||
@@ -363,17 +363,6 @@ public interface DistributionSetManagement {
|
||||
Page<DistributionSetMetadata> findDistributionSetMetadataByDistributionSetId(@NotNull Long distributionSetId,
|
||||
@NotNull String rsqlParam, @NotNull Pageable pageable);
|
||||
|
||||
/**
|
||||
* Retrieves {@link DistributionSet} List for overview purposes (no
|
||||
* {@link SoftwareModule}s and {@link DistributionSetTag}s).
|
||||
*
|
||||
* @param dist
|
||||
* List of {@link DistributionSet} IDs to be found
|
||||
* @return the found {@link DistributionSet}s
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
|
||||
List<DistributionSet> findDistributionSetsAll(Collection<Long> dist);
|
||||
|
||||
/**
|
||||
* finds all {@link DistributionSet}s.
|
||||
*
|
||||
@@ -420,6 +409,21 @@ public interface DistributionSetManagement {
|
||||
Page<DistributionSet> findDistributionSetsAll(@NotNull String rsqlParam, @NotNull Pageable pageReq,
|
||||
Boolean deleted);
|
||||
|
||||
/**
|
||||
* finds all {@link DistributionSet}s.
|
||||
*
|
||||
* @param pageReq
|
||||
* the pagination parameter
|
||||
* @param deleted
|
||||
* if TRUE, {@link DistributionSet}s marked as deleted are
|
||||
* returned. If FALSE, on {@link DistributionSet}s not marked as
|
||||
* deleted are returned. <code>null</code> if both are to be
|
||||
* returned
|
||||
* @return all found {@link DistributionSet}s
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
|
||||
Page<DistributionSet> findDistributionSetsAll(@NotNull Pageable pageReq, Boolean deleted);
|
||||
|
||||
/**
|
||||
* method retrieves all {@link DistributionSet}s from the repository in the
|
||||
* following order:
|
||||
@@ -458,6 +462,45 @@ public interface DistributionSetManagement {
|
||||
Page<DistributionSet> findDistributionSetsByFilters(@NotNull Pageable pageable,
|
||||
@NotNull DistributionSetFilter distributionSetFilter);
|
||||
|
||||
/**
|
||||
* retrieves {@link DistributionSet}s by filtering on the given parameters.
|
||||
*
|
||||
* @param pageable
|
||||
* page parameter
|
||||
* @param tagId
|
||||
* of the tag the DS are assigned to
|
||||
* @return the page of found {@link DistributionSet}
|
||||
*
|
||||
* @throws RSQLParameterUnsupportedFieldException
|
||||
* if a field in the RSQL string is used but not provided by the
|
||||
* given {@code fieldNameProvider}
|
||||
* @throws RSQLParameterSyntaxException
|
||||
* if the RSQL syntax is wrong
|
||||
*
|
||||
* @throws EntityNotFoundException
|
||||
* of distribution set tag with given ID does not exist
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
|
||||
Page<DistributionSet> findDistributionSetsByTag(@NotNull final Pageable pageable, @NotNull final Long tagId);
|
||||
|
||||
/**
|
||||
* retrieves {@link DistributionSet}s by filtering on the given parameters.
|
||||
*
|
||||
* @param pageable
|
||||
* page parameter
|
||||
* @param rsqlParam
|
||||
* rsql query string
|
||||
* @param tagId
|
||||
* of the tag the DS are assigned to
|
||||
* @return the page of found {@link DistributionSet}
|
||||
*
|
||||
* @throws EntityNotFoundException
|
||||
* of distribution set tag with given ID does not exist
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
|
||||
Page<DistributionSet> findDistributionSetsByTag(@NotNull final Pageable pageable, @NotNull String rsqlParam,
|
||||
@NotNull final Long tagId);
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* as {@link DistributionSetType#getId()}
|
||||
@@ -556,20 +599,6 @@ public interface DistributionSetManagement {
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
|
||||
DistributionSetTagAssignmentResult toggleTagAssignment(@NotEmpty Collection<Long> dsIds, @NotNull String tagName);
|
||||
|
||||
/**
|
||||
* Unassign all {@link DistributionSet} from a given
|
||||
* {@link DistributionSetTag} .
|
||||
*
|
||||
* @param tagId
|
||||
* to unassign all ds
|
||||
* @return list of unassigned ds
|
||||
*
|
||||
* @throws EntityNotFoundException
|
||||
* if tag with given ID does not exist
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
|
||||
List<DistributionSet> unAssignAllDistributionSetsByTag(@NotNull Long tagId);
|
||||
|
||||
/**
|
||||
* Unassigns a {@link SoftwareModule} form an existing
|
||||
* {@link DistributionSet}.
|
||||
@@ -731,6 +760,6 @@ public interface DistributionSetManagement {
|
||||
* @return the found {@link DistributionSet}s
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
|
||||
List<DistributionSet> findDistributionSetAllById(@NotEmpty Collection<Long> ids);
|
||||
List<DistributionSet> findDistributionSetsById(@NotEmpty Collection<Long> ids);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.Action;
|
||||
import org.eclipse.hawkbit.repository.model.ActionStatus;
|
||||
import org.eclipse.hawkbit.repository.model.Rollout;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup;
|
||||
|
||||
/**
|
||||
* Central service for defined limits of the repository.
|
||||
*
|
||||
*/
|
||||
public interface QuotaManagement {
|
||||
|
||||
/**
|
||||
* @return Maximum number of {@link ActionStatus} entries that the
|
||||
* controller can report for an {@link Action}.
|
||||
*/
|
||||
int getMaxStatusEntriesPerAction();
|
||||
|
||||
/**
|
||||
* @return maximum number of attributes that the controller can report;
|
||||
*/
|
||||
int getMaxAttributeEntriesPerTarget();
|
||||
|
||||
/**
|
||||
* @return maximum number of allowed {@link RolloutGroup}s per
|
||||
* {@link Rollout}.
|
||||
*/
|
||||
int getMaxRolloutGroupsPerRollout();
|
||||
|
||||
}
|
||||
@@ -82,7 +82,7 @@ public interface RolloutGroupManagement {
|
||||
* Retrieves a page of {@link RolloutGroup}s filtered by a given
|
||||
* {@link Rollout} and the an rsql filter.
|
||||
*
|
||||
* @param rollout
|
||||
* @param rolloutId
|
||||
* the rollout to filter the {@link RolloutGroup}s
|
||||
* @param rsqlParam
|
||||
* the specification to filter the result set based on attributes
|
||||
@@ -98,7 +98,7 @@ public interface RolloutGroupManagement {
|
||||
* if the RSQL syntax is wrong
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
|
||||
Page<RolloutGroup> findRolloutGroupsAll(@NotNull Long rollout, @NotNull String rsqlParam,
|
||||
Page<RolloutGroup> findRolloutGroupsAll(@NotNull Long rolloutId, @NotNull String rsqlParam,
|
||||
@NotNull Pageable pageable);
|
||||
|
||||
/**
|
||||
@@ -114,6 +114,19 @@ public interface RolloutGroupManagement {
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
|
||||
Page<RolloutGroup> findRolloutGroupsByRolloutId(@NotNull Long rolloutId, @NotNull Pageable pageable);
|
||||
|
||||
/**
|
||||
* Retrieves a page of {@link RolloutGroup}s filtered by a given
|
||||
* {@link Rollout}.
|
||||
*
|
||||
* @param rolloutId
|
||||
* the ID of the rollout to filter the {@link RolloutGroup}s
|
||||
* @param pageable
|
||||
* the page request to sort and limit the result
|
||||
* @return a page of found {@link RolloutGroup}s
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
|
||||
long countRolloutGroupsByRolloutId(@NotNull Long rolloutId);
|
||||
|
||||
/**
|
||||
* Get targets of specified rollout group.
|
||||
*
|
||||
|
||||
@@ -334,6 +334,23 @@ public interface SoftwareManagement {
|
||||
Page<SoftwareModuleMetadata> findSoftwareModuleMetadataBySoftwareModuleId(@NotNull Long moduleId,
|
||||
@NotNull String rsqlParam, @NotNull Pageable pageable);
|
||||
|
||||
/**
|
||||
* Finds all meta data by the given software module id.
|
||||
*
|
||||
* @param pageable
|
||||
* pagination parameter
|
||||
*
|
||||
* @param moduleId
|
||||
* the software module id to retrieve the meta data from
|
||||
* @return page with found software module metadata
|
||||
*
|
||||
* @throws EntityNotFoundException
|
||||
* of software module with given ID does not exist
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
|
||||
Page<SoftwareModuleMetadata> findSoftwareModuleMetadataBySoftwareModuleId(@NotNull Pageable pageable,
|
||||
@NotNull Long moduleId);
|
||||
|
||||
/**
|
||||
* Filter {@link SoftwareModule}s with given
|
||||
* {@link SoftwareModule#getName()} or {@link SoftwareModule#getVersion()}
|
||||
@@ -522,25 +539,4 @@ public interface SoftwareManagement {
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
|
||||
SoftwareModuleType updateSoftwareModuleType(@NotNull SoftwareModuleTypeUpdate update);
|
||||
|
||||
/**
|
||||
* Finds all meta data by the given software module id.
|
||||
*
|
||||
* @param moduleId
|
||||
* the software module id to retrieve the meta data from
|
||||
*
|
||||
*
|
||||
* @throws RSQLParameterUnsupportedFieldException
|
||||
* if a field in the RSQL string is used but not provided by the
|
||||
* given {@code fieldNameProvider}
|
||||
* @throws RSQLParameterSyntaxException
|
||||
* if the RSQL syntax is wrong
|
||||
* @return result of all meta data entries for a given software module id.
|
||||
*
|
||||
* @throws EntityNotFoundException
|
||||
* of software module with given ID does not exist
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
|
||||
List<SoftwareModuleMetadata> findSoftwareModuleMetadataBySoftwareModuleId(@NotNull Long moduleId);
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@@ -18,6 +18,8 @@ import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
||||
import org.eclipse.hawkbit.repository.model.TenantMetaData;
|
||||
import org.eclipse.hawkbit.repository.report.model.SystemUsageReport;
|
||||
import org.eclipse.hawkbit.tenancy.TenantAware;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
||||
/**
|
||||
@@ -44,10 +46,22 @@ public interface SystemManagement {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param pageable
|
||||
* for paging information
|
||||
* @return list of all tenant names in the system.
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_SYSTEM_ADMIN)
|
||||
List<String> findTenants();
|
||||
Page<String> findTenants(@NotNull Pageable pageable);
|
||||
|
||||
/**
|
||||
* Runs consumer for each teant as
|
||||
* {@link TenantAware#runAsTenant(String, org.eclipse.hawkbit.tenancy.TenantAware.TenantRunner)}
|
||||
*
|
||||
* @param consumer
|
||||
* to run as teanant
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_SYSTEM_ADMIN)
|
||||
void forEachTenant(Consumer<String> consumer);
|
||||
|
||||
/**
|
||||
* Calculated system usage statistics, both overall for the entire system
|
||||
|
||||
@@ -122,13 +122,6 @@ public interface TagManagement {
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_DELETE_TARGET)
|
||||
void deleteTargetTag(@NotEmpty String targetTagName);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return all {@link DistributionSetTag}s
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
|
||||
List<DistributionSetTag> findAllDistributionSetTags();
|
||||
|
||||
/**
|
||||
* returns all {@link DistributionSetTag}s.
|
||||
*
|
||||
@@ -241,6 +234,22 @@ public interface TagManagement {
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
|
||||
Optional<TargetTag> findTargetTagById(@NotNull Long id);
|
||||
|
||||
/**
|
||||
* Finds all {@link TargetTag} assigned to given {@link Target}.
|
||||
*
|
||||
* @param pageable
|
||||
* information for page size, offset and sort order.
|
||||
*
|
||||
* @param setId
|
||||
* of the {@link DistributionSet}
|
||||
* @return page of the found {@link TargetTag}s
|
||||
*
|
||||
* @throws EntityNotFoundException
|
||||
* if {@link DistributionSet} with given ID does not exist
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
|
||||
Page<DistributionSetTag> findDistributionSetTagsByDistributionSet(@NotNull Pageable pageable, @NotNull Long setId);
|
||||
|
||||
/**
|
||||
* Updates an existing {@link DistributionSetTag}.
|
||||
*
|
||||
|
||||
@@ -339,7 +339,7 @@ public interface TargetManagement {
|
||||
* @return List of found{@link Target}s
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
|
||||
List<Target> findTargetByControllerID(@NotEmpty Collection<String> controllerIDs);
|
||||
List<Target> findTargetsByControllerID(@NotEmpty Collection<String> controllerIDs);
|
||||
|
||||
/**
|
||||
* Find a {@link Target} based a given ID.
|
||||
@@ -533,13 +533,41 @@ public interface TargetManagement {
|
||||
|
||||
/**
|
||||
* Find targets by tag name.
|
||||
*
|
||||
* @param tagName
|
||||
* tag name
|
||||
*
|
||||
* @param pageable
|
||||
* the page request parameter for paging and sorting the result
|
||||
* @param tagId
|
||||
* tag ID
|
||||
* @return list of matching targets
|
||||
*
|
||||
* @throws EntityNotFoundException
|
||||
* if target tag with given ID does not exist
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
|
||||
List<Target> findTargetsByTag(@NotEmpty String tagName);
|
||||
Page<Target> findTargetsByTag(@NotNull Pageable pageable, @NotNull Long tagId);
|
||||
|
||||
/**
|
||||
* Find targets by tag name.
|
||||
*
|
||||
* @param pageable
|
||||
* the page request parameter for paging and sorting the result
|
||||
* @param tagId
|
||||
* tag ID
|
||||
* @param rsqlParam
|
||||
* in RSQL notation
|
||||
*
|
||||
* @return list of matching targets
|
||||
*
|
||||
* @throws EntityNotFoundException
|
||||
* if target tag with given ID does not exist
|
||||
* @throws RSQLParameterUnsupportedFieldException
|
||||
* if a field in the RSQL string is used but not provided by the
|
||||
* given {@code fieldNameProvider}
|
||||
* @throws RSQLParameterSyntaxException
|
||||
* if the RSQL syntax is wrong
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
|
||||
Page<Target> findTargetsByTag(@NotNull Pageable pageable, @NotNull String rsqlParam, @NotNull Long tagId);
|
||||
|
||||
/**
|
||||
* Toggles {@link TargetTag} assignment to given {@link Target}s by means
|
||||
@@ -559,19 +587,6 @@ public interface TargetManagement {
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
|
||||
TargetTagAssignmentResult toggleTagAssignment(@NotEmpty Collection<String> controllerIds, @NotEmpty String tagName);
|
||||
|
||||
/**
|
||||
* Un-assign all {@link Target} from a given {@link TargetTag} .
|
||||
*
|
||||
* @param targetTagId
|
||||
* to un-assign all targets
|
||||
* @return list of unassigned targets
|
||||
*
|
||||
* @throws EntityNotFoundException
|
||||
* if TAG with given ID does not exist
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
|
||||
List<Target> unAssignAllTargetsByTag(@NotNull Long targetTagId);
|
||||
|
||||
/**
|
||||
* Un-assign a {@link TargetTag} assignment to given {@link Target}.
|
||||
*
|
||||
@@ -623,7 +638,7 @@ public interface TargetManagement {
|
||||
* @return the found {@link Target}s
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
|
||||
List<Target> findTargetAllById(@NotNull Collection<Long> ids);
|
||||
List<Target> findTargetsById(@NotNull Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* Get controller attributes of given {@link Target}.
|
||||
|
||||
@@ -14,14 +14,14 @@ import org.eclipse.hawkbit.repository.model.DistributionSetTag;
|
||||
* Defines the remote event for update a {@link DistributionSetTag}.
|
||||
*
|
||||
*/
|
||||
public class DistributionSetTagUpdateEvent extends RemoteEntityEvent<DistributionSetTag> {
|
||||
public class DistributionSetTagUpdatedEvent extends RemoteEntityEvent<DistributionSetTag> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public DistributionSetTagUpdateEvent() {
|
||||
public DistributionSetTagUpdatedEvent() {
|
||||
// for serialization libs like jackson
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class DistributionSetTagUpdateEvent extends RemoteEntityEvent<Distributio
|
||||
* @param applicationId
|
||||
* the applicationID
|
||||
*/
|
||||
public DistributionSetTagUpdateEvent(final DistributionSetTag tag, final String applicationId) {
|
||||
public DistributionSetTagUpdatedEvent(final DistributionSetTag tag, final String applicationId) {
|
||||
super(tag, applicationId);
|
||||
}
|
||||
}
|
||||
@@ -14,14 +14,14 @@ import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
* Defines the remote event for updating a {@link DistributionSet}.
|
||||
*
|
||||
*/
|
||||
public class DistributionSetUpdateEvent extends RemoteEntityEvent<DistributionSet> {
|
||||
public class DistributionSetUpdatedEvent extends RemoteEntityEvent<DistributionSet> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public DistributionSetUpdateEvent() {
|
||||
public DistributionSetUpdatedEvent() {
|
||||
// for serialization libs like jackson
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class DistributionSetUpdateEvent extends RemoteEntityEvent<DistributionSe
|
||||
* @param applicationId
|
||||
* the origin application id
|
||||
*/
|
||||
public DistributionSetUpdateEvent(final DistributionSet ds, final String applicationId) {
|
||||
public DistributionSetUpdatedEvent(final DistributionSet ds, final String applicationId) {
|
||||
super(ds, applicationId);
|
||||
}
|
||||
}
|
||||
@@ -14,14 +14,14 @@ import org.eclipse.hawkbit.repository.model.TargetTag;
|
||||
* Defines the remote event for updating a {@link TargetTag}.
|
||||
*
|
||||
*/
|
||||
public class TargetTagUpdateEvent extends RemoteEntityEvent<TargetTag> {
|
||||
public class TargetTagUpdatedEvent extends RemoteEntityEvent<TargetTag> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public TargetTagUpdateEvent() {
|
||||
public TargetTagUpdatedEvent() {
|
||||
// for serialization libs like jackson
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class TargetTagUpdateEvent extends RemoteEntityEvent<TargetTag> {
|
||||
* @param applicationId
|
||||
* the origin application id
|
||||
*/
|
||||
public TargetTagUpdateEvent(final TargetTag tag, final String applicationId) {
|
||||
public TargetTagUpdatedEvent(final TargetTag tag, final String applicationId) {
|
||||
super(tag, applicationId);
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.model;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
@@ -45,11 +44,6 @@ public interface Action extends TenantAwareBaseEntity {
|
||||
*/
|
||||
ActionType getActionType();
|
||||
|
||||
/**
|
||||
* @return list of {@link ActionStatus} entries.
|
||||
*/
|
||||
List<ActionStatus> getActionStatus();
|
||||
|
||||
/**
|
||||
* @return {@link Target} of this {@link Action}.
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.model;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.Action.Status;
|
||||
@@ -28,12 +27,6 @@ public interface ActionStatus extends TenantAwareBaseEntity {
|
||||
*/
|
||||
Long getOccurredAt();
|
||||
|
||||
/**
|
||||
* @return immutable list of message entries that in the
|
||||
* {@link ActionStatus}.
|
||||
*/
|
||||
List<String> getMessages();
|
||||
|
||||
/**
|
||||
* @return {@link Action} this {@link ActionStatus} belongs to.
|
||||
*/
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
/**
|
||||
* 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();
|
||||
|
||||
}
|
||||
@@ -24,11 +24,6 @@ import java.util.Set;
|
||||
*/
|
||||
public interface DistributionSet extends NamedVersionedEntity {
|
||||
|
||||
/**
|
||||
* @return immutable {@link Set} of assigned {@link DistributionSetTag}s.
|
||||
*/
|
||||
Set<DistributionSetTag> getTags();
|
||||
|
||||
/**
|
||||
* @return <code>true</code> if the set is deleted and only kept for history
|
||||
* purposes.
|
||||
|
||||
@@ -69,7 +69,7 @@ public class DistributionSetAssignmentResult extends AssignmentResult<Target> {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
return targetManagement.findTargetByControllerID(assignedTargets);
|
||||
return targetManagement.findTargetsByControllerID(assignedTargets);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,11 +15,7 @@ import java.util.Collection;
|
||||
*/
|
||||
public final class DistributionSetFilter {
|
||||
/**
|
||||
*
|
||||
* Distribution set filter builder.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public static class DistributionSetFilterBuilder {
|
||||
private Boolean isDeleted;
|
||||
@@ -81,6 +77,7 @@ public final class DistributionSetFilter {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private final Boolean isDeleted;
|
||||
private final Boolean isComplete;
|
||||
private final DistributionSetType type;
|
||||
|
||||
@@ -8,18 +8,10 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* {@link Tag} of a {@link DistributionSet}.
|
||||
*
|
||||
*/
|
||||
public interface DistributionSetTag extends Tag {
|
||||
|
||||
/**
|
||||
* @return immutable {@link List} of {@link DistributionSet}s this
|
||||
* {@link Tag} is assigned to.
|
||||
*/
|
||||
List<DistributionSet> getAssignedToDistributionSet();
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.model;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.Action.ActionType;
|
||||
@@ -37,11 +36,6 @@ public interface Rollout extends NamedEntity {
|
||||
*/
|
||||
DistributionSet getDistributionSet();
|
||||
|
||||
/**
|
||||
* @return immutable list of deployment groups of the rollout.
|
||||
*/
|
||||
List<RolloutGroup> getRolloutGroups();
|
||||
|
||||
/**
|
||||
* @return rsql query that identifies the targets that are part of this
|
||||
* rollout.
|
||||
|
||||
@@ -8,17 +8,10 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Target tag element.
|
||||
*
|
||||
*/
|
||||
public interface TargetTag extends Tag {
|
||||
|
||||
/**
|
||||
* @return immutable {@link List} of targets assigned to this {@link Tag}.
|
||||
*/
|
||||
List<Target> getAssignedToTargets();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user