Files
hawkbit/hawkbit-repository/hawkbit-repository-api
Avgustin Marinov e154e1b18a [#2429] Add completeness property for software modules (#2765)
* add `min artifacts` requirement on the Software Module Type level for Software Module completeness
* removed `complete` Distribution Set property from DB - calculated runtime
* Distribution Set and Software Module completeness is calcualted on demand in memory (TODO: implement cache)
* locking of Software Module now requires the software module to be `completed`
* removed 'complete' search field for DistributionSet type. Still keep (DEPRECATED) limited support for search with 'complete' -
  only on the first level of expression and with AND. I.e. complete==true, complete==false and id=in=(1, 3) is suppoted,
  while complete==false or id=in=(1, 3) and id=in(1, 3) and (type==os and complete==true) are not

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-10-22 09:57:45 +03:00
..

hawkBit repository API

API for repository access. Contains:

  • Entity Model
  • Management service API

Method naming concept (example target management)

// Count all targets
Long count()

// Count by filter parameter (example)
Long countByTargetFilterQuery(@NotEmpty String targetFilterQuery);

//Create entity
List<Target> create(@NotEmpty Collection<TargetCreate> create)
Target create(@NotNull TargetCreate create)

//Delete entities (throws EntityNotFoundException if one element does not exist (at least one not found in collection case))
void delete(@NotEmpty Collection<Long> targetIDs);
void delete(@NotNull Long targetID);
void deleteByControllerId(@NotEmpty String controllerId);
void deleteByControllerId(@NotEmpty Collection<String> controllerId);

//Update Target (throws EntityNotFoundException if one element does not exist (at least one not found in collection case))
List<Target> update(@NotEmpty Collection<TargetUpdate> update);
Target update(@NotNull TargetUpdate update);

//Exist
boolean exists(@NotNull Long targetId)
boolean existsByAssignedDistributionSet(@NotNull Long distributionSetID);

// Read methods
// Find one on technical ID (Optional, no EntityNotFoundException)
Optional<Target> get(@NotNull Long targetId);
List<Target> get(@NotEmpty Collection<Long> targetId);

// Find one on non-ID but unique constraint (Optional, no EntityNotFoundException)
Optional<Target> getByControllerID(@NotEmpty String controllerId);
List<Target> getByControllerID(@NotEmpty Collection<String> controllerId);

// Find one on non-ID but and non unique constraint (Optional, no EntityNotFoundException)
Optional<Target> findFirstByDescription(@NotEmpty String description);

// Query/search repository (page might be empty, no EntityNotFoundException) (note: pageReq always first in signature)
Page<Target> findByAssignedDistributionSet(@NotNull Long distributionSetID, @NotNull Pageable pageable);