Code format hawkbit-repository-api (#1926)

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-11-05 09:32:03 +02:00
committed by GitHub
parent 71aa00ca7c
commit 67eb170f7c
243 changed files with 2256 additions and 3976 deletions

View File

@@ -9,7 +9,7 @@
SPDX-License-Identifier: EPL-2.0
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
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>

View File

@@ -17,7 +17,6 @@ import org.eclipse.hawkbit.repository.exception.ArtifactEncryptionFailedExceptio
/**
* Interface definition for artifact encryption.
*
*/
public interface ArtifactEncryption {
@@ -32,34 +31,27 @@ public interface ArtifactEncryption {
* Generates required secrets key/value pairs.
*
* @return secrets key/value pairs
* @throws ArtifactEncryptionFailedException
* thrown in case of an error while generating secrets
* @throws ArtifactEncryptionFailedException thrown in case of an error while generating secrets
*/
Map<String, String> generateSecrets();
/**
* Encrypts artifact stream with provided secrets.
*
* @param secrets
* secrets key/value pairs to be used for encryption
* @param stream
* artifact stream to encrypt
* @param secrets secrets key/value pairs to be used for encryption
* @param stream artifact stream to encrypt
* @return encrypted input stream
* @throws ArtifactEncryptionFailedException
* thrown in case of an error while encrypting the provided stream
* @throws ArtifactEncryptionFailedException thrown in case of an error while encrypting the provided stream
*/
InputStream encryptStream(final Map<String, String> secrets, final InputStream stream);
/**
* Decrypts encrypted artifact stream based on provided secrets.
*
* @param secrets
* secrets key/value pairs to be used for decryption
* @param stream
* artifact stream to decrypt
* @param secrets secrets key/value pairs to be used for decryption
* @param stream artifact stream to decrypt
* @return decrypted input stream
* @throws ArtifactEncryptionFailedException
* thrown in case of an error while decrypting the provided stream
* @throws ArtifactEncryptionFailedException thrown in case of an error while decrypting the provided stream
*/
InputStream decryptStream(final Map<String, String> secrets, final InputStream stream);

View File

@@ -15,7 +15,6 @@ import org.eclipse.hawkbit.repository.model.SoftwareModule;
/**
* Interface definition for artifact encryption secrets store.
*
*/
public interface ArtifactEncryptionSecretsStore {
@@ -23,12 +22,9 @@ public interface ArtifactEncryptionSecretsStore {
* Adds secret key/value pair associated with particular
* {@link SoftwareModule} id to the store.
*
* @param softwareModuleId
* {@link SoftwareModule} id associated with the secret
* @param secretKey
* key of the secret
* @param secretValue
* value of the secret
* @param softwareModuleId {@link SoftwareModule} id associated with the secret
* @param secretKey key of the secret
* @param secretValue value of the secret
*/
void addSecret(final long softwareModuleId, final String secretKey, final String secretValue);
@@ -36,10 +32,8 @@ public interface ArtifactEncryptionSecretsStore {
* Checks if secret is present for particular {@link SoftwareModule} id and
* key in the store.
*
* @param softwareModuleId
* {@link SoftwareModule} id associated with the secret
* @param secretKey
* key of the secret
* @param softwareModuleId {@link SoftwareModule} id associated with the secret
* @param secretKey key of the secret
*/
boolean secretExists(final long softwareModuleId, final String secretKey);
@@ -47,10 +41,8 @@ public interface ArtifactEncryptionSecretsStore {
* Retrieves secret value associated with particular {@link SoftwareModule}
* id and key from the store.
*
* @param softwareModuleId
* {@link SoftwareModule} id associated with the secret
* @param secretKey
* key of the secret
* @param softwareModuleId {@link SoftwareModule} id associated with the secret
* @param secretKey key of the secret
*/
Optional<String> getSecret(final long softwareModuleId, final String secretKey);
@@ -58,10 +50,8 @@ public interface ArtifactEncryptionSecretsStore {
* Removes secret key/value pair associated with particular
* {@link SoftwareModule} id from the store.
*
* @param softwareModuleId
* {@link SoftwareModule} id associated with the secret
* @param secretKey
* key of the secret
* @param softwareModuleId {@link SoftwareModule} id associated with the secret
* @param secretKey key of the secret
*/
void removeSecret(final long softwareModuleId, final String secretKey);
}

View File

@@ -20,7 +20,6 @@ import org.springframework.beans.factory.annotation.Autowired;
/**
* Service responsible for encryption operations.
*
*/
public final class ArtifactEncryptionService {
@@ -55,8 +54,7 @@ public final class ArtifactEncryptionService {
* Generates encryption secrets and saves them in secret store by software
* module id reference.
*
* @param smId
* software module id
* @param smId software module id
*/
public void addSoftwareModuleEncryptionSecrets(final long smId) {
if (!isEncryptionSupported()) {
@@ -73,10 +71,8 @@ public final class ArtifactEncryptionService {
* Encrypts artifact stream using the keys retrieved from secrets store by
* software module id reference.
*
* @param smId
* software module id
* @param artifactStream
* artifact stream to encrypt
* @param smId software module id
* @param artifactStream artifact stream to encrypt
* @return encrypted input stream
*/
public InputStream encryptSoftwareModuleArtifact(final long smId, final InputStream artifactStream) {
@@ -87,26 +83,12 @@ public final class ArtifactEncryptionService {
return artifactEncryption.encryptStream(getSoftwareModuleEncryptionSecrets(smId), artifactStream);
}
private Map<String, String> getSoftwareModuleEncryptionSecrets(final long smId) {
final Set<String> requiredSecretsKeys = artifactEncryption.requiredSecretKeys();
final Map<String, String> requiredSecrets = new HashMap<>();
for (final String requiredSecretsKey : requiredSecretsKeys) {
final Optional<String> requiredSecretsValue = artifactEncryptionSecretsStore.getSecret(smId,
requiredSecretsKey);
requiredSecretsValue.ifPresent(secretValue -> requiredSecrets.put(requiredSecretsKey, secretValue));
}
return requiredSecrets;
}
/**
* Decrypts artifact stream using the keys retrieved from secrets store by
* software module id reference.
*
* @param smId
* software module id
* @param encryptedArtifactStream
* artifact stream to decrypt
* @param smId software module id
* @param encryptedArtifactStream artifact stream to decrypt
* @return decrypted input stream
*/
public InputStream decryptSoftwareModuleArtifact(final long smId, final InputStream encryptedArtifactStream) {
@@ -125,4 +107,16 @@ public final class ArtifactEncryptionService {
public int encryptionSizeOverhead() {
return artifactEncryption.encryptionSizeOverhead();
}
private Map<String, String> getSoftwareModuleEncryptionSecrets(final long smId) {
final Set<String> requiredSecretsKeys = artifactEncryption.requiredSecretKeys();
final Map<String, String> requiredSecrets = new HashMap<>();
for (final String requiredSecretsKey : requiredSecretsKeys) {
final Optional<String> requiredSecretsValue = artifactEncryptionSecretsStore.getSecret(smId,
requiredSecretsKey);
requiredSecretsValue.ifPresent(secretValue -> requiredSecrets.put(requiredSecretsKey, secretValue));
}
return requiredSecrets;
}
}

View File

@@ -33,9 +33,9 @@ import org.springframework.security.access.prepost.PreAuthorize;
/**
* Service for {@link Artifact} management operations.
*
*/
public interface ArtifactManagement {
/**
* @return the total amount of local artifacts stored in the artifact
* management
@@ -47,23 +47,14 @@ public interface ArtifactManagement {
* Persists artifact binary as provided by given InputStream. assign the
* artifact in addition to given {@link SoftwareModule}.
*
* @param artifactUpload
* {@link ArtifactUpload} containing the upload information
*
* @param artifactUpload {@link ArtifactUpload} containing the upload information
* @return uploaded {@link Artifact}
*
* @throws EntityNotFoundException
* if given software module does not exist
* @throws EntityAlreadyExistsException
* if File with that name already exists in the Software Module
* @throws ArtifactUploadFailedException
* if upload fails with internal server errors
* @throws InvalidMD5HashException
* if check against provided MD5 checksum failed
* @throws InvalidSHA1HashException
* if check against provided SHA1 checksum failed
* @throws ConstraintViolationException
* if {@link ArtifactUpload} contains invalid values
* @throws EntityNotFoundException if given software module does not exist
* @throws EntityAlreadyExistsException if File with that name already exists in the Software Module
* @throws ArtifactUploadFailedException if upload fails with internal server errors
* @throws InvalidMD5HashException if check against provided MD5 checksum failed
* @throws InvalidSHA1HashException if check against provided SHA1 checksum failed
* @throws ConstraintViolationException if {@link ArtifactUpload} contains invalid values
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_CREATE_REPOSITORY)
Artifact create(@NotNull @Valid ArtifactUpload artifactUpload);
@@ -71,12 +62,9 @@ public interface ArtifactManagement {
/**
* Deletes {@link Artifact} based on given id.
*
* @param id
* of the {@link Artifact} that has to be deleted.
* @throws ArtifactDeleteFailedException
* if deletion failed (MongoDB is not available)
* @throws EntityNotFoundException
* if artifact with given ID does not exist
* @param id of the {@link Artifact} that has to be deleted.
* @throws ArtifactDeleteFailedException if deletion failed (MongoDB is not available)
* @throws EntityNotFoundException if artifact with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_DELETE_REPOSITORY)
void delete(long id);
@@ -84,8 +72,7 @@ public interface ArtifactManagement {
/**
* Searches for {@link Artifact} with given {@link Identifiable}.
*
* @param id
* to search for
* @param id to search for
* @return found {@link Artifact}
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY + SpringEvalExpressions.HAS_AUTH_OR
@@ -95,14 +82,10 @@ public interface ArtifactManagement {
/**
* Find by artifact by software module id and filename.
*
* @param filename
* file name
* @param softwareModuleId
* software module id.
* @param filename file name
* @param softwareModuleId software module id.
* @return found {@link Artifact}
*
* @throws EntityNotFoundException
* if software module with given ID does not exist
* @throws EntityNotFoundException if software module with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY + SpringEvalExpressions.HAS_AUTH_OR
+ SpringEvalExpressions.IS_CONTROLLER)
@@ -111,8 +94,7 @@ public interface ArtifactManagement {
/**
* Find all local artifact by sha1 and return the first artifact.
*
* @param sha1
* the sha1
* @param sha1 the sha1
* @return the first local artifact
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY + SpringEvalExpressions.HAS_AUTH_OR
@@ -122,8 +104,7 @@ public interface ArtifactManagement {
/**
* Searches for {@link Artifact} with given file name.
*
* @param filename
* to search for
* @param filename to search for
* @return found List of {@link Artifact}s.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY + SpringEvalExpressions.HAS_AUTH_OR
@@ -133,14 +114,10 @@ public interface ArtifactManagement {
/**
* Get local artifact for a base software module.
*
* @param pageReq
* Pageable parameter
* @param softwareModuleId
* software module id
* @param pageReq Pageable parameter
* @param softwareModuleId software module id
* @return Page<Artifact>
*
* @throws EntityNotFoundException
* if software module with given ID does not exist
* @throws EntityNotFoundException if software module with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Page<Artifact> findBySoftwareModule(@NotNull Pageable pageReq, long softwareModuleId);
@@ -148,12 +125,9 @@ public interface ArtifactManagement {
/**
* Count local artifacts for a base software module.
*
* @param softwareModuleId
* software module id
* @param softwareModuleId software module id
* @return count by software module
*
* @throws EntityNotFoundException
* if software module with given ID does not exist
* @throws EntityNotFoundException if software module with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
long countBySoftwareModule(long softwareModuleId);
@@ -161,14 +135,10 @@ public interface ArtifactManagement {
/**
* Loads {@link DbArtifact} from store for given {@link Artifact}.
*
* @param sha1Hash
* to search for
* @param softwareModuleId
* software module id.
* @param isEncrypted
* flag to indicate if artifact is encrypted.
* @param sha1Hash to search for
* @param softwareModuleId software module id.
* @param isEncrypted flag to indicate if artifact is encrypted.
* @return loaded {@link DbArtifact}
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_DOWNLOAD_ARTIFACT + SpringEvalExpressions.HAS_AUTH_OR
+ SpringEvalExpressions.IS_CONTROLLER)

View File

@@ -17,6 +17,7 @@ public interface BaseRepositoryTypeProvider {
/**
* Return a base repository implementation that shall be used based on provided repository type
*
* @param repositoryType type of repository
* @return base repository implementation class
*/

View File

@@ -9,17 +9,18 @@
*/
package org.eclipse.hawkbit.repository;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import jakarta.validation.constraints.NotEmpty;
import org.eclipse.hawkbit.im.authentication.SpPermission;
import org.eclipse.hawkbit.repository.model.Action;
import org.eclipse.hawkbit.repository.model.AutoConfirmationStatus;
import org.eclipse.hawkbit.tenancy.TenantAware;
import org.springframework.security.access.prepost.PreAuthorize;
import jakarta.validation.constraints.NotEmpty;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
/**
* Service layer for all confirmation related operations.
*/
@@ -29,8 +30,7 @@ public interface ConfirmationManagement {
* Find active actions in the {@link Action.Status#WAIT_FOR_CONFIRMATION} state
* for a specific target with a specified controllerId.
*
* @param controllerId
* of the target to check
* @param controllerId of the target to check
* @return a list of {@link Action}
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -40,13 +40,10 @@ public interface ConfirmationManagement {
* Activate auto confirmation for a given controller ID. In case auto
* confirmation is active already, this method will fail with an exception.
*
* @param controllerId
* to activate the feature for
* @param initiator
* who initiated this operation. If 'null' we will take the current
* @param controllerId to activate the feature for
* @param initiator who initiated this operation. If 'null' we will take the current
* user from {@link TenantAware#getCurrentUsername()}
* @param remark
* optional field to set a remark
* @param remark optional field to set a remark
* @return the persisted {@link AutoConfirmationStatus}
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.IS_CONTROLLER_OR_HAS_AUTH_READ_REPOSITORY_AND_UPDATE_TARGET)
@@ -56,8 +53,7 @@ public interface ConfirmationManagement {
/**
* Get the current state of auto-confirmation for a given controllerId
*
* @param controllerId
* to check the state for
* @param controllerId to check the state for
* @return instance of {@link AutoConfirmationStatus} wrapped in an
* {@link Optional}. Present if active and empty if disabled.
*/
@@ -69,8 +65,7 @@ public interface ConfirmationManagement {
* Auto confirm active actions for a specific controller ID having the
* {@link Action.Status#WAIT_FOR_CONFIRMATION} status.
*
* @param controllerId
* to confirm actions for
* @param controllerId to confirm actions for
* @return a list of confirmed actions
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.IS_CONTROLLER_OR_HAS_AUTH_READ_REPOSITORY_AND_UPDATE_TARGET)
@@ -81,12 +76,9 @@ public interface ConfirmationManagement {
* {@link Action.Status#WAIT_FOR_CONFIRMATION} to {@link Action.Status#RUNNING}
* state.
*
* @param actionId
* mandatory to know which action to confirm
* @param code
* optional value to specify a code for the created action status
* @param messages
* optional value to specify message for the created action status
* @param actionId mandatory to know which action to confirm
* @param code optional value to specify a code for the created action status
* @param messages optional value to specify message for the created action status
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.IS_CONTROLLER_OR_HAS_AUTH_READ_REPOSITORY_AND_UPDATE_TARGET)
Action confirmAction(long actionId, Integer code, Collection<String> messages);
@@ -95,12 +87,9 @@ public interface ConfirmationManagement {
* Deny a given action and leave it in
* {@link Action.Status#WAIT_FOR_CONFIRMATION} state.
*
* @param actionId
* mandatory to know which action to deny
* @param code
* optional value to specify a code for the created action status
* @param messages
* optional value to specify message for the created action status
* @param actionId mandatory to know which action to deny
* @param code optional value to specify a code for the created action status
* @param messages optional value to specify message for the created action status
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.IS_CONTROLLER_OR_HAS_AUTH_READ_REPOSITORY_AND_UPDATE_TARGET)
Action denyAction(long actionId, Integer code, Collection<String> messages);
@@ -108,8 +97,7 @@ public interface ConfirmationManagement {
/**
* Deactivate auto confirmation for a specific controller id
*
* @param controllerId
* to disable auto confirmation for
* @param controllerId to disable auto confirmation for
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.IS_CONTROLLER_OR_HAS_AUTH_READ_REPOSITORY_AND_UPDATE_TARGET)
void deactivateAutoConfirmation(@NotEmpty String controllerId);

View File

@@ -14,7 +14,6 @@ import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
/**
* Repository API constants.
*
*/
public final class Constants {

View File

@@ -43,7 +43,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
/**
* Service layer for all operations of the DDI API (with access permissions only
* for the controller).
*
*/
public interface ControllerManagement {
@@ -51,22 +50,14 @@ public interface ControllerManagement {
* Adds an {@link ActionStatus} for a cancel {@link Action} including
* potential state changes for the target and the {@link Action} itself.
*
* @param create
* to be added
* @param create to be added
* @return the updated {@link Action}
*
* @throws EntityAlreadyExistsException
* if a given entity already exists
*
* @throws AssignmentQuotaExceededException
* if more than the allowed number of status entries or messages
* @throws EntityAlreadyExistsException if a given entity already exists
* @throws AssignmentQuotaExceededException if more than the allowed number of status entries or messages
* per entry are inserted
* @throws EntityNotFoundException
* if given action does not exist
* @throws ConstraintViolationException
* if fields are not filled as specified. Check
* @throws EntityNotFoundException if given action does not exist
* @throws ConstraintViolationException if fields are not filled as specified. Check
* {@link ActionStatusCreate} for field constraints.
*
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
Action addCancelActionStatus(@NotNull @Valid ActionStatusCreate create);
@@ -74,8 +65,7 @@ public interface ControllerManagement {
/**
* Retrieves assigned {@link SoftwareModule} of a target.
*
* @param moduleId
* of the {@link SoftwareModule}
* @param moduleId of the {@link SoftwareModule}
* @return {@link SoftwareModule} identified by ID
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
@@ -85,8 +75,7 @@ public interface ControllerManagement {
* Retrieves {@link SoftwareModuleMetadata} where
* {@link SoftwareModuleMetadata#isTargetVisible()}.
*
* @param moduleId
* of the {@link SoftwareModule}
* @param moduleId of the {@link SoftwareModule}
* @return list of {@link SoftwareModuleMetadata} with maximum size of
* {@link RepositoryConstants#MAX_META_DATA_COUNT}
*/
@@ -98,18 +87,12 @@ public interface ControllerManagement {
* Simple addition of a new {@link ActionStatus} entry to the
* {@link Action}. No state changes.
*
* @param create
* to add to the action
*
* @param create to add to the action
* @return created {@link ActionStatus} entity
*
* @throws AssignmentQuotaExceededException
* if more than the allowed number of status entries or messages
* @throws AssignmentQuotaExceededException if more than the allowed number of status entries or messages
* per entry are inserted
* @throws EntityNotFoundException
* if given action does not exist
* @throws ConstraintViolationException
* if fields are not filled as specified. Check
* @throws EntityNotFoundException if given action does not exist
* @throws ConstraintViolationException if fields are not filled as specified. Check
* {@link ActionStatusCreate} for field constraints.
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
@@ -119,19 +102,13 @@ public interface ControllerManagement {
* Adds an {@link ActionStatus} entry for an update {@link Action} including
* potential state changes for the target and the {@link Action} itself.
*
* @param create
* to be added
* @param create to be added
* @return the updated {@link Action}
*
* @throws EntityAlreadyExistsException
* if a given entity already exists
* @throws AssignmentQuotaExceededException
* if more than the allowed number of status entries or messages
* @throws EntityAlreadyExistsException if a given entity already exists
* @throws AssignmentQuotaExceededException if more than the allowed number of status entries or messages
* per entry are inserted
* @throws EntityNotFoundException
* if action status not exist
* @throws ConstraintViolationException
* if fields are not filled as specified. Check
* @throws EntityNotFoundException if action status not exist
* @throws ConstraintViolationException if fields are not filled as specified. Check
* {@link ActionStatusCreate} for field constraints.
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
@@ -145,10 +122,8 @@ public interface ControllerManagement {
* {@link EntityNotFoundException} in case target with given controllerId
* does not exist but will return an {@link Optional#empty()} instead.
*
* @param controllerId
* identifies the target to retrieve the action from
* @param controllerId identifies the target to retrieve the action from
* @return the action
*
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
Optional<Action> findActiveActionWithHighestWeight(@NotEmpty String controllerId);
@@ -157,12 +132,9 @@ public interface ControllerManagement {
* Retrieves active {@link Action}s with highest weight that are assigned to
* a {@link Target}.
*
* @param controllerId
* identifies the target to retrieve the action from
* @param maxActionCount
* max size of returned list
* @param controllerId identifies the target to retrieve the action from
* @param maxActionCount max size of returned list
* @return the action
*
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
List<Action> findActiveActionsWithHighestWeight(@NotEmpty String controllerId, int maxActionCount);
@@ -171,8 +143,7 @@ public interface ControllerManagement {
* Get weight of an Action. Returns the default value if the weight is null
* according to the properties.
*
* @param action
* to extract the weight from
* @param action to extract the weight from
* @return weight of the action
*/
int getWeightConsideringDefault(final Action action);
@@ -181,8 +152,7 @@ public interface ControllerManagement {
* Get the {@link Action} entity for given actionId with all lazy
* attributes.
*
* @param actionId
* to be id of the action
* @param actionId to be id of the action
* @return the corresponding {@link Action}
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
@@ -192,14 +162,10 @@ public interface ControllerManagement {
* Retrieves all the {@link ActionStatus} entries of the given
* {@link Action}.
*
* @param pageReq
* pagination parameter
* @param actionId
* to be filtered on
* @param pageReq pagination parameter
* @param actionId to be filtered on
* @return the corresponding {@link Page} of {@link ActionStatus}
*
* @throws EntityNotFoundException
* if action with given ID does not exist
* @throws EntityNotFoundException if action with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
Page<ActionStatus> findActionStatusByAction(@NotNull Pageable pageReq, long actionId);
@@ -211,10 +177,8 @@ public interface ControllerManagement {
* {@link TargetUpdateStatus#UNKNOWN} to
* {@link TargetUpdateStatus#REGISTERED}.
*
* @param controllerId
* reference
* @param address
* the client IP address of the target, might be {@code null}
* @param controllerId reference
* @param address the client IP address of the target, might be {@code null}
* @return target reference
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
@@ -228,14 +192,10 @@ public interface ControllerManagement {
* switches if {@link TargetUpdateStatus#UNKNOWN} to
* {@link TargetUpdateStatus#REGISTERED}.
*
* @param controllerId
* reference
* @param address
* the client IP address of the target, might be {@code null}
* @param name
* the name of the target
* @param type
* the target type name of the target
* @param controllerId reference
* @param address the client IP address of the target, might be {@code null}
* @param name the name of the target
* @param type the target type name of the target
* @return target reference
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
@@ -246,16 +206,11 @@ public interface ControllerManagement {
* Retrieves last {@link Action} for a download of an artifact of given
* module and target if exists and is not canceled.
*
* @param controllerId
* to look for
* @param moduleId
* of the the {@link SoftwareModule} that should be assigned to
* @param controllerId to look for
* @param moduleId of the the {@link SoftwareModule} that should be assigned to
* the target
* @return last {@link Action} for given combination
*
* @throws EntityNotFoundException
* if target with given ID does not exist
*
* @throws EntityNotFoundException if target with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
Optional<Action> getActionForDownloadByTargetAndSoftwareModule(@NotEmpty String controllerId, long moduleId);
@@ -297,10 +252,8 @@ public interface ControllerManagement {
* of maintenance window, it resets to default
* {@link TenantConfigurationKey#POLLING_TIME_INTERVAL}.
*
* @param actionId
* id the {@link Action} for which polling time is calculated
* @param actionId id the {@link Action} for which polling time is calculated
* based on it having maintenance window or not
*
* @return current {@link TenantConfigurationKey#POLLING_TIME_INTERVAL}.
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
@@ -313,17 +266,13 @@ public interface ControllerManagement {
* assigned or had ever been assigned to the target and so it's visible to a
* specific target e.g. for downloading.
*
* @param controllerId
* the ID of the target to check
* @param sha1Hash
* of the artifact to verify if the given target had even been
* @param controllerId the ID of the target to check
* @param sha1Hash of the artifact to verify if the given target had even been
* assigned to
* @return {@code true} if the given target has currently or had ever a
* relation to the given artifact through the action history,
* otherwise {@code false}
*
* @throws EntityNotFoundException
* if target with given ID does not exist
* @throws EntityNotFoundException if target with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
boolean hasTargetArtifactAssigned(@NotEmpty String controllerId, @NotEmpty String sha1Hash);
@@ -335,17 +284,13 @@ public interface ControllerManagement {
* assigned or had ever been assigned to the target and so it's visible to a
* specific target e.g. for downloading.
*
* @param targetId
* the ID of the target to check
* @param sha1Hash
* of the artifact to verify if the given target had even been
* @param targetId the ID of the target to check
* @param sha1Hash of the artifact to verify if the given target had even been
* assigned to
* @return {@code true} if the given target has currently or had ever a
* relation to the given artifact through the action history,
* otherwise {@code false}
*
* @throws EntityNotFoundException
* if target with given ID does not exist
* @throws EntityNotFoundException if target with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
boolean hasTargetArtifactAssigned(long targetId, @NotEmpty String sha1Hash);
@@ -354,15 +299,11 @@ public interface ControllerManagement {
* Registers retrieved status for given {@link Target} and {@link Action} if
* it does not exist yet.
*
* @param actionId
* to the handle status for
* @param message
* for the status
* @param actionId to the handle status for
* @param message for the status
* @return the update action in case the status has been changed to
* {@link Status#RETRIEVED}
*
* @throws EntityNotFoundException
* if action with given ID does not exist
* @throws EntityNotFoundException if action with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
Action registerRetrieved(long actionId, String message);
@@ -371,21 +312,13 @@ public interface ControllerManagement {
* Updates attributes of the controller according to the given
* {@link UpdateMode}.
*
* @param controllerId
* to update
* @param attributes
* to insert
* @param mode
* the update mode or <code>null</code>
*
* @param controllerId to update
* @param attributes to insert
* @param mode the update mode or <code>null</code>
* @return updated {@link Target}
*
* @throws EntityNotFoundException
* if target that has to be updated could not be found
* @throws AssignmentQuotaExceededException
* if maximum number of attributes per target is exceeded
* @throws InvalidTargetAttributeException
* if attributes violate constraints
* @throws EntityNotFoundException if target that has to be updated could not be found
* @throws AssignmentQuotaExceededException if maximum number of attributes per target is exceeded
* @throws InvalidTargetAttributeException if attributes violate constraints
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
Target updateControllerAttributes(@NotEmpty String controllerId, @NotNull Map<String, String> attributes,
@@ -396,8 +329,7 @@ public interface ControllerManagement {
* without details, i.e. NO {@link Target#getTags()} and
* {@link Target#getActions()} possible.
*
* @param controllerId
* to look for.
* @param controllerId to look for.
* @return {@link Target} or {@code null} if it does not exist
* @see Target#getControllerId()
*/
@@ -410,8 +342,7 @@ public interface ControllerManagement {
* details, i.e. NO {@link Target#getTags()} and {@link Target#getActions()}
* possible.
*
* @param targetId
* to look for.
* @param targetId to look for.
* @return {@link Target} or {@code null} if it does not exist
* @see Target#getId()
*/
@@ -436,11 +367,8 @@ public interface ControllerManagement {
* first, the sub-ordering of messages from within single
* {@link ActionStatus} is unspecified.
*
* @param actionId
* to be filtered on
* @param messageCount
* is the number of messages to return from history
*
* @param actionId to be filtered on
* @param messageCount is the number of messages to return from history
* @return action history.
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
@@ -452,15 +380,10 @@ public interface ControllerManagement {
* cancellation. The controller needs to acknowledge or reject the
* cancellation using {@link DdiRootController#postCancelActionFeedback}.
*
* @param actionId
* to be canceled
*
* @param actionId to be canceled
* @return canceled {@link Action}
*
* @throws CancelActionNotAllowedException
* in case the given action is not active or is already canceled
* @throws EntityNotFoundException
* if action with given actionId does not exist.
* @throws CancelActionNotAllowedException in case the given action is not active or is already canceled
* @throws EntityNotFoundException if action with given actionId does not exist.
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
Action cancelAction(long actionId);
@@ -468,10 +391,8 @@ public interface ControllerManagement {
/**
* Updates given {@link Action} with its external id.
*
* @param actionId
* to be updated
* @param externalRef
* of the action
* @param actionId to be updated
* @param externalRef of the action
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
void updateActionExternalRef(long actionId, @NotEmpty String externalRef);
@@ -479,8 +400,7 @@ public interface ControllerManagement {
/**
* Retrieves an {@link Action} using {@link Action#getExternalRef()}
*
* @param externalRef
* of the action. See {@link Action#getExternalRef()}
* @param externalRef of the action. See {@link Action#getExternalRef()}
* @return {@link Action} or {@code null} if it does not exist
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
@@ -489,8 +409,7 @@ public interface ControllerManagement {
/**
* Delete a single target.
*
* @param controllerId
* of the target to delete
* @param controllerId of the target to delete
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
void deleteExistingTarget(@NotEmpty String controllerId);
@@ -498,8 +417,7 @@ public interface ControllerManagement {
/**
* Finds an {@link Action} based on the target that it's assigned to
*
* @param controllerId
* of the target the action is assigned to
* @param controllerId of the target the action is assigned to
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
Optional<Action> getInstalledActionByTarget(@NotEmpty String controllerId);
@@ -507,13 +425,10 @@ public interface ControllerManagement {
/**
* Activate auto confirmation for a given controllerId
*
* @param controllerId
* to activate auto-confirmation on
* @param initiator
* can be set optionally (fallback is the current acting security
* @param controllerId to activate auto-confirmation on
* @param initiator can be set optionally (fallback is the current acting security
* user)
* @param remark
* (optional) remark
* @param remark (optional) remark
* @return the persisted {@link AutoConfirmationStatus}
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
@@ -522,8 +437,7 @@ public interface ControllerManagement {
/**
* Deactivate auto confirmation for a given controllerId
*
* @param controllerId
* to deactivate auto-confirmation on
* @param controllerId to deactivate auto-confirmation on
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
void deactivateAutoConfirmation(@NotEmpty String controllerId);
@@ -531,17 +445,11 @@ public interface ControllerManagement {
/**
* Updates distributionSet installed version (experimental)
*
* @param distributionName
* installed
* @param version
* installed
*
* @param distributionName installed
* @param version installed
* @return updated {@link Target}
*
* @throws EntityNotFoundException
* if target that has to be updated could not be found
* @throws java.util.NoSuchElementException
* if DistributionSetAssignmentResult list is empty
* @throws EntityNotFoundException if target that has to be updated could not be found
* @throws java.util.NoSuchElementException if DistributionSetAssignmentResult list is empty
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
boolean updateOfflineAssignedVersion(@NotEmpty String controllerId, String distributionName, String version);

View File

@@ -48,34 +48,35 @@ import org.springframework.security.access.prepost.PreAuthorize;
/**
* A DeploymentManagement service provides operations for the deployment of
* {@link DistributionSet}s to {@link Target}s.
*
*/
public interface DeploymentManagement {
/**
* build a {@link DeploymentRequest} for a target distribution set
* assignment
*
* @param controllerId ID of target
* @param distributionSetId ID of distribution set
* @return the builder
*/
static DeploymentRequestBuilder deploymentRequest(final String controllerId, final long distributionSetId) {
return new DeploymentRequestBuilder(controllerId, distributionSetId);
}
/**
* Assigns {@link DistributionSet}s to {@link Target}s according to the
* {@link DeploymentRequest}.
*
* @param deploymentRequests
* information about all target-ds-assignments that shall be made
*
* @param deploymentRequests information about all target-ds-assignments that shall be made
* @return the list of assignment results
*
* @throws IncompleteDistributionSetException
* if mandatory {@link SoftwareModuleType} are not assigned as
* @throws IncompleteDistributionSetException if mandatory {@link SoftwareModuleType} are not assigned as
* defined by the {@link DistributionSetType}.
*
* @throws EntityNotFoundException
* if either provided {@link DistributionSet} or {@link Target}s
* @throws EntityNotFoundException if either provided {@link DistributionSet} or {@link Target}s
* do not exist
*
* @throws AssignmentQuotaExceededException
* if the maximum number of targets the distribution set can be
* @throws AssignmentQuotaExceededException if the maximum number of targets the distribution set can be
* assigned to at once is exceeded
* @throws MultiAssignmentIsNotEnabledException
* if the request results in multiple assignments to the same
* @throws MultiAssignmentIsNotEnabledException if the request results in multiple assignments to the same
* target and multiassignment is disabled
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY_AND_UPDATE_TARGET)
List<DistributionSetAssignmentResult> assignDistributionSets(
@@ -85,49 +86,23 @@ public interface DeploymentManagement {
* Assigns {@link DistributionSet}s to {@link Target}s according to the
* {@link DeploymentRequest}.
*
* @param initiatedBy
* the username of the user who initiated the assignment
* @param deploymentRequests
* information about all target-ds-assignments that shall be made
* @param actionMessage
* an optional message for the action status
*
* @param initiatedBy the username of the user who initiated the assignment
* @param deploymentRequests information about all target-ds-assignments that shall be made
* @param actionMessage an optional message for the action status
* @return the list of assignment results
*
* @throws IncompleteDistributionSetException
* if mandatory {@link SoftwareModuleType} are not assigned as
* @throws IncompleteDistributionSetException if mandatory {@link SoftwareModuleType} are not assigned as
* defined by the {@link DistributionSetType}.
*
* @throws EntityNotFoundException
* if either provided {@link DistributionSet} or {@link Target}s
* @throws EntityNotFoundException if either provided {@link DistributionSet} or {@link Target}s
* do not exist
*
* @throws AssignmentQuotaExceededException
* if the maximum number of targets the distribution set can be
* @throws AssignmentQuotaExceededException if the maximum number of targets the distribution set can be
* assigned to at once is exceeded
* @throws MultiAssignmentIsNotEnabledException
* if the request results in multiple assignments to the same
* @throws MultiAssignmentIsNotEnabledException if the request results in multiple assignments to the same
* target and multiassignment is disabled
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY_AND_UPDATE_TARGET)
List<DistributionSetAssignmentResult> assignDistributionSets(String initiatedBy,
@Valid @NotEmpty List<DeploymentRequest> deploymentRequests, String actionMessage);
/**
* build a {@link DeploymentRequest} for a target distribution set
* assignment
*
* @param controllerId
* ID of target
* @param distributionSetId
* ID of distribution set
* @return the builder
*/
static DeploymentRequestBuilder deploymentRequest(final String controllerId, final long distributionSetId) {
return new DeploymentRequestBuilder(controllerId, distributionSetId);
}
/**
* Registers "offline" assignments. "offline" assignment means adding a
* completed action for a {@link DistributionSet} to a {@link Target}.
@@ -143,25 +118,16 @@ public interface DeploymentManagement {
* <li>does not send a {@link TargetAssignDistributionSetEvent}.</li>
* </ol>
*
* @param assignments
* target IDs with the respective distribution set ID which they
* @param assignments target IDs with the respective distribution set ID which they
* are supposed to be assigned to
* @return the assignment results
*
* @throws IncompleteDistributionSetException
* if mandatory {@link SoftwareModuleType} are not assigned as
* @throws IncompleteDistributionSetException if mandatory {@link SoftwareModuleType} are not assigned as
* defined by the {@link DistributionSetType}.
*
* @throws EntityNotFoundException
* if either provided {@link DistributionSet} or {@link Target}s
* @throws EntityNotFoundException if either provided {@link DistributionSet} or {@link Target}s
* do not exist
*
* @throws AssignmentQuotaExceededException
* if the maximum number of targets the distribution set can be
* @throws AssignmentQuotaExceededException if the maximum number of targets the distribution set can be
* assigned to at once is exceeded
*
* @throws MultiAssignmentIsNotEnabledException
* if the request results in multiple assignments to the same
* @throws MultiAssignmentIsNotEnabledException if the request results in multiple assignments to the same
* target and multiassignment is disabled
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY_AND_UPDATE_TARGET)
@@ -175,16 +141,11 @@ public interface DeploymentManagement {
* add a {@link Status#CANCELED} status to the action. However, it might be
* possible that the controller will continue to work on the cancellation.
*
* @param actionId
* to be canceled
*
* @param actionId to be canceled
* @return canceled {@link Action}
*
* @throws CancelActionNotAllowedException
* in case the given action is not active or is already a cancel
* @throws CancelActionNotAllowedException in case the given action is not active or is already a cancel
* action
* @throws EntityNotFoundException
* if action with given ID does not exist
* @throws EntityNotFoundException if action with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
Action cancelAction(long actionId);
@@ -192,19 +153,13 @@ public interface DeploymentManagement {
/**
* Counts all actions associated to a specific target.
*
* @param rsqlParam
* rsql query string
* @param controllerId
* the target associated to the actions to count
* @param rsqlParam rsql query string
* @param controllerId the target associated to the actions to count
* @return the count value of found actions associated to the target
*
* @throws RSQLParameterUnsupportedFieldException
* if a field in the RSQL string is used but not provided by the
* @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
* if target with given ID does not exist
* @throws RSQLParameterSyntaxException if the RSQL syntax is wrong
* @throws EntityNotFoundException if target with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
long countActionsByTarget(@NotNull String rsqlParam, @NotEmpty String controllerId);
@@ -224,8 +179,7 @@ public interface DeploymentManagement {
* <p/>
* No access control applied.
*
* @param rsqlParam
* RSQL query.
* @param rsqlParam RSQL query.
* @return the total number of actions matching the given RSQL query.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -234,12 +188,9 @@ public interface DeploymentManagement {
/**
* Counts all actions associated to a specific target.
*
* @param controllerId
* the target associated to the actions to count
* @param controllerId the target associated to the actions to count
* @return the count value of found actions associated to the target
*
* @throws EntityNotFoundException
* if target with given ID does not exist
* @throws EntityNotFoundException if target with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
long countActionsByTarget(@NotEmpty String controllerId);
@@ -247,10 +198,8 @@ public interface DeploymentManagement {
/**
* Get the {@link Action} entity for given actionId.
*
* @param actionId
* to be id of the action
* @param actionId to be id of the action
* @return the corresponding {@link Action}
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Optional<Action> findAction(long actionId);
@@ -273,7 +222,6 @@ public interface DeploymentManagement {
*
* @param rsqlParam RSQL query string
* @param pageable the page request parameter for paging and sorting the result
*
* @return a paged list of {@link Action}s.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -283,20 +231,14 @@ public interface DeploymentManagement {
* Retrieves all {@link Action}s assigned to a specific {@link Target} and a
* given specification.
*
* @param rsqlParam
* rsql query string
* @param controllerId
* the target which must be assigned to the actions
* @param pageable
* the page request
* @param rsqlParam rsql query string
* @param controllerId the target which must be assigned to the actions
* @param pageable the page request
* @return a slice of actions assigned to the specific target and the
* specification
*
* @throws RSQLParameterUnsupportedFieldException
* if a field in the RSQL string is used but not provided by the
* @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 RSQLParameterSyntaxException if the RSQL syntax is wrong
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Slice<Action> findActionsByTarget(@NotNull String rsqlParam, @NotEmpty String controllerId,
@@ -306,12 +248,9 @@ public interface DeploymentManagement {
* Retrieves all {@link Action}s which are referring the given
* {@link Target}.
*
* @param controllerId
* the target to find actions for
* @param pageable
* the pageable request to limit, sort the actions
* @param controllerId the target to find actions for
* @param pageable the pageable request to limit, sort the actions
* @return a slice of actions found for a specific target
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Slice<Action> findActionsByTarget(@NotEmpty String controllerId, @NotNull Pageable pageable);
@@ -320,14 +259,10 @@ public interface DeploymentManagement {
* Retrieves all the {@link ActionStatus} entries of the given
* {@link Action}.
*
* @param pageReq
* pagination parameter
* @param actionId
* to be filtered on
* @param pageReq pagination parameter
* @param actionId to be filtered on
* @return the corresponding {@link Page} of {@link ActionStatus}
*
* @throws EntityNotFoundException
* if action with given ID does not exist
* @throws EntityNotFoundException if action with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Page<ActionStatus> findActionStatusByAction(@NotNull Pageable pageReq, long actionId);
@@ -335,12 +270,9 @@ public interface DeploymentManagement {
/**
* Counts all the {@link ActionStatus} entries of the given {@link Action}.
*
* @param actionId
* to be filtered on
* @param actionId to be filtered on
* @return count of {@link ActionStatus} entries
*
* @throws EntityNotFoundException
* if action with given ID does not exist
* @throws EntityNotFoundException if action with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
long countActionStatusByAction(long actionId);
@@ -350,10 +282,8 @@ public interface DeploymentManagement {
* <p/>
* No entity based access control applied.
*
* @param pageable
* the page request parameter for paging and sorting the result
* @param actionStatusId
* the id of {@link ActionStatus} to retrieve the messages from
* @param pageable the page request parameter for paging and sorting the result
* @param actionStatusId the id of {@link ActionStatus} to retrieve the messages from
* @return a page of messages by a specific {@link ActionStatus} id
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -363,8 +293,7 @@ public interface DeploymentManagement {
* Get the {@link Action} entity for given actionId with all lazy attributes
* (i.e. distributionSet, target, target.assignedDs).
*
* @param actionId
* to be id of the action
* @param actionId to be id of the action
* @return the corresponding {@link Action}
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -373,14 +302,10 @@ public interface DeploymentManagement {
/**
* Retrieves all active {@link Action}s of a specific target.
*
* @param pageable
* the page request parameter for paging and sorting the result
* @param controllerId
* the target associated with the actions
* @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
*
* @throws EntityNotFoundException
* if target with given ID does not exist
* @throws EntityNotFoundException if target with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Page<Action> findActiveActionsByTarget(@NotNull Pageable pageable, @NotEmpty String controllerId);
@@ -388,14 +313,10 @@ public interface DeploymentManagement {
/**
* Retrieves all inactive {@link Action}s of a specific target.
*
* @param pageable
* the page request parameter for paging and sorting the result
* @param controllerId
* the target associated with the actions
* @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
*
* @throws EntityNotFoundException
* if target with given ID does not exist
* @throws EntityNotFoundException if target with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Page<Action> findInActiveActionsByTarget(@NotNull Pageable pageable, @NotEmpty String controllerId);
@@ -404,12 +325,9 @@ public interface DeploymentManagement {
* Retrieves active {@link Action}s with highest weight that are assigned to a
* {@link Target}.
*
* @param controllerId
* identifies the target to retrieve the action from
* @param maxActionCount
* max size of returned list
* @param controllerId identifies the target to retrieve the action from
* @param maxActionCount max size of returned list
* @return the action
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
List<Action> findActiveActionsWithHighestWeight(@NotEmpty String controllerId, int maxActionCount);
@@ -418,8 +336,7 @@ public interface DeploymentManagement {
* Get weight of an Action. Returns the default value if the weight is null
* according to the properties.
*
* @param action
* to extract the weight from
* @param action to extract the weight from
* @return weight of the action
*/
int getWeightConsideringDefault(final Action action);
@@ -430,16 +347,10 @@ public interface DeploymentManagement {
* and a cancel request is sent to the target. But however it's not tracked,
* if the targets handles the cancel request or not.
*
* @param actionId
* to be canceled
*
* @param actionId to be canceled
* @return quite {@link Action}
*
* @throws CancelActionNotAllowedException
* in case the given action is not active
*
* @throws EntityNotFoundException
* if action with given ID does not exist
* @throws CancelActionNotAllowedException in case the given action is not active
* @throws EntityNotFoundException if action with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
Action forceQuitAction(long actionId);
@@ -448,12 +359,9 @@ public interface DeploymentManagement {
* Updates a {@link Action} and forces the {@link Action} if it's not
* already forced.
*
* @param actionId
* the ID of the action
* @param actionId the ID of the action
* @return the updated or the found {@link Action}
*
* @throws EntityNotFoundException
* if action with given ID does not exist
* @throws EntityNotFoundException if action with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
Action forceTargetAction(long actionId);
@@ -462,9 +370,7 @@ public interface DeploymentManagement {
* Sets the status of inactive scheduled {@link Action}s for the specified
* {@link Target}s to {@link Status#CANCELED}
*
* @param targetIds
* ids of the {@link Target}s the actions belong to
*
* @param targetIds ids of the {@link Target}s the actions belong to
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
void cancelInactiveScheduledActionsForTargets(List<Long> targetIds);
@@ -474,12 +380,9 @@ public interface DeploymentManagement {
* <p/>
* No entity based access control applied.
*
* @param rolloutId
* the rollout the actions belong to
* @param distributionSetId
* to assign
* @param rolloutGroupParentId
* the parent rollout group the actions should reference. null
* @param rolloutId the rollout the actions belong to
* @param distributionSetId to assign
* @param rolloutGroupParentId the parent rollout group the actions should reference. null
* references the first group
* @return the amount of started actions
*/
@@ -497,12 +400,9 @@ public interface DeploymentManagement {
/**
* Returns {@link DistributionSet} that is assigned to given {@link Target}.
*
* @param controllerId
* of target
* @param controllerId of target
* @return assigned {@link DistributionSet}
*
* @throws EntityNotFoundException
* if target with given ID does not exist
* @throws EntityNotFoundException if target with given ID does not exist
*/
Optional<DistributionSet> getAssignedDistributionSet(@NotEmpty String controllerId);
@@ -510,12 +410,9 @@ public interface DeploymentManagement {
* Returns {@link DistributionSet} that is installed on given
* {@link Target}.
*
* @param controllerId
* of target
* @param controllerId of target
* @return installed {@link DistributionSet}
*
* @throws EntityNotFoundException
* if target with given ID does not exist
* @throws EntityNotFoundException if target with given ID does not exist
*/
Optional<DistributionSet> getInstalledDistributionSet(@NotEmpty String controllerId);
@@ -525,11 +422,8 @@ public interface DeploymentManagement {
* <p/>
* No entity based access control applied.
*
* @param status
* Set of action status.
* @param lastModified
* A time-stamp in milliseconds.
*
* @param status Set of action status.
* @param lastModified A time-stamp in milliseconds.
* @return The number of action entries that were deleted.
*/
@PreAuthorize(SpringEvalExpressions.IS_SYSTEM_CODE)
@@ -549,10 +443,8 @@ public interface DeploymentManagement {
* Cancels all actions that refer to a given distribution set. This method
* is called when a distribution set is invalidated.
*
* @param cancelationType
* defines if a force or soft cancel is executed
* @param set
* the distribution set for that the actions should be canceled
* @param cancelationType defines if a force or soft cancel is executed
* @param set the distribution set for that the actions should be canceled
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
void cancelActionsForDistributionSet(final CancelationType cancelationType, final DistributionSet set);

View File

@@ -16,7 +16,6 @@ import org.eclipse.hawkbit.repository.model.DistributionSetInvalidationCount;
/**
* A DistributionSetInvalidationManagement service provides operations to
* invalidate {@link DistributionSet}s.
*
*/
public interface DistributionSetInvalidationManagement {
@@ -26,8 +25,7 @@ public interface DistributionSetInvalidationManagement {
* can not be undone. Optionally, all rollouts and actions referring this
* {@link DistributionSet} can be canceled.
*
* @param distributionSetInvalidation
* defines the {@link DistributionSet} and options what should be
* @param distributionSetInvalidation defines the {@link DistributionSet} and options what should be
* canceled
*/
void invalidateDistributionSet(final DistributionSetInvalidation distributionSetInvalidation);
@@ -36,9 +34,7 @@ public interface DistributionSetInvalidationManagement {
* Counts all entities for a list of {@link DistributionSet}s that will be
* canceled when invalidation is called for those {@link DistributionSet}s.
*
*
* @param distributionSetInvalidation
* defines the {@link DistributionSet} and options what should be
* @param distributionSetInvalidation defines the {@link DistributionSet} and options what should be
* canceled
* @return The {@link DistributionSetInvalidationCount} object that holds
* information about the count of affected rollouts,

View File

@@ -45,7 +45,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
/**
* Management service for {@link DistributionSet}s.
*
*/
public interface DistributionSetManagement
extends RepositoryManagement<DistributionSet, DistributionSetCreate, DistributionSetUpdate> {
@@ -53,26 +52,15 @@ public interface DistributionSetManagement
/**
* Assigns {@link SoftwareModule} to existing {@link DistributionSet}.
*
* @param id
* to assign and update
* @param moduleIds
* to get assigned
*
* @param id to assign and update
* @param moduleIds to get assigned
* @return the updated {@link DistributionSet}.
*
* @throws EntityNotFoundException
* if (at least one) given module does not exist
*
* @throws EntityReadOnlyException
* if use tries to change the {@link DistributionSet} s while
* @throws EntityNotFoundException if (at least one) given module does not exist
* @throws EntityReadOnlyException if use tries to change the {@link DistributionSet} s while
* the DS is already in use.
*
* @throws UnsupportedSoftwareModuleForThisDistributionSetException
* if {@link SoftwareModule#getType()} is not supported by this
* @throws UnsupportedSoftwareModuleForThisDistributionSetException if {@link SoftwareModule#getType()} is not supported by this
* {@link DistributionSet#getType()}.
*
* @throws AssignmentQuotaExceededException
* if the maximum number of {@link SoftwareModule}s is exceeded
* @throws AssignmentQuotaExceededException if the maximum number of {@link SoftwareModule}s is exceeded
* for the addressed {@link DistributionSet}.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
@@ -82,15 +70,10 @@ public interface DistributionSetManagement
* Assign a {@link DistributionSetTag} assignment to given
* {@link DistributionSet}s.
*
* @param ids
* to assign for
* @param tagId
* to assign
*
* @param ids to assign for
* @param tagId to assign
* @return list of assigned ds
*
* @throws EntityNotFoundException
* if tag with given ID does not exist or (at least one) of the
* @throws EntityNotFoundException if tag with given ID does not exist or (at least one) of the
* distribution sets.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
@@ -110,22 +93,14 @@ public interface DistributionSetManagement
/**
* Creates a list of distribution set meta data entries.
*
* @param id
* if the {@link DistributionSet} the metadata has to be created
* @param id if the {@link DistributionSet} the metadata has to be created
* for
* @param metadata
* the meta data entries to create or update
* @param metadata the meta data entries to create or update
* @return the updated or created distribution set meta data entries
*
* @throws EntityNotFoundException
* if given set does not exist
*
* @throws EntityAlreadyExistsException
* in case one of the meta data entry already exists for the
* @throws EntityNotFoundException if given set does not exist
* @throws EntityAlreadyExistsException in case one of the meta data entry already exists for the
* specific key
*
* @throws AssignmentQuotaExceededException
* if the maximum number of {@link MetaData} entries is exceeded
* @throws AssignmentQuotaExceededException if the maximum number of {@link MetaData} entries is exceeded
* for the addressed {@link DistributionSet}
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
@@ -134,13 +109,9 @@ public interface DistributionSetManagement
/**
* Deletes a distribution set meta data entry.
*
* @param id
* where meta data has to be deleted
* @param key
* of the meta data element
*
* @throws EntityNotFoundException
* if given set does not exist
* @param id where meta data has to be deleted
* @param key of the meta data element
* @throws EntityNotFoundException if given set does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
void deleteMetaData(long id, @NotEmpty String key);
@@ -169,12 +140,9 @@ public interface DistributionSetManagement
/**
* Retrieves the distribution set for a given action.
*
* @param actionId
* the action associated with the distribution set
* @param actionId the action associated with the distribution set
* @return the distribution set which is associated with the action
*
* @throws EntityNotFoundException
* if action with given ID does not exist
* @throws EntityNotFoundException if action with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Optional<DistributionSet> getByAction(long actionId);
@@ -186,9 +154,7 @@ public interface DistributionSetManagement
* Note: for performance reasons it is recommended to use {@link #get(Long)}
* if details are not necessary.
*
* @param id
* to look for.
*
* @param id to look for.
* @return {@link DistributionSet}
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
@@ -197,11 +163,8 @@ public interface DistributionSetManagement
/**
* Find distribution set by name and version.
*
* @param distributionName
* name of {@link DistributionSet}; case insensitive
* @param version
* version of {@link DistributionSet}
*
* @param distributionName name of {@link DistributionSet}; case insensitive
* @param version version of {@link DistributionSet}
* @return the page with the found {@link DistributionSet}
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
@@ -211,19 +174,11 @@ public interface DistributionSetManagement
* Find distribution set by id and throw an exception if it is deleted,
* incomplete or invalidated.
*
* @param id
* id of {@link DistributionSet}
*
* @param id id of {@link DistributionSet}
* @return the found valid {@link DistributionSet}
*
* @throws EntityNotFoundException
* if distribution set with given ID does not exist
*
* @throws InvalidDistributionSetException
* if distribution set with given ID is invalidated
*
* @throws IncompleteDistributionSetException
* if distribution set with given ID is incomplete
* @throws EntityNotFoundException if distribution set with given ID does not exist
* @throws InvalidDistributionSetException if distribution set with given ID is invalidated
* @throws IncompleteDistributionSetException if distribution set with given ID is incomplete
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
DistributionSet getValidAndComplete(long id);
@@ -232,16 +187,10 @@ public interface DistributionSetManagement
* Find distribution set by id and throw an exception if it is deleted or
* invalidated.
*
* @param id
* id of {@link DistributionSet}
*
* @param id id of {@link DistributionSet}
* @return the found valid {@link DistributionSet}
*
* @throws EntityNotFoundException
* if distribution set with given ID does not exist
*
* @throws InvalidDistributionSetException
* if distribution set with given ID is invalidated
* @throws EntityNotFoundException if distribution set with given ID does not exist
* @throws InvalidDistributionSetException if distribution set with given ID is invalidated
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
DistributionSet getValid(long id);
@@ -250,13 +199,9 @@ public interface DistributionSetManagement
* Find distribution set by id and throw an exception if it is (soft)
* deleted.
*
* @param id
* id of {@link DistributionSet}
*
* @param id id of {@link DistributionSet}
* @return the found valid {@link DistributionSet}
*
* @throws EntityNotFoundException
* if distribution set with given ID does not exist
* @throws EntityNotFoundException if distribution set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
DistributionSet getOrElseThrowException(long id);
@@ -264,16 +209,11 @@ public interface DistributionSetManagement
/**
* Finds all meta data by the given distribution set id.
*
* @param pageable
* the page request to page the result
* @param id
* the distribution set id to retrieve the meta data from
*
* @param pageable the page request to page the result
* @param id the distribution set id to retrieve the meta data from
* @return a paged result of all meta data entries for a given distribution
* set id
*
* @throws EntityNotFoundException
* if distribution set with given ID does not exist
* @throws EntityNotFoundException if distribution set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Page<DistributionSetMetadata> findMetaDataByDistributionSetId(@NotNull Pageable pageable, long id);
@@ -281,13 +221,9 @@ public interface DistributionSetManagement
/**
* Counts all meta data by the given distribution set id.
*
* @param id
* the distribution set id to retrieve the meta data count from
*
* @param id the distribution set id to retrieve the meta data count from
* @return count of ds metadata
*
* @throws EntityNotFoundException
* if distribution set with given ID does not exist
* @throws EntityNotFoundException if distribution set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
long countMetaDataByDistributionSetId(long id);
@@ -295,25 +231,15 @@ public interface DistributionSetManagement
/**
* Finds all meta data by the given distribution set id.
*
* @param pageable
* the page request to page the result
* @param id
* the distribution set id to retrieve the meta data from
* @param rsqlParam
* rsql query string
*
* @param pageable the page request to page the result
* @param id the distribution set id to retrieve the meta data from
* @param rsqlParam rsql query string
* @return a paged result of all meta data entries for a given distribution
* set id
*
* @throws RSQLParameterUnsupportedFieldException
* if a field in the RSQL string is used but not provided by the
* @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 with given ID does not exist
* @throws RSQLParameterSyntaxException if the RSQL syntax is wrong
* @throws EntityNotFoundException of distribution set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Page<DistributionSetMetadata> findMetaDataByDistributionSetIdAndRsql(@NotNull Pageable pageable,
@@ -322,13 +248,10 @@ public interface DistributionSetManagement
/**
* Finds all {@link DistributionSet}s based on completeness.
*
* @param pageable
* the pagination parameter
* @param complete
* to <code>true</code> for returning only completed distribution
* @param pageable the pagination parameter
* @param complete to <code>true</code> for returning only completed distribution
* sets or <code>false</code> for only incomplete ones nor
* <code>null</code> to return both.
*
* @return all found {@link DistributionSet}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
@@ -337,11 +260,9 @@ public interface DistributionSetManagement
/**
* Counts all {@link DistributionSet}s based on completeness.
*
* @param complete
* to <code>true</code> for counting only completed distribution
* @param complete to <code>true</code> for counting only completed distribution
* sets or <code>false</code> for only incomplete ones nor
* <code>null</code> to count both.
*
* @return count of all found {@link DistributionSet}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
@@ -350,10 +271,8 @@ public interface DistributionSetManagement
/**
* Retrieves {@link DistributionSet}s by filtering on the given parameters.
*
* @param pageable
* page parameter
* @param distributionSetFilter
* has details of filters to be applied.
* @param pageable page parameter
* @param distributionSetFilter has details of filters to be applied.
* @return the page of found {@link DistributionSet}
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
@@ -373,13 +292,9 @@ public interface DistributionSetManagement
* 3) {@link DistributionSet}s which have no connection to the given
* {@link Target} ordered by ID of the DistributionSet.
*
* @param pageable
* the page request to page the result set *
* @param distributionSetFilter
* has details of filters to be applied.
* @param assignedOrInstalled
* the id of the Target to be ordered by
*
* @param pageable the page request to page the result set *
* @param distributionSetFilter has details of filters to be applied.
* @param assignedOrInstalled the id of the Target to be ordered by
* @return {@link DistributionSet}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
@@ -389,9 +304,7 @@ public interface DistributionSetManagement
/**
* Counts all {@link DistributionSet}s in repository based on given filter.
*
* @param distributionSetFilter
* has details of filters to be applied.
*
* @param distributionSetFilter has details of filters to be applied.
* @return count of {@link DistributionSet}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
@@ -400,21 +313,13 @@ public interface DistributionSetManagement
/**
* Retrieves {@link DistributionSet}s by filtering on the given parameters.
*
* @param pageable
* page parameter
* @param tagId
* of the tag the DS are assigned to
* @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
* @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
* @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> findByTag(@NotNull Pageable pageable, long tagId);
@@ -422,16 +327,11 @@ public interface DistributionSetManagement
/**
* 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
* @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
* @throws EntityNotFoundException of distribution set tag with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Page<DistributionSet> findByRsqlAndTag(@NotNull Pageable pageable, @NotNull String rsqlParam, long tagId);
@@ -439,14 +339,10 @@ public interface DistributionSetManagement
/**
* Finds a single distribution set meta data by its id.
*
* @param id
* of the {@link DistributionSet}
* @param key
* of the meta data element
* @param id of the {@link DistributionSet}
* @param key of the meta data element
* @return the found DistributionSetMetadata
*
* @throws EntityNotFoundException
* is set with given ID does not exist
* @throws EntityNotFoundException is set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Optional<DistributionSetMetadata> getMetaDataByDistributionSetId(long id, @NotEmpty String key);
@@ -455,9 +351,7 @@ public interface DistributionSetManagement
* Checks if a {@link DistributionSet} is currently in use by a target in
* the repository.
*
* @param id
* to check
*
* @param id to check
* @return <code>true</code> if in use
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
@@ -467,17 +361,11 @@ public interface DistributionSetManagement
* Unassigns a {@link SoftwareModule} form an existing
* {@link DistributionSet}.
*
* @param id
* to get unassigned form
* @param moduleId
* to be unassigned
* @param id to get unassigned form
* @param moduleId to be unassigned
* @return the updated {@link DistributionSet}.
*
* @throws EntityNotFoundException
* if given module or DS does not exist
*
* @throws EntityReadOnlyException
* if use tries to change the {@link DistributionSet} s while
* @throws EntityNotFoundException if given module or DS does not exist
* @throws EntityReadOnlyException if use tries to change the {@link DistributionSet} s while
* the DS is already in use.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
@@ -486,14 +374,10 @@ public interface DistributionSetManagement
/**
* Updates a distribution set meta data value if corresponding entry exists.
*
* @param id
* {@link DistributionSet} of the meta data entry to be updated
* @param metadata
* meta data entry to be updated
* @param id {@link DistributionSet} of the meta data entry to be updated
* @param metadata meta data entry to be updated
* @return the updated meta data entry
*
* @throws EntityNotFoundException
* in case the meta data entry does not exists and cannot be
* @throws EntityNotFoundException in case the meta data entry does not exists and cannot be
* updated
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
@@ -503,13 +387,9 @@ public interface DistributionSetManagement
* Count all {@link DistributionSet}s in the repository that are not marked
* as deleted.
*
* @param typeId
* to look for
*
* @param typeId to look for
* @return number of {@link DistributionSet}s
*
* @throws EntityNotFoundException
* if type with given ID does not exist
* @throws EntityNotFoundException if type with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
long countByTypeId(long typeId);
@@ -518,11 +398,8 @@ public interface DistributionSetManagement
* Count all {@link org.eclipse.hawkbit.repository.model.Rollout}s by status for
* Distribution Set.
*
* @param id
* to look for
*
* @param id to look for
* @return List of Statistics for {@link org.eclipse.hawkbit.repository.model.Rollout}s status counts
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
List<Statistic> countRolloutsByStatusForDistributionSet(@NotNull Long id);
@@ -531,11 +408,8 @@ public interface DistributionSetManagement
* Count all {@link org.eclipse.hawkbit.repository.model.Action}s by status for
* Distribution Set.
*
* @param id
* to look for
*
* @param id to look for
* @return List of Statistics for {@link org.eclipse.hawkbit.repository.model.Action}s status counts
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
List<Statistic> countActionsByStatusForDistributionSet(@NotNull Long id);
@@ -544,11 +418,8 @@ public interface DistributionSetManagement
* Count all {@link org.eclipse.hawkbit.repository.builder.AutoAssignDistributionSetUpdate}s
* for Distribution Set.
*
* @param id
* to look for
*
* @param id to look for
* @return number of {@link org.eclipse.hawkbit.repository.builder.AutoAssignDistributionSetUpdate}s
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Long countAutoAssignmentsForDistributionSet(@NotNull Long id);
@@ -556,8 +427,7 @@ public interface DistributionSetManagement
/**
* Sets the specified {@link DistributionSet} as invalidated.
*
* @param distributionSet
* the ID of the {@link DistributionSet} to be set to invalid
* @param distributionSet the ID of the {@link DistributionSet} to be set to invalid
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
void invalidate(DistributionSet distributionSet);
@@ -568,25 +438,24 @@ public interface DistributionSetManagement
* the list have the {@link Tag} not yet assigned, they will be. Only if all
* of theme have the tag already assigned they will be removed instead.
*
* @deprecated since 0.6.0 in favor of assign/unassign
* @param ids to toggle for
* @param tagName to toggle
* @return {@link DistributionSetTagAssignmentResult} with all meta data of the assignment outcome.
* @throws EntityNotFoundException if given tag does not exist or (at least one) module
* @deprecated since 0.6.0 in favor of assign/unassign
*/
@Deprecated(forRemoval = true)
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
DistributionSetTagAssignmentResult toggleTagAssignment(@NotEmpty Collection<Long> ids, @NotNull String tagName);
/**
* Unassign a {@link DistributionSetTag} assignment to given {@link DistributionSet}.
*
* @deprecated since 0.6.0 in favor of unassignTag(List<Long>, long)
* @param id to unassign for
* @param tagId to unassign
* @return the unassigned ds or <null> if no ds is unassigned
* @throws EntityNotFoundException if set or tag with given ID does not exist
* @deprecated since 0.6.0 in favor of unassignTag(List<Long>, long)
*/
@Deprecated(forRemoval = true)
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)

View File

@@ -28,7 +28,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
/**
* Management service for {@link DistributionSetTag}s.
*
*/
public interface DistributionSetTagManagement extends RepositoryManagement<DistributionSetTag, TagCreate, TagUpdate> {
@@ -36,11 +35,8 @@ public interface DistributionSetTagManagement extends RepositoryManagement<Distr
* Deletes {@link DistributionSetTag} by given
* {@link DistributionSetTag#getName()}.
*
* @param tagName
* to be deleted
*
* @throws EntityNotFoundException
* if tag with given name does not exist
* @param tagName to be deleted
* @throws EntityNotFoundException if tag with given name does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_DELETE_REPOSITORY)
void delete(@NotEmpty String tagName);
@@ -48,8 +44,7 @@ public interface DistributionSetTagManagement extends RepositoryManagement<Distr
/**
* Find {@link DistributionSet} based on given name.
*
* @param name
* to look for.
* @param name to look for.
* @return {@link DistributionSet}
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
@@ -58,15 +53,10 @@ public interface DistributionSetTagManagement extends RepositoryManagement<Distr
/**
* Finds all {@link TargetTag} assigned to given {@link Target}.
*
* @param pageable
* information for page size, offset and sort order.
*
* @param distributionSetId
* of the {@link DistributionSet}
* @param pageable information for page size, offset and sort order.
* @param distributionSetId of the {@link DistributionSet}
* @return page of the found {@link TargetTag}s
*
* @throws EntityNotFoundException
* if {@link DistributionSet} with given ID does not exist
* @throws EntityNotFoundException if {@link DistributionSet} with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Page<DistributionSetTag> findByDistributionSet(@NotNull Pageable pageable, long distributionSetId);

View File

@@ -17,9 +17,9 @@ import jakarta.validation.constraints.NotEmpty;
import org.eclipse.hawkbit.im.authentication.SpPermission.SpringEvalExpressions;
import org.eclipse.hawkbit.repository.builder.DistributionSetTypeCreate;
import org.eclipse.hawkbit.repository.builder.DistributionSetTypeUpdate;
import org.eclipse.hawkbit.repository.exception.AssignmentQuotaExceededException;
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
import org.eclipse.hawkbit.repository.exception.EntityReadOnlyException;
import org.eclipse.hawkbit.repository.exception.AssignmentQuotaExceededException;
import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.repository.model.DistributionSetType;
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
@@ -27,14 +27,12 @@ import org.springframework.security.access.prepost.PreAuthorize;
/**
* Management service for {@link DistributionSetType}s.
*
*/
public interface DistributionSetTypeManagement
extends RepositoryManagement<DistributionSetType, DistributionSetTypeCreate, DistributionSetTypeUpdate> {
/**
* @param key
* as {@link DistributionSetType#getKey()}
* @param key as {@link DistributionSetType#getKey()}
* @return {@link DistributionSetType}
*/
@@ -42,8 +40,7 @@ public interface DistributionSetTypeManagement
Optional<DistributionSetType> getByKey(@NotEmpty String key);
/**
* @param name
* as {@link DistributionSetType#getName()}
* @param name as {@link DistributionSetType#getName()}
* @return {@link DistributionSetType}
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
@@ -52,22 +49,14 @@ public interface DistributionSetTypeManagement
/**
* Assigns {@link DistributionSetType#getMandatoryModuleTypes()}.
*
* @param id
* to update
* @param softwareModuleTypeIds
* to assign
* @param id to update
* @param softwareModuleTypeIds to assign
* @return updated {@link DistributionSetType}
*
* @throws EntityNotFoundException
* in case the {@link DistributionSetType} or at least one of
* @throws EntityNotFoundException in case the {@link DistributionSetType} or at least one of
* the {@link SoftwareModuleType}s do not exist
*
* @throws EntityReadOnlyException
* if the {@link DistributionSetType} while it is already in use
* @throws EntityReadOnlyException if the {@link DistributionSetType} while it is already in use
* by a {@link DistributionSet}
*
* @throws AssignmentQuotaExceededException
* if the maximum number of {@link SoftwareModuleType}s is
* @throws AssignmentQuotaExceededException if the maximum number of {@link SoftwareModuleType}s is
* exceeded for the addressed {@link DistributionSetType}
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
@@ -76,22 +65,14 @@ public interface DistributionSetTypeManagement
/**
* Assigns {@link DistributionSetType#getOptionalModuleTypes()}.
*
* @param id
* to update
* @param softwareModuleTypeIds
* to assign
* @param id to update
* @param softwareModuleTypeIds to assign
* @return updated {@link DistributionSetType}
*
* @throws EntityNotFoundException
* in case the {@link DistributionSetType} or at least one of
* @throws EntityNotFoundException in case the {@link DistributionSetType} or at least one of
* the {@link SoftwareModuleType}s do not exist
*
* @throws EntityReadOnlyException
* if the {@link DistributionSetType} while it is already in use
* @throws EntityReadOnlyException if the {@link DistributionSetType} while it is already in use
* by a {@link DistributionSet}
*
* @throws AssignmentQuotaExceededException
* if the maximum number of {@link SoftwareModuleType}s is
* @throws AssignmentQuotaExceededException if the maximum number of {@link SoftwareModuleType}s is
* exceeded for the addressed {@link DistributionSetType}
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
@@ -102,17 +83,11 @@ public interface DistributionSetTypeManagement
* {@link DistributionSetType}. Does nothing if {@link SoftwareModuleType}
* has not been assigned in the first place.
*
* @param id
* to update
* @param softwareModuleTypeId
* to unassign
* @param id to update
* @param softwareModuleTypeId to unassign
* @return updated {@link DistributionSetType}
*
* @throws EntityNotFoundException
* in case the {@link DistributionSetType} does not exist
*
* @throws EntityReadOnlyException
* if the {@link DistributionSetType} while it is already in use
* @throws EntityNotFoundException in case the {@link DistributionSetType} does not exist
* @throws EntityReadOnlyException if the {@link DistributionSetType} while it is already in use
* by a {@link DistributionSet}
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)

View File

@@ -30,7 +30,6 @@ import org.eclipse.hawkbit.repository.model.MetaData;
/**
* central {@link BaseEntity} generation service. Objects are created but not
* persisted.
*
*/
public interface EntityFactory {
@@ -48,11 +47,8 @@ public interface EntityFactory {
* Generates an {@link MetaData} element for distribution set without
* persisting it.
*
* @param key
* {@link MetaData#getKey()}
* @param value
* {@link MetaData#getValue()}
*
* @param key {@link MetaData#getKey()}
* @param value {@link MetaData#getValue()}
* @return {@link MetaData} object
*/
MetaData generateDsMetadata(@Size(min = 1, max = MetaData.KEY_MAX_SIZE) @NotNull String key,
@@ -61,11 +57,8 @@ public interface EntityFactory {
/**
* Generates an {@link MetaData} element for target without persisting it.
*
* @param key
* {@link MetaData#getKey()}
* @param value
* {@link MetaData#getValue()}
*
* @param key {@link MetaData#getKey()}
* @param value {@link MetaData#getValue()}
* @return {@link MetaData} object
*/
MetaData generateTargetMetadata(@Size(min = 1, max = MetaData.KEY_MAX_SIZE) @NotNull String key,

View File

@@ -35,20 +35,14 @@ public class FilterParams {
/**
* Constructor for the filter parameters of a Simple Filter.
*
* @param filterByInstalledOrAssignedDistributionSetId
* if set, a filter is added for the given
* @param filterByInstalledOrAssignedDistributionSetId if set, a filter is added for the given
* {@link DistributionSet#getId()}
* @param filterByStatus
* if set, a filter is added for target states included by the
* @param filterByStatus if set, a filter is added for target states included by the
* collection
* @param overdueState
* if set, a filter is added for overdued devices
* @param filterBySearchText
* if set, a filter is added for the given search text
* @param selectTargetWithNoTag
* if set, tag-filtering is enabled
* @param filterByTagNames
* if tag-filtering is enabled, a filter is added for the given
* @param overdueState if set, a filter is added for overdued devices
* @param filterBySearchText if set, a filter is added for the given search text
* @param selectTargetWithNoTag if set, tag-filtering is enabled
* @param filterByTagNames if tag-filtering is enabled, a filter is added for the given
* tag-names
*/
public FilterParams(final Collection<TargetUpdateStatus> filterByStatus, final Boolean overdueState,
@@ -67,15 +61,11 @@ public class FilterParams {
/**
* Constructor for the filter parameters of a Type Filter.
*
* @param filterBySearchText
* if set, a filter is added for the given search text
* @param filterByInstalledOrAssignedDistributionSetId
* if set, a filter is added for the given
* @param filterBySearchText if set, a filter is added for the given search text
* @param filterByInstalledOrAssignedDistributionSetId if set, a filter is added for the given
* {@link DistributionSet#getId()}
* @param selectTargetWithNoType
* if true, a filter is added with no type
* @param filterByType
* if set, a filter is added for the given target type
* @param selectTargetWithNoType if true, a filter is added with no type
* @param filterByType if set, a filter is added for the given target type
*/
public FilterParams(final String filterBySearchText, final Long filterByInstalledOrAssignedDistributionSetId,
final Boolean selectTargetWithNoType, final Long filterByType) {

View File

@@ -16,14 +16,13 @@ import java.time.ZonedDateTime;
import java.time.format.DateTimeParseException;
import java.util.Optional;
import org.eclipse.hawkbit.repository.exception.InvalidMaintenanceScheduleException;
import org.springframework.util.StringUtils;
import com.cronutils.model.Cron;
import com.cronutils.model.CronType;
import com.cronutils.model.definition.CronDefinitionBuilder;
import com.cronutils.model.time.ExecutionTime;
import com.cronutils.parser.CronParser;
import org.eclipse.hawkbit.repository.exception.InvalidMaintenanceScheduleException;
import org.springframework.util.StringUtils;
/**
* Helper class to check validity of maintenance schedule definition and manage
@@ -43,23 +42,18 @@ public final class MaintenanceScheduleHelper {
/**
* Calculate the next available maintenance window.
*
* @param cronSchedule
* is a cron expression with 6 mandatory fields and 1 last
* @param cronSchedule is a cron expression with 6 mandatory fields and 1 last
* optional field: "second minute hour dayofmonth month weekday
* year".
* @param duration
* in HH:mm:ss format specifying the duration of a maintenance
* @param duration in HH:mm:ss format specifying the duration of a maintenance
* window, for example 00:30:00 for 30 minutes.
* @param timezone
* is the time zone specified as +/-hh:mm offset from UTC. For
* @param timezone is the time zone specified as +/-hh:mm offset from UTC. For
* example +02:00 for CET summer time and +00:00 for UTC. The
* start time of a maintenance window calculated based on the
* cron expression is relative to this time zone.
*
* @return { @link Optional<ZonedDateTime>} of the next available window. In
* case there is none, or there are maintenance window validation
* errors, returns empty value.
*
*/
// Exception squid:S1166 - if there are validation error(format of cron
// expression or duration is wrong), we simply return empty value
@@ -79,15 +73,11 @@ public final class MaintenanceScheduleHelper {
/**
* Parse the given cron expression with quartz parser.
*
* @param cronSchedule
* is a cron expression with 6 mandatory fields and 1 last
* @param cronSchedule is a cron expression with 6 mandatory fields and 1 last
* optional field: "second minute hour dayofmonth month weekday
* year".
*
* @return {@link Cron} object, that corresponds to the expression.
*
* @throws IllegalArgumentException
* if the cron expression doesn't have a valid format.
* @throws IllegalArgumentException if the cron expression doesn't have a valid format.
*/
public static Cron getCronFromExpression(final String cronSchedule) {
return cronParser.parse(cronSchedule);
@@ -100,21 +90,16 @@ public final class MaintenanceScheduleHelper {
* either all the parameters: schedule, duration and time zone are valid or
* are null.
*
* @param cronSchedule
* is a cron expression with 6 mandatory fields and 1 last
* @param cronSchedule is a cron expression with 6 mandatory fields and 1 last
* optional field: "second minute hour dayofmonth month weekday
* year".
* @param duration
* in HH:mm:ss format specifying the duration of a maintenance
* @param duration in HH:mm:ss format specifying the duration of a maintenance
* window, for example 00:30:00 for 30 minutes.
* @param timezone
* is the time zone specified as +/-hh:mm offset from UTC. For
* @param timezone is the time zone specified as +/-hh:mm offset from UTC. For
* example +02:00 for CET summer time and +00:00 for UTC. The
* start time of a maintenance window calculated based on the
* cron expression is relative to this time zone.
*
* @throws InvalidMaintenanceScheduleException
* if the defined schedule fails the validity criteria.
* @throws InvalidMaintenanceScheduleException if the defined schedule fails the validity criteria.
*/
public static void validateMaintenanceSchedule(final String cronSchedule, final String duration,
final String timezone) {
@@ -133,46 +118,27 @@ public final class MaintenanceScheduleHelper {
}
}
private static boolean atLeastOneNotEmpty(final String cronSchedule, final String duration, final String timezone) {
return !(StringUtils.isEmpty(cronSchedule) && StringUtils.isEmpty(duration) && StringUtils.isEmpty(timezone));
}
private static boolean allNotEmpty(final String cronSchedule, final String duration, final String timezone) {
return !StringUtils.isEmpty(cronSchedule) && !StringUtils.isEmpty(duration) && !StringUtils.isEmpty(timezone);
}
/**
* Convert the time interval or duration specified in "HH:mm:ss" format to
* ISO format.
*
* @param timeInterval
* in "HH:mm:ss" string format. This format is popularly used but
* @param timeInterval in "HH:mm:ss" string format. This format is popularly used but
* can be confused with time of the day, hence conversion to ISO
* specified format for time duration is required.
*
* @return {@link Duration} in ISO format.
*
* @throws DateTimeParseException
* if the text cannot be converted to ISO format.
* @throws DateTimeParseException if the text cannot be converted to ISO format.
*/
public static Duration convertToISODuration(final String timeInterval) {
return Duration.between(LocalTime.MIN, convertDurationToLocalTime(timeInterval));
}
private static LocalTime convertDurationToLocalTime(final String timeInterval) {
return LocalTime.parse(StringUtils.trimWhitespace(timeInterval));
}
/**
* Validates the format of the maintenance window duration
*
* @param duration
* in "HH:mm:ss" string format. This format is popularly used but
* @param duration in "HH:mm:ss" string format. This format is popularly used but
* can be confused with time of the day, hence conversion to ISO
* specified format for time duration is required.
*
* @throws InvalidMaintenanceScheduleException
* if the duration doesn't have a valid format to be converted
* @throws InvalidMaintenanceScheduleException if the duration doesn't have a valid format to be converted
* to ISO.
*/
public static void validateDuration(final String duration) {
@@ -188,13 +154,10 @@ public final class MaintenanceScheduleHelper {
/**
* Validates the format of the maintenance window cron expression
*
* @param cronSchedule
* is a cron expression with 6 mandatory fields and 1 last
* @param cronSchedule is a cron expression with 6 mandatory fields and 1 last
* optional field: "second minute hour dayofmonth month weekday
* year".
*
* @throws InvalidMaintenanceScheduleException
* if the cron expression doesn't have a valid quartz format.
* @throws InvalidMaintenanceScheduleException if the cron expression doesn't have a valid quartz format.
*/
public static void validateCronSchedule(final String cronSchedule) {
try {
@@ -205,4 +168,16 @@ public final class MaintenanceScheduleHelper {
throw new InvalidMaintenanceScheduleException(e.getMessage(), e);
}
}
private static boolean atLeastOneNotEmpty(final String cronSchedule, final String duration, final String timezone) {
return !(StringUtils.isEmpty(cronSchedule) && StringUtils.isEmpty(duration) && StringUtils.isEmpty(timezone));
}
private static boolean allNotEmpty(final String cronSchedule, final String duration, final String timezone) {
return !StringUtils.isEmpty(cronSchedule) && !StringUtils.isEmpty(duration) && !StringUtils.isEmpty(timezone);
}
private static LocalTime convertDurationToLocalTime(final String timeInterval) {
return LocalTime.parse(StringUtils.trimWhitespace(timeInterval));
}
}

View File

@@ -31,10 +31,8 @@ public final class OffsetBasedPageRequest extends PageRequest {
* Creates a new {@link OffsetBasedPageRequest}. Offsets are zero indexed,
* thus providing 0 for {@code offset} will return the first entry.
*
* @param offset
* zero-based offset index.
* @param limit
* the limit of the page to be returned.
* @param offset zero-based offset index.
* @param limit the limit of the page to be returned.
*/
public OffsetBasedPageRequest(final long offset, final int limit) {
this(offset, limit, Sort.unsorted());
@@ -44,12 +42,9 @@ public final class OffsetBasedPageRequest extends PageRequest {
* Creates a new {@link OffsetBasedPageRequest}. Offsets are zero indexed,
* thus providing 0 for {@code offset} will return the first entry.
*
* @param offset
* zero-based offset index.
* @param limit
* the limit of the page to be returned.
* @param sort
* sort can be {@literal null}.
* @param offset zero-based offset index.
* @param limit the limit of the page to be returned.
* @param sort sort can be {@literal null}.
*/
public OffsetBasedPageRequest(final long offset, final int limit, final Sort sort) {
super(0, limit, sort);

View File

@@ -16,7 +16,6 @@ import org.eclipse.hawkbit.repository.model.RolloutGroup;
/**
* Central service for defined limits of the repository.
*
*/
public interface QuotaManagement {

View File

@@ -16,7 +16,6 @@ import org.eclipse.hawkbit.repository.model.SoftwareModuleMetadata;
/**
* Repository constants.
*
*/
public final class RepositoryConstants {

View File

@@ -32,24 +32,18 @@ import org.springframework.security.access.prepost.PreAuthorize;
/**
* Generic management methods common to (software) repository content.
*
* @param <T>
* type of the {@link BaseEntity}
* @param <C>
* entity create builder
* @param <U>
* entity update builder
* @param <T> type of the {@link BaseEntity}
* @param <C> entity create builder
* @param <U> entity update builder
*/
public interface RepositoryManagement<T, C, U> {
/**
* Creates multiple {@link BaseEntity}s.
*
* @param creates
* to create
* @param creates to create
* @return created Entity
*
* @throws ConstraintViolationException
* if fields are not filled as specified. Check
* @throws ConstraintViolationException if fields are not filled as specified. Check
* {@link BaseEntity} for field constraints.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_CREATE_REPOSITORY)
@@ -58,12 +52,9 @@ public interface RepositoryManagement<T, C, U> {
/**
* Creates new {@link BaseEntity}.
*
* @param create
* to create
* @param create to create
* @return created Entity
*
* @throws ConstraintViolationException
* if fields are not filled as specified. Check
* @throws ConstraintViolationException if fields are not filled as specified. Check
* {@link BaseEntity} for field constraints.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_CREATE_REPOSITORY)
@@ -72,19 +63,13 @@ public interface RepositoryManagement<T, C, U> {
/**
* Updates existing {@link BaseEntity}.
*
* @param update
* to update
*
* @param update to update
* @return updated Entity
*
* @throws EntityReadOnlyException
* if the {@link BaseEntity} cannot be updated (e.g. is already
* @throws EntityReadOnlyException if the {@link BaseEntity} cannot be updated (e.g. is already
* in use)
* @throws EntityNotFoundException
* in case the {@link BaseEntity} does not exists and cannot be
* @throws EntityNotFoundException in case the {@link BaseEntity} does not exists and cannot be
* updated
* @throws ConstraintViolationException
* if fields are not filled as specified. Check
* @throws ConstraintViolationException if fields are not filled as specified. Check
* {@link BaseEntity} for field constraints.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
@@ -99,11 +84,8 @@ public interface RepositoryManagement<T, C, U> {
/**
* Deletes or marks as delete in case the {@link BaseEntity} is in use.
*
* @param id
* to delete
*
* @throws EntityNotFoundException
* BaseEntity with given ID does not exist
* @param id to delete
* @throws EntityNotFoundException BaseEntity with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_DELETE_REPOSITORY)
void delete(long id);
@@ -113,11 +95,8 @@ public interface RepositoryManagement<T, C, U> {
* the entities have been linked to another entity before or a hard delete
* if not.
*
* @param ids
* to be deleted
*
* @throws EntityNotFoundException
* if (at least one) given distribution set does not exist
* @param ids to be deleted
* @throws EntityNotFoundException if (at least one) given distribution set does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_DELETE_REPOSITORY)
void delete(@NotEmpty Collection<Long> ids);
@@ -125,8 +104,7 @@ public interface RepositoryManagement<T, C, U> {
/**
* Retrieves all {@link BaseEntity}s without details.
*
* @param ids
* the ids to for
* @param ids the ids to for
* @return the found {@link BaseEntity}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
@@ -135,8 +113,7 @@ public interface RepositoryManagement<T, C, U> {
/**
* Verifies that {@link BaseEntity} with given ID exists in the repository.
*
* @param id
* of entity to check existence
* @param id of entity to check existence
* @return <code>true</code> if entity with given ID exists
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
@@ -145,8 +122,7 @@ public interface RepositoryManagement<T, C, U> {
/**
* Retrieve {@link BaseEntity}
*
* @param id
* to search for
* @param id to search for
* @return {@link BaseEntity} in the repository with given
* {@link BaseEntity#getId()}
*/
@@ -156,8 +132,7 @@ public interface RepositoryManagement<T, C, U> {
/**
* Retrieves {@link Page} of all {@link BaseEntity} of given type.
*
* @param pageable
* paging parameter
* @param pageable paging parameter
* @return all {@link BaseEntity}s in the repository.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
@@ -166,18 +141,12 @@ public interface RepositoryManagement<T, C, U> {
/**
* Retrieves all {@link BaseEntity}s with a given specification.
*
* @param pageable
* pagination parameter
* @param rsqlParam
* filter definition in RSQL syntax
*
* @param pageable pagination parameter
* @param rsqlParam filter definition in RSQL syntax
* @return the found {@link BaseEntity}s
*
* @throws RSQLParameterUnsupportedFieldException
* if a field in the RSQL string is used but not provided by the
* @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 RSQLParameterSyntaxException if the RSQL syntax is wrong
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Page<T> findByRsql(@NotNull Pageable pageable, @NotNull String rsqlParam);

View File

@@ -27,7 +27,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
/**
* Repository management service for RolloutGroup.
*
*/
public interface RolloutGroupManagement {
@@ -35,34 +34,25 @@ public interface RolloutGroupManagement {
* Retrieves a page of {@link RolloutGroup}s filtered by a given
* {@link Rollout} with the detailed status.
*
* @param pageable
* the page request to sort and limit the result
* @param rolloutId
* the ID of the rollout to filter the {@link RolloutGroup}s
*
* @param pageable the page request to sort and limit the result
* @param rolloutId the ID of the rollout to filter the {@link RolloutGroup}s
* @return a page of found {@link RolloutGroup}s
*
* @throws EntityNotFoundException
* of rollout with given ID does not exist
* @throws EntityNotFoundException of rollout with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
Page<RolloutGroup> findByRolloutWithDetailedStatus(@NotNull Pageable pageable, long rolloutId);
/**
*
* Find all targets with action status by rollout group id. The action
* status might be {@code null} if for the target within the rollout no
* actions as been created, e.g. the target already had assigned the same
* distribution set we do not create an action for it but the target is in
* the result list of the rollout-group.
*
* @param pageable
* the page request to sort and limit the result
* @param rolloutGroupId
* rollout group
* @param pageable the page request to sort and limit the result
* @param rolloutGroupId rollout group
* @return {@link TargetWithActionStatus} target with action status
* @throws EntityNotFoundException
* if rollout group with given ID does not exist
* @throws EntityNotFoundException if rollout group with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ_AND_TARGET_READ)
Page<TargetWithActionStatus> findAllTargetsOfRolloutGroupWithActionStatus(@NotNull Pageable pageable,
@@ -71,11 +61,9 @@ public interface RolloutGroupManagement {
/**
* Retrieves a single {@link RolloutGroup} by its ID.
*
* @param rolloutGroupId
* the ID of the rollout group to find
* @param rolloutGroupId the ID of the rollout group to find
* @return the found {@link RolloutGroup} by its ID or {@code null} if it
* does not exists
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
Optional<RolloutGroup> get(long rolloutGroupId);
@@ -84,46 +72,31 @@ public interface RolloutGroupManagement {
* Retrieves a page of {@link RolloutGroup}s filtered by a given
* {@link Rollout} and the an rsql filter.
*
* @param pageable
* the page request to sort and limit the result
* @param rolloutId
* the rollout to filter the {@link RolloutGroup}s
* @param rsqlParam
* the specification to filter the result set based on attributes
* @param pageable the page request to sort and limit the result
* @param rolloutId the rollout to filter the {@link RolloutGroup}s
* @param rsqlParam the specification to filter the result set based on attributes
* of the {@link RolloutGroup}
*
* @return a page of found {@link RolloutGroup}s
*
* @throws RSQLParameterUnsupportedFieldException
* if a field in the RSQL string is used but not provided by the
* @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 RSQLParameterSyntaxException if the RSQL syntax is wrong
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
Page<RolloutGroup> findByRolloutAndRsql(@NotNull Pageable pageable, long rolloutId,
@NotNull String rsqlParam);
/**
* Retrieves a page of {@link RolloutGroup}s filtered by a given
* {@link Rollout} and a rsql filter with detailed status.
*
* @param pageable
* the page request to sort and limit the result
* @param rolloutId
* the rollout to filter the {@link RolloutGroup}s
* @param rsqlParam
* the specification to filter the result set based on attributes
* @param pageable the page request to sort and limit the result
* @param rolloutId the rollout to filter the {@link RolloutGroup}s
* @param rsqlParam the specification to filter the result set based on attributes
* of the {@link RolloutGroup}
*
* @return a page of found {@link RolloutGroup}s
*
* @throws RSQLParameterUnsupportedFieldException
* if a field in the RSQL string is used but not provided by the
* @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 RSQLParameterSyntaxException if the RSQL syntax is wrong
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
Page<RolloutGroup> findByRolloutAndRsqlWithDetailedStatus(@NotNull Pageable pageable, long rolloutId,
@@ -133,11 +106,8 @@ public interface RolloutGroupManagement {
* Retrieves a page of {@link RolloutGroup}s filtered by a given
* {@link Rollout}.
*
* @param pageable
* the page request to sort and limit the result
* @param rolloutId
* the ID of the rollout to filter the {@link RolloutGroup}s
*
* @param pageable the page request to sort and limit the result
* @param rolloutId the ID of the rollout to filter the {@link RolloutGroup}s
* @return a page of found {@link RolloutGroup}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
@@ -147,10 +117,8 @@ public interface RolloutGroupManagement {
* 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
* @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)
@@ -159,15 +127,10 @@ public interface RolloutGroupManagement {
/**
* Get targets of specified rollout group.
*
* @param pageable
* the page request to sort and limit the result
* @param rolloutGroupId
* rollout group
*
* @param pageable the page request to sort and limit the result
* @param rolloutGroupId rollout group
* @return Page<Target> list of targets of a rollout group
*
* @throws EntityNotFoundException
* if group with ID does not exist
* @throws EntityNotFoundException if group with ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ_AND_TARGET_READ)
Page<Target> findTargetsOfRolloutGroup(@NotNull Pageable pageable, long rolloutGroupId);
@@ -175,20 +138,13 @@ public interface RolloutGroupManagement {
/**
* Get targets of specified rollout group.
*
* @param pageable
* the page request to sort and limit the result
* @param rolloutGroupId
* rollout group
* @param rsqlParam
* the specification for filtering the targets of a rollout group
*
* @param pageable the page request to sort and limit the result
* @param rolloutGroupId rollout group
* @param rsqlParam the specification for filtering the targets of a rollout group
* @return Page<Target> list of targets of a rollout group
*
* @throws RSQLParameterUnsupportedFieldException
* if a field in the RSQL string is used but not provided by the
* @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 RSQLParameterSyntaxException if the RSQL syntax is wrong
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ_AND_TARGET_READ)
Page<Target> findTargetsOfRolloutGroupByRsql(@NotNull Pageable pageable, long rolloutGroupId,
@@ -197,10 +153,8 @@ public interface RolloutGroupManagement {
/**
* Get {@link RolloutGroup} by Id.
*
* @param rolloutGroupId
* rollout group id
* @param rolloutGroupId rollout group id
* @return rolloutGroup with details of targets count for different statuses
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
Optional<RolloutGroup> getWithDetailedStatus(long rolloutGroupId);
@@ -208,12 +162,9 @@ public interface RolloutGroupManagement {
/**
* Count targets of rollout group.
*
* @param rolloutGroupId
* the rollout group id for the count
* @param rolloutGroupId the rollout group id for the count
* @return the target rollout group count
*
* @throws EntityNotFoundException
* if rollout group with given ID does not exist
* @throws EntityNotFoundException if rollout group with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
long countTargetsOfRolloutsGroup(long rolloutGroupId);

View File

@@ -46,7 +46,6 @@ public interface RolloutHandler {
* case rollout was already {@link Rollout.RolloutStatus#RUNNING} which results
* in status change {@link Rollout.RolloutStatus#DELETED} or hard delete from
* the persistence otherwise.
*
*/
@PreAuthorize(SpringEvalExpressions.IS_SYSTEM_CODE)
void handleAll();

View File

@@ -59,8 +59,7 @@ public interface RolloutManagement {
/**
* Count rollouts by given text in name or description.
*
* @param searchText
* name or description
* @param searchText name or description
* @return total count rollouts for specified filter text.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
@@ -72,8 +71,7 @@ public interface RolloutManagement {
* <p/>
* No access control applied
*
* @param setId
* the distribution set
* @param setId the distribution set
* @return the count
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
@@ -94,24 +92,16 @@ public interface RolloutManagement {
* targets have been assigned to the groups, the rollout status is changed to
* {@link RolloutStatus#READY} so it can be started with .
*
* @param create
* the rollout entity to create
* @param amountGroup
* the amount of groups to split the rollout into
* @param confirmationRequired
* if a confirmation is required by the device group(s) of the rollout
* @param conditions
* the rolloutgroup conditions and actions which should be applied
* @param create the rollout entity to create
* @param amountGroup the amount of groups to split the rollout into
* @param confirmationRequired if a confirmation is required by the device group(s) of the rollout
* @param conditions the rolloutgroup conditions and actions which should be applied
* for each {@link RolloutGroup}
* @param dynamicRolloutGroupTemplate the template for dynamic rollout groups
* @return the persisted rollout.
*
* @throws EntityNotFoundException
* if given {@link DistributionSet} does not exist
* @throws ConstraintViolationException
* if rollout or group parameters are invalid.
* @throws AssignmentQuotaExceededException
* if the maximum number of allowed targets per rollout group is
* @throws EntityNotFoundException if given {@link DistributionSet} does not exist
* @throws ConstraintViolationException if rollout or group parameters are invalid.
* @throws AssignmentQuotaExceededException if the maximum number of allowed targets per rollout group is
* exceeded.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_CREATE)
@@ -133,23 +123,15 @@ public interface RolloutManagement {
* targets have been assigned to the groups, the rollout status is changed to
* {@link RolloutStatus#READY} so it can be started with .
*
* @param create
* the rollout entity to create
* @param amountGroup
* the amount of groups to split the rollout into
* @param confirmationRequired
* if a confirmation is required by the device group(s) of the rollout
* @param conditions
* the rolloutgroup conditions and actions which should be applied
* @param create the rollout entity to create
* @param amountGroup the amount of groups to split the rollout into
* @param confirmationRequired if a confirmation is required by the device group(s) of the rollout
* @param conditions the rolloutgroup conditions and actions which should be applied
* for each {@link RolloutGroup}
* @return the persisted rollout.
*
* @throws EntityNotFoundException
* if given {@link DistributionSet} does not exist
* @throws ConstraintViolationException
* if rollout or group parameters are invalid.
* @throws AssignmentQuotaExceededException
* if the maximum number of allowed targets per rollout group is
* @throws EntityNotFoundException if given {@link DistributionSet} does not exist
* @throws ConstraintViolationException if rollout or group parameters are invalid.
* @throws AssignmentQuotaExceededException if the maximum number of allowed targets per rollout group is
* exceeded.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_CREATE)
@@ -172,22 +154,15 @@ public interface RolloutManagement {
* {@link RolloutStatus#READY} so it can be started with
* {@link #start(long)}.
*
* @param rollout
* the rollout entity to create
* @param groups
* optional definition of groups
* @param conditions
* the rollout group conditions and actions which should be applied
* @param rollout the rollout entity to create
* @param groups optional definition of groups
* @param conditions the rollout group conditions and actions which should be applied
* for each {@link RolloutGroup} if not defined by the RolloutGroup
* itself
* @return the persisted rollout.
*
* @throws EntityNotFoundException
* if given {@link DistributionSet} does not exist
* @throws ConstraintViolationException
* if rollout or group parameters are invalid
* @throws AssignmentQuotaExceededException
* if the maximum number of allowed targets per rollout group is
* @throws EntityNotFoundException if given {@link DistributionSet} does not exist
* @throws ConstraintViolationException if rollout or group parameters are invalid
* @throws AssignmentQuotaExceededException if the maximum number of allowed targets per rollout group is
* exceeded.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_CREATE)
@@ -198,19 +173,13 @@ public interface RolloutManagement {
* Calculates how many targets are addressed by each rollout group and
* returns the validation information.
*
* @param groups
* a list of rollout groups
* @param targetFilter
* the rollout
* @param createdAt
* timestamp when the rollout was created
* @param dsTypeId
* ID of the type of distribution set of the rollout
* @param groups a list of rollout groups
* @param targetFilter the rollout
* @param createdAt timestamp when the rollout was created
* @param dsTypeId ID of the type of distribution set of the rollout
* @return the validation information
* @throws RolloutIllegalStateException
* thrown when no targets are targeted by the rollout
* @throws ConstraintViolationException
* if fields are not filled as specified. Check
* @throws RolloutIllegalStateException thrown when no targets are targeted by the rollout
* @throws ConstraintViolationException if fields are not filled as specified. Check
* {@link RolloutGroupCreate} for field constraints.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ_AND_TARGET_READ)
@@ -220,10 +189,8 @@ public interface RolloutManagement {
/**
* Retrieves all rollouts.
*
* @param pageable
* the page request to sort and limit the result
* @param deleted
* flag if deleted rollouts should be included
* @param pageable the page request to sort and limit the result
* @param deleted flag if deleted rollouts should be included
* @return a page of found rollouts
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
@@ -232,10 +199,8 @@ public interface RolloutManagement {
/**
* Get count of targets in different status in rollout.
*
* @param pageable
* the page request to sort and limit the result
* @param deleted
* flag if deleted rollouts should be included
* @param pageable the page request to sort and limit the result
* @param deleted flag if deleted rollouts should be included
* @return a list of rollouts with details of targets count for different
* statuses
*/
@@ -245,20 +210,13 @@ public interface RolloutManagement {
/**
* Retrieves all rollouts found by the given specification.
*
* @param pageable
* the page request to sort and limit the result
* @param rsqlParam
* the specification to filter rollouts
* @param deleted
* flag if deleted rollouts should be included
*
* @param pageable the page request to sort and limit the result
* @param rsqlParam the specification to filter rollouts
* @param deleted flag if deleted rollouts should be included
* @return a page of found rollouts
*
* @throws RSQLParameterUnsupportedFieldException
* if a field in the RSQL string is used but not provided by the
* @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 RSQLParameterSyntaxException if the RSQL syntax is wrong
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
Page<Rollout> findByRsql(@NotNull Pageable pageable, @NotNull String rsqlParam, boolean deleted);
@@ -266,12 +224,9 @@ public interface RolloutManagement {
/**
* Finds rollouts by given text in name or description.
*
* @param pageable
* the page request to sort and limit the result
* @param searchText
* search text which matches name or description of rollout
* @param deleted
* flag if deleted rollouts should be included
* @param pageable the page request to sort and limit the result
* @param searchText search text which matches name or description of rollout
* @param deleted flag if deleted rollouts should be included
* @return the founded rollout or {@code null} if rollout with given ID does
* not exists
*/
@@ -290,8 +245,7 @@ public interface RolloutManagement {
/**
* Retrieves a specific rollout by its ID.
*
* @param rolloutId
* the ID of the rollout to retrieve
* @param rolloutId the ID of the rollout to retrieve
* @return the founded rollout or {@code null} if rollout with given ID does
* not exists
*/
@@ -301,8 +255,7 @@ public interface RolloutManagement {
/**
* Retrieves a specific rollout by its name.
*
* @param rolloutName
* the name of the rollout to retrieve
* @param rolloutName the name of the rollout to retrieve
* @return the founded rollout or {@code null} if rollout with given name
* does not exists
*/
@@ -312,11 +265,8 @@ public interface RolloutManagement {
/**
* Get count of targets in different status in rollout.
*
* @param rolloutId
* rollout id
* @param rolloutId rollout id
* @return rollout details of targets count for different statuses
*
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_READ)
Optional<Rollout> getWithDetailedStatus(long rolloutId);
@@ -324,9 +274,7 @@ public interface RolloutManagement {
/**
* Checks if rollout with given ID exists.
*
* @param rolloutId
* rollout id
*
* @param rolloutId rollout id
* @return <code>true</code> if rollout exists
*/
boolean exists(long rolloutId);
@@ -343,15 +291,10 @@ public interface RolloutManagement {
* sufficient due the {@link #checkRunningRollouts(long)} will not check
* this rollout anymore.
*
* @param rolloutId
* the rollout to be paused.
*
* @throws EntityNotFoundException
* if rollout or group with given ID does not exist
* @throws RolloutIllegalStateException
* if given rollout is not in {@link RolloutStatus#RUNNING}.
* @param rolloutId the rollout to be paused.
* @throws EntityNotFoundException if rollout or group with given ID does not exist
* @throws RolloutIllegalStateException if given rollout is not in {@link RolloutStatus#RUNNING}.
* Only running rollouts can be paused.
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_HANDLE)
void pauseRollout(long rolloutId);
@@ -361,13 +304,9 @@ public interface RolloutManagement {
* {@link RolloutStatus#RUNNING} state which is then picked up again by the
* {@link #checkRunningRollouts(long)}.
*
* @param rolloutId
* the rollout to be resumed
*
* @throws EntityNotFoundException
* if rollout with given ID does not exist
* @throws RolloutIllegalStateException
* if given rollout is not in {@link RolloutStatus#PAUSED}. Only
* @param rolloutId the rollout to be resumed
* @throws EntityNotFoundException if rollout with given ID does not exist
* @throws RolloutIllegalStateException if given rollout is not in {@link RolloutStatus#PAUSED}. Only
* paused rollouts can be resumed.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_HANDLE)
@@ -379,17 +318,11 @@ public interface RolloutManagement {
* it switches state to {@link RolloutStatus#READY}, otherwise it switches
* to state {@link RolloutStatus#APPROVAL_DENIED}
*
* @param rolloutId
* the rollout to be approved or denied.
* @param decision
* decision whether a rollout is approved or denied.
*
* @param rolloutId the rollout to be approved or denied.
* @param decision decision whether a rollout is approved or denied.
* @return approved or denied rollout
*
* @throws EntityNotFoundException
* if rollout with given ID does not exist
* @throws RolloutIllegalStateException
* if given rollout is not in
* @throws EntityNotFoundException if rollout with given ID does not exist
* @throws RolloutIllegalStateException if given rollout is not in
* {@link RolloutStatus#WAITING_FOR_APPROVAL}. Only rollouts
* waiting for approval can be acted upon.
*/
@@ -402,19 +335,12 @@ public interface RolloutManagement {
* it switches state to {@link RolloutStatus#READY}, otherwise it switches
* to state {@link RolloutStatus#APPROVAL_DENIED}
*
* @param rolloutId
* the rollout to be approved or denied.
* @param decision
* decision whether a rollout is approved or denied.
* @param remark
* user remark on approve / deny decision
*
* @param rolloutId the rollout to be approved or denied.
* @param decision decision whether a rollout is approved or denied.
* @param remark user remark on approve / deny decision
* @return approved or denied rollout
*
* @throws EntityNotFoundException
* if rollout with given ID does not exist
* @throws RolloutIllegalStateException
* if given rollout is not in
* @throws EntityNotFoundException if rollout with given ID does not exist
* @throws RolloutIllegalStateException if given rollout is not in
* {@link RolloutStatus#WAITING_FOR_APPROVAL}. Only rollouts
* waiting for approveOrDeny can be acted upon.
*/
@@ -428,15 +354,10 @@ public interface RolloutManagement {
* all actions are created and the first group is started. The rollout
* itself will be then also in {@link RolloutStatus#RUNNING}.
*
* @param rolloutId
* the rollout to be started
*
* @param rolloutId the rollout to be started
* @return started rollout
*
* @throws EntityNotFoundException
* if rollout with given ID does not exist
* @throws RolloutIllegalStateException
* if given rollout is not in {@link RolloutStatus#READY}. Only
* @throws EntityNotFoundException if rollout with given ID does not exist
* @throws RolloutIllegalStateException if given rollout is not in {@link RolloutStatus#READY}. Only
* ready rollouts can be started.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_HANDLE)
@@ -445,17 +366,11 @@ public interface RolloutManagement {
/**
* Update rollout details.
*
* @param update
* rollout to be updated
*
* @param update rollout to be updated
* @return Rollout updated rollout
*
* @throws EntityNotFoundException
* if rollout or DS with given IDs do not exist
* @throws EntityReadOnlyException
* if rollout is in soft deleted state, i.e. only kept as
* @throws EntityNotFoundException if rollout or DS with given IDs do not exist
* @throws EntityReadOnlyException if rollout is in soft deleted state, i.e. only kept as
* reference
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_UPDATE)
Rollout update(@NotNull @Valid RolloutUpdate update);
@@ -464,9 +379,7 @@ public interface RolloutManagement {
* Deletes a rollout. A rollout might be deleted asynchronously by
* indicating the rollout by {@link RolloutStatus#DELETING}
*
*
* @param rolloutId
* the ID of the rollout to be deleted
* @param rolloutId the ID of the rollout to be deleted
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_DELETE)
void delete(long rolloutId);
@@ -476,8 +389,7 @@ public interface RolloutManagement {
* This is called when a distribution set is invalidated and the cancel
* rollouts option is activated.
*
* @param set
* the {@link DistributionSet} for that the rollouts should be
* @param set the {@link DistributionSet} for that the rollouts should be
* canceled
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_UPDATE)
@@ -487,14 +399,9 @@ public interface RolloutManagement {
* Triggers next group of a rollout for processing even success threshold
* isn't met yet. Current running groups will not change their status.
*
* @param rolloutId
* the rollout to be paused.
*
* @throws EntityNotFoundException
* if rollout or group with given ID does not exist
* @throws RolloutIllegalStateException
* if given rollout is not in {@link RolloutStatus#RUNNING}.
*
* @param rolloutId the rollout to be paused.
* @throws EntityNotFoundException if rollout or group with given ID does not exist
* @throws RolloutIllegalStateException if given rollout is not in {@link RolloutStatus#RUNNING}.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_UPDATE)
void triggerNextGroup(long rolloutId);
@@ -502,9 +409,7 @@ public interface RolloutManagement {
/**
* Enrich the rollouts Slice with additional details
*
* @param rollouts
* the rollouts to be enriched.
*
* @param rollouts the rollouts to be enriched.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_ROLLOUT_MANAGEMENT_UPDATE)
void setRolloutStatusDetails(final Slice<Rollout> rollouts);

View File

@@ -25,8 +25,7 @@ public final class SizeConversionHelper {
/**
* Convert byte values to human readable strings with units
*
* @param byteValue
* Value to convert in bytes
* @param byteValue Value to convert in bytes
*/
public static String byteValueToReadableString(final long byteValue) {
double outputValue = byteValue / 1024.0;

View File

@@ -27,7 +27,6 @@ import org.eclipse.hawkbit.repository.exception.EntityAlreadyExistsException;
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
import org.eclipse.hawkbit.repository.exception.RSQLParameterSyntaxException;
import org.eclipse.hawkbit.repository.exception.RSQLParameterUnsupportedFieldException;
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;
@@ -39,7 +38,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
/**
* Service for managing {@link SoftwareModule}s.
*
*/
public interface SoftwareModuleManagement
extends RepositoryManagement<SoftwareModule, SoftwareModuleCreate, SoftwareModuleUpdate> {
@@ -47,20 +45,12 @@ public interface SoftwareModuleManagement
/**
* Creates a list of software module meta data entries.
*
* @param metadata
* the meta data entries to create
*
* @param metadata the meta data entries to create
* @return the updated or created software module meta data entries
*
* @throws EntityAlreadyExistsException
* in case one of the meta data entry already exists for the
* @throws EntityAlreadyExistsException in case one of the meta data entry already exists for the
* specific key
*
* @throws EntityNotFoundException
* if software module with given ID does not exist
*
* @throws AssignmentQuotaExceededException
* if the maximum number of {@link SoftwareModuleMetadata}
* @throws EntityNotFoundException if software module with given ID does not exist
* @throws AssignmentQuotaExceededException if the maximum number of {@link SoftwareModuleMetadata}
* entries is exceeded for the addressed {@link SoftwareModule}
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
@@ -69,20 +59,12 @@ public interface SoftwareModuleManagement
/**
* Creates or updates a single software module meta data entry.
*
* @param metadata
* the meta data entry to create
*
* @param metadata the meta data entry to create
* @return the updated or created software module meta data entry
*
* @throws EntityAlreadyExistsException
* in case the meta data entry already exists for the specific
* @throws EntityAlreadyExistsException in case the meta data entry already exists for the specific
* key
*
* @throws EntityNotFoundException
* if software module with given ID does not exist
*
* @throws AssignmentQuotaExceededException
* if the maximum number of {@link SoftwareModuleMetadata}
* @throws EntityNotFoundException if software module with given ID does not exist
* @throws AssignmentQuotaExceededException if the maximum number of {@link SoftwareModuleMetadata}
* entries is exceeded for the addressed {@link SoftwareModule}
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
@@ -91,13 +73,9 @@ public interface SoftwareModuleManagement
/**
* Deletes a software module meta data entry.
*
* @param id
* where meta data has to be deleted
* @param key
* of the metda data element
*
* @throws EntityNotFoundException
* of module or metadata entry does not exist
* @param id where meta data has to be deleted
* @param key of the metda data element
* @throws EntityNotFoundException of module or metadata entry does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
void deleteMetaData(long id, @NotEmpty String key);
@@ -105,16 +83,11 @@ public interface SoftwareModuleManagement
/**
* Returns all modules assigned to given {@link DistributionSet}.
*
* @param pageable
* the page request to page the result set
* @param distributionSetId
* to search for
*
* @param pageable the page request to page the result set
* @param distributionSetId to search for
* @return all {@link SoftwareModule}s that are assigned to given
* {@link DistributionSet}.
*
* @throws EntityNotFoundException
* if distribution set with given ID does not exist
* @throws EntityNotFoundException if distribution set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Page<SoftwareModule> findByAssignedTo(@NotNull Pageable pageable, long distributionSetId);
@@ -122,14 +95,10 @@ public interface SoftwareModuleManagement
/**
* Returns count of all modules assigned to given {@link DistributionSet}.
*
* @param distributionSetId
* to search for
*
* @param distributionSetId to search for
* @return count of {@link SoftwareModule}s that are assigned to given
* {@link DistributionSet}.
*
* @throws EntityNotFoundException
* if distribution set with given ID does not exist
* @throws EntityNotFoundException if distribution set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
long countByAssignedTo(long distributionSetId);
@@ -139,17 +108,11 @@ public interface SoftwareModuleManagement
* {@link SoftwareModule#getName()} or {@link SoftwareModule#getVersion()}
* and {@link SoftwareModule#getType()} that are not marked as deleted.
*
* @param pageable
* page parameter
* @param searchText
* to be filtered as "like" on {@link SoftwareModule#getName()}
* @param typeId
* to be filtered as "like" on {@link SoftwareModule#getType()}
*
* @param pageable page parameter
* @param searchText to be filtered as "like" on {@link SoftwareModule#getName()}
* @param typeId to be filtered as "like" on {@link SoftwareModule#getType()}
* @return the page of found {@link SoftwareModule}
*
* @throws EntityNotFoundException
* if given software module type does not exist
* @throws EntityNotFoundException if given software module type does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Slice<SoftwareModule> findByTextAndType(@NotNull Pageable pageable, String searchText, Long typeId);
@@ -157,17 +120,11 @@ public interface SoftwareModuleManagement
/**
* Retrieves {@link SoftwareModule} by their name AND version AND type..
*
* @param name
* of the {@link SoftwareModule}
* @param version
* of the {@link SoftwareModule}
* @param typeId
* of the {@link SoftwareModule}
*
* @param name of the {@link SoftwareModule}
* @param version of the {@link SoftwareModule}
* @param typeId of the {@link SoftwareModule}
* @return the found {@link SoftwareModule}
*
* @throws EntityNotFoundException
* if software module type with given ID does not exist
* @throws EntityNotFoundException if software module type with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Optional<SoftwareModule> getByNameAndVersionAndType(@NotEmpty String name, @NotEmpty String version, long typeId);
@@ -175,14 +132,10 @@ public interface SoftwareModuleManagement
/**
* Finds a single software module meta data by its id.
*
* @param id
* where meta data has to be found
* @param key
* of the meta data element
* @param id where meta data has to be found
* @param key of the meta data element
* @return the found SoftwareModuleMetadata or {@code null} if not exits
*
* @throws EntityNotFoundException
* is module with given ID does not exist
* @throws EntityNotFoundException is module with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Optional<SoftwareModuleMetadata> getMetaDataBySoftwareModuleId(long id, @NotEmpty String key);
@@ -190,16 +143,11 @@ public interface SoftwareModuleManagement
/**
* Finds all meta data by the given software module id.
*
* @param pageable
* the page request to page the result
* @param id
* the software module id to retrieve the meta data from
*
* @param pageable the page request to page the result
* @param id the software module id to retrieve the meta data from
* @return a paged result of all meta data entries for a given software
* module id
*
* @throws EntityNotFoundException
* if software module with given ID does not exist
* @throws EntityNotFoundException if software module with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Page<SoftwareModuleMetadata> findMetaDataBySoftwareModuleId(@NotNull Pageable pageable, long id);
@@ -207,13 +155,9 @@ public interface SoftwareModuleManagement
/**
* Counts all meta data by the given software module id.
*
* @param id
* the software module id to retrieve the meta data count from
*
* @param id the software module id to retrieve the meta data count from
* @return count of all meta data entries for a given software module id
*
* @throws EntityNotFoundException
* if software module with given ID does not exist
* @throws EntityNotFoundException if software module with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
long countMetaDataBySoftwareModuleId(long id);
@@ -222,16 +166,11 @@ public interface SoftwareModuleManagement
* Finds all meta data by the given software module id where
* {@link SoftwareModuleMetadata#isTargetVisible()}.
*
* @param pageable
* the page request to page the result
* @param id
* the software module id to retrieve the meta data from
*
* @param pageable the page request to page the result
* @param id the software module id to retrieve the meta data from
* @return a paged result of all meta data entries for a given software
* module id
*
* @throws EntityNotFoundException
* if software module with given ID does not exist
* @throws EntityNotFoundException if software module with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Page<SoftwareModuleMetadata> findMetaDataBySoftwareModuleIdAndTargetVisible(@NotNull Pageable pageable,
@@ -240,25 +179,15 @@ public interface SoftwareModuleManagement
/**
* Finds all meta data by the given software module id.
*
* @param pageable
* the page request to page the result
* @param id
* the software module id to retrieve the meta data from
* @param rsqlParam
* filter definition in RSQL syntax
*
* @param pageable the page request to page the result
* @param id the software module id to retrieve the meta data from
* @param rsqlParam filter definition in RSQL syntax
* @return a paged result of all meta data entries for a given software
* module id
*
* @throws RSQLParameterUnsupportedFieldException
* if a field in the RSQL string is used but not provided by the
* @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
* if software module with given ID does not exist
* @throws RSQLParameterSyntaxException if the RSQL syntax is wrong
* @throws EntityNotFoundException if software module with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Page<SoftwareModuleMetadata> findMetaDataByRsql(@NotNull Pageable pageable, long id,
@@ -268,11 +197,8 @@ public interface SoftwareModuleManagement
* Retrieves the {@link SoftwareModule}s by their {@link SoftwareModuleType}
* .
*
* @param pageable
* page parameters
* @param typeId
* to be filtered on
*
* @param pageable page parameters
* @param typeId to be filtered on
* @return the found {@link SoftwareModule}s
* @throws EntityNotFoundException if software module type with given ID does not exist
*/
@@ -302,13 +228,9 @@ public interface SoftwareModuleManagement
/**
* Updates a distribution set meta data value if corresponding entry exists.
*
* @param update
* the meta data entry to be updated
*
* @param update the meta data entry to be updated
* @return the updated meta data entry
*
* @throws EntityNotFoundException
* in case the meta data entry does not exists and cannot be
* @throws EntityNotFoundException in case the meta data entry does not exists and cannot be
* updated
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)

View File

@@ -21,15 +21,12 @@ import org.springframework.security.access.prepost.PreAuthorize;
/**
* Service for managing {@link SoftwareModuleType}s.
*
*/
public interface SoftwareModuleTypeManagement
extends RepositoryManagement<SoftwareModuleType, SoftwareModuleTypeCreate, SoftwareModuleTypeUpdate> {
/**
*
* @param key
* to search for
* @param key to search for
* @return {@link SoftwareModuleType} in the repository with given
* {@link SoftwareModuleType#getKey()}
*/
@@ -37,9 +34,7 @@ public interface SoftwareModuleTypeManagement
Optional<SoftwareModuleType> getByKey(@NotEmpty String key);
/**
*
* @param name
* to search for
* @param name to search for
* @return all {@link SoftwareModuleType}s in the repository with given
* {@link SoftwareModuleType#getName()}
*/

View File

@@ -26,7 +26,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
/**
* Central system management operations of the update server.
*
*/
public interface SystemManagement {
@@ -40,16 +39,13 @@ public interface SystemManagement {
/**
* Deletes all data related to a given tenant.
*
* @param tenant
* to delete
* @param tenant to delete
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_SYSTEM_ADMIN)
void deleteTenant(@NotNull String tenant);
/**
*
* @param pageable
* for paging information
* @param pageable for paging information
* @return list of all tenant names in the system.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_SYSTEM_ADMIN)
@@ -61,8 +57,7 @@ public interface SystemManagement {
* sliently (i.e. exceptions will be logged but operations will continue for
* further tenants).
*
* @param consumer
* to run as teanant
* @param consumer to run as teanant
*/
@PreAuthorize(SpringEvalExpressions.IS_SYSTEM_CODE)
void forEachTenant(Consumer<String> consumer);
@@ -103,8 +98,7 @@ public interface SystemManagement {
* is not yet in the session). Please user {@link #getTenantMetadata()} for
* regular requests.
*
* @param tenant
* to retrieve data for
* @param tenant to retrieve data for
* @return {@link TenantMetaData} of given tenant
*/
@PreAuthorize(SpringEvalExpressions.IS_SYSTEM_CODE)
@@ -113,8 +107,7 @@ public interface SystemManagement {
/**
* Update call for {@link TenantMetaData} of the current tenant.
*
* @param defaultDsType
* to update
* @param defaultDsType to update
* @return updated {@link TenantMetaData} entity
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_TENANT_CONFIGURATION)
@@ -123,8 +116,7 @@ public interface SystemManagement {
/**
* Returns {@link TenantMetaData} of given tenant ID.
*
* @param tenantId
* to retrieve data for
* @param tenantId to retrieve data for
* @return {@link TenantMetaData} of given tenant
*/
@PreAuthorize(SpringEvalExpressions.IS_SYSTEM_CODE)

View File

@@ -36,24 +36,17 @@ import org.springframework.security.access.prepost.PreAuthorize;
/**
* Management service for {@link TargetFilterQuery}s.
*
*/
public interface TargetFilterQueryManagement {
/**
* Creates a new {@link TargetFilterQuery}.
*
* @param create
* to create
*
* @param create to create
* @return the new {@link TargetFilterQuery}
*
* @throws ConstraintViolationException
* if fields are not filled as specified. Check
* @throws ConstraintViolationException if fields are not filled as specified. Check
* {@link TargetFilterQueryCreate} for field constraints.
*
* @throws AssignmentQuotaExceededException
* if the maximum number of targets that is addressed by the
* @throws AssignmentQuotaExceededException if the maximum number of targets that is addressed by the
* given query is exceeded (auto-assignments only)
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_CREATE_TARGET)
@@ -62,11 +55,8 @@ public interface TargetFilterQueryManagement {
/**
* Deletes the {@link TargetFilterQuery} with the given ID.
*
* @param targetFilterQueryId
* IDs of target filter query to be deleted
*
* @throws EntityNotFoundException
* if filter with given ID does not exist
* @param targetFilterQueryId IDs of target filter query to be deleted
* @throws EntityNotFoundException if filter with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_DELETE_TARGET)
void delete(long targetFilterQueryId);
@@ -74,27 +64,19 @@ public interface TargetFilterQueryManagement {
/**
* Verifies the provided filter syntax.
*
* @param query
* to verify
*
* @param query to verify
* @return <code>true</code> if syntax is valid
*
* @throws RSQLParameterUnsupportedFieldException
* if a field in the RSQL string is used but not provided by the
* @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 RSQLParameterSyntaxException if the RSQL syntax is wrong
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
boolean verifyTargetFilterQuerySyntax(@NotNull String query);
/**
*
* Retrieves all {@link TargetFilterQuery}s.
*
* @param pageable
* pagination parameter
* @param pageable pagination parameter
* @return the found {@link TargetFilterQuery}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -114,8 +96,7 @@ public interface TargetFilterQueryManagement {
* <p/>
* No access control applied
*
* @param autoAssignDistributionSetId
* the id of the distribution set
* @param autoAssignDistributionSetId the id of the distribution set
* @return the count
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -125,10 +106,8 @@ public interface TargetFilterQueryManagement {
* Retrieves all {@link TargetFilterQuery}s which match the given name
* filter.
*
* @param pageable
* pagination parameter
* @param name
* name filter
* @param pageable pagination parameter
* @param name name filter
* @return the page with the found {@link TargetFilterQuery}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -137,8 +116,7 @@ public interface TargetFilterQueryManagement {
/**
* Counts all {@link TargetFilterQuery}s which match the given name filter.
*
* @param name
* name filter
* @param name name filter
* @return count of found {@link TargetFilterQuery}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -148,10 +126,8 @@ public interface TargetFilterQueryManagement {
* Retrieves all {@link TargetFilterQuery} which match the given RSQL
* filter.
*
* @param pageable
* pagination parameter
* @param rsqlFilter
* RSQL filter string
* @param pageable pagination parameter
* @param rsqlFilter RSQL filter string
* @return the page with the found {@link TargetFilterQuery}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -160,10 +136,8 @@ public interface TargetFilterQueryManagement {
/**
* Retrieves all {@link TargetFilterQuery}s which match the given query.
*
* @param pageable
* pagination parameter
* @param query
* the query saved in the target filter query
* @param pageable pagination parameter
* @param query the query saved in the target filter query
* @return the page with the found {@link TargetFilterQuery}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -173,14 +147,10 @@ public interface TargetFilterQueryManagement {
* Retrieves all {@link TargetFilterQuery}s which match the given
* auto-assign distribution set ID.
*
* @param pageable
* pagination parameter
* @param setId
* the auto assign distribution set
* @param pageable pagination parameter
* @param setId the auto assign distribution set
* @return the page with the found {@link TargetFilterQuery}s
*
* @throws EntityNotFoundException
* if DS with given ID does not exist
* @throws EntityNotFoundException if DS with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Slice<TargetFilterQuery> findByAutoAssignDistributionSetId(@NotNull Pageable pageable, long setId);
@@ -189,16 +159,11 @@ public interface TargetFilterQueryManagement {
* Retrieves all {@link TargetFilterQuery}s which match the given
* auto-assign distribution set and RSQL filter.
*
* @param pageable
* pagination parameter
* @param setId
* the auto assign distribution set
* @param rsqlParam
* RSQL filter
* @param pageable pagination parameter
* @param setId the auto assign distribution set
* @param rsqlParam RSQL filter
* @return the page with the found {@link TargetFilterQuery}s
*
* @throws EntityNotFoundException
* if DS with given ID does not exist
* @throws EntityNotFoundException if DS with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Page<TargetFilterQuery> findByAutoAssignDSAndRsql(@NotNull Pageable pageable, long setId, String rsqlParam);
@@ -207,9 +172,8 @@ public interface TargetFilterQueryManagement {
* Retrieves all {@link TargetFilterQuery}s with an auto-assign distribution
* set.
*
* @param pageable pagination information
* @return the page with the found {@link TargetFilterQuery}s
* @param pageable
* pagination information
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Slice<TargetFilterQuery> findWithAutoAssignDS(@NotNull Pageable pageable);
@@ -217,10 +181,8 @@ public interface TargetFilterQueryManagement {
/**
* Finds the {@link TargetFilterQuery} by id.
*
* @param targetFilterQueryId
* Target filter query id
* @param targetFilterQueryId Target filter query id
* @return the found {@link TargetFilterQuery}
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Optional<TargetFilterQuery> get(long targetFilterQueryId);
@@ -228,10 +190,8 @@ public interface TargetFilterQueryManagement {
/**
* Finds the {@link TargetFilterQuery} that matches the given name.
*
* @param targetFilterQueryName
* Target filter query name
* @param targetFilterQueryName Target filter query name
* @return the found {@link TargetFilterQuery}
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Optional<TargetFilterQuery> getByName(@NotNull String targetFilterQueryName);
@@ -239,21 +199,13 @@ public interface TargetFilterQueryManagement {
/**
* Updates the {@link TargetFilterQuery}.
*
* @param update
* to be updated
*
* @param update to be updated
* @return the updated {@link TargetFilterQuery}
*
* @throws EntityNotFoundException
* if either {@link TargetFilterQuery} and/or autoAssignDs are
* @throws EntityNotFoundException if either {@link TargetFilterQuery} and/or autoAssignDs are
* provided but not found
*
* @throws ConstraintViolationException
* if fields are not filled as specified. Check
* @throws ConstraintViolationException if fields are not filled as specified. Check
* {@link TargetFilterQueryUpdate} for field constraints.
*
* @throws QuotaExceededException
* if the update contains a new query which addresses too many
* @throws QuotaExceededException if the update contains a new query which addresses too many
* targets (auto-assignments only)
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
@@ -262,29 +214,17 @@ public interface TargetFilterQueryManagement {
/**
* Updates the auto assign settings of an {@link TargetFilterQuery}.
*
* @param autoAssignDistributionSetUpdate
* the new auto assignment
*
* @param autoAssignDistributionSetUpdate the new auto assignment
* @return the updated {@link TargetFilterQuery}
*
* @throws EntityNotFoundException
* if either {@link TargetFilterQuery} and/or autoAssignDs are
* @throws EntityNotFoundException if either {@link TargetFilterQuery} and/or autoAssignDs are
* provided but not found
*
* @throws AssignmentQuotaExceededException
* if the query that is already associated with this filter
* @throws AssignmentQuotaExceededException if the query that is already associated with this filter
* query addresses too many targets (auto-assignments only)
*
* @throws InvalidAutoAssignActionTypeException
* if the provided auto-assign {@link ActionType} is not valid
* @throws InvalidAutoAssignActionTypeException if the provided auto-assign {@link ActionType} is not valid
* (neither FORCED, nor SOFT)
*
* @throws IncompleteDistributionSetException
* if the provided auto-assign {@link DistributionSet} is
* @throws IncompleteDistributionSetException if the provided auto-assign {@link DistributionSet} is
* incomplete
*
* @throws InvalidDistributionSetException
* if the provided auto-assign {@link DistributionSet} is
* @throws InvalidDistributionSetException if the provided auto-assign {@link DistributionSet} is
* invalidated
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
@@ -294,8 +234,7 @@ public interface TargetFilterQueryManagement {
/**
* Removes the given {@link DistributionSet} from all auto assignments.
*
* @param setId
* the {@link DistributionSet} to be removed from auto
* @param setId the {@link DistributionSet} to be removed from auto
* assignments.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)

View File

@@ -55,11 +55,9 @@ public interface TargetManagement {
/**
* Counts number of targets with the given distribution set assigned.
*
* @param distributionSetId
* to search for
* @param distributionSetId to search for
* @return number of found {@link Target}s.
* @throws EntityNotFoundException
* if distribution set with given ID does not exist
* @throws EntityNotFoundException if distribution set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET + SpringEvalExpressions.HAS_AUTH_OR
+ SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
@@ -68,14 +66,10 @@ public interface TargetManagement {
/**
* Count {@link Target}s for all the given filter parameters.
*
* @param filterParams
* the filters to apply; only filters are enabled that have non-null
* @param filterParams the filters to apply; only filters are enabled that have non-null
* value; filters are AND-gated
*
* @return the found number {@link Target}s
*
* @throws EntityNotFoundException
* if distribution set with given ID does not exist
* @throws EntityNotFoundException if distribution set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
long countByFilters(@NotNull final FilterParams filterParams);
@@ -83,11 +77,9 @@ public interface TargetManagement {
/**
* Get the count of targets with the given distribution set id.
*
* @param distributionSetId
* to search for
* @param distributionSetId to search for
* @return number of found {@link Target}s.
* @throws EntityNotFoundException
* if distribution set with given ID does not exist
* @throws EntityNotFoundException if distribution set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET + SpringEvalExpressions.HAS_AUTH_OR
+ SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
@@ -97,11 +89,9 @@ public interface TargetManagement {
* Checks if there is already a {@link Target} that has the given distribution
* set Id assigned or installed.
*
* @param distributionSetId
* to search for
* @param distributionSetId to search for
* @return <code>true</code> if a {@link Target} exists.
* @throws EntityNotFoundException
* if distribution set with given ID does not exist
* @throws EntityNotFoundException if distribution set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET + SpringEvalExpressions.HAS_AUTH_OR
+ SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
@@ -110,8 +100,7 @@ public interface TargetManagement {
/**
* Count {@link TargetFilterQuery}s for given target filter query.
*
* @param rsqlParam
* filter definition in RSQL syntax
* @param rsqlParam filter definition in RSQL syntax
* @return the found number of {@link Target}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -120,8 +109,7 @@ public interface TargetManagement {
/**
* Count {@link TargetFilterQuery}s for given target filter query with UPDATE permission.
*
* @param rsqlParam
* filter definition in RSQL syntax
* @param rsqlParam filter definition in RSQL syntax
* @return the found number of {@link Target}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -131,10 +119,8 @@ public interface TargetManagement {
* Count all targets for given {@link TargetFilterQuery} and that are compatible
* with the passed {@link DistributionSetType}.
*
* @param rsqlParam
* filter definition in RSQL syntax
* @param distributionSetIdTypeId
* ID of the {@link DistributionSetType} the targets need to be
* @param rsqlParam filter definition in RSQL syntax
* @param distributionSetIdTypeId ID of the {@link DistributionSetType} the targets need to be
* compatible with
* @return the found number of{@link Target}s
*/
@@ -145,10 +131,8 @@ public interface TargetManagement {
* Count all targets for given {@link TargetFilterQuery} and that are compatible
* with the passed {@link DistributionSetType} and UPDATE permission.
*
* @param rsqlParam
* filter definition in RSQL syntax
* @param distributionSetIdTypeId
* ID of the {@link DistributionSetType} the targets need to be
* @param rsqlParam filter definition in RSQL syntax
* @param distributionSetIdTypeId ID of the {@link DistributionSetType} the targets need to be
* compatible with
* @return the found number of{@link Target}s
*/
@@ -160,10 +144,8 @@ public interface TargetManagement {
* compatible with the passed {@link DistributionSetType} and created after
* given timestamp
*
* @param rolloutId
* rolloutId of the rollout to be retried.
* @param dsTypeId
* ID of the {@link DistributionSetType} the targets need to be
* @param rolloutId rolloutId of the rollout to be retried.
* @param dsTypeId ID of the {@link DistributionSetType} the targets need to be
* compatible with
* @return the found number of{@link Target}s
*/
@@ -173,12 +155,9 @@ public interface TargetManagement {
/**
* Count {@link TargetFilterQuery}s for given target filter query.
*
* @param targetFilterQueryId
* {@link TargetFilterQuery#getId()}
* @param targetFilterQueryId {@link TargetFilterQuery#getId()}
* @return the found number of {@link Target}s
*
* @throws EntityNotFoundException
* if {@link TargetFilterQuery} with given ID does not exist
* @throws EntityNotFoundException if {@link TargetFilterQuery} with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
long countByTargetFilterQuery(long targetFilterQueryId);
@@ -194,16 +173,11 @@ public interface TargetManagement {
/**
* creating a new {@link Target}.
*
* @param create
* to be created
* @param create to be created
* @return the created {@link Target}
*
* @throws EntityAlreadyExistsException
* given target already exists.
* @throws ConstraintViolationException
* if fields are not filled as specified. Check {@link TargetCreate}
* @throws EntityAlreadyExistsException given target already exists.
* @throws ConstraintViolationException if fields are not filled as specified. Check {@link TargetCreate}
* for field constraints.
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_CREATE_TARGET)
Target create(@NotNull @Valid TargetCreate create);
@@ -213,14 +187,10 @@ public interface TargetManagement {
* in the DB an {@link EntityAlreadyExistsException} is thrown. {@link Target}s
* contain all objects of the parameter targets, including duplicates.
*
* @param creates
* to be created.
* @param creates to be created.
* @return the created {@link Target}s
*
* @throws EntityAlreadyExistsException
* of one of the given targets already exist.
* @throws ConstraintViolationException
* if fields are not filled as specified. Check {@link TargetCreate}
* @throws EntityAlreadyExistsException of one of the given targets already exist.
* @throws ConstraintViolationException if fields are not filled as specified. Check {@link TargetCreate}
* for field constraints.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_CREATE_TARGET)
@@ -229,11 +199,8 @@ public interface TargetManagement {
/**
* Deletes all targets with the given IDs.
*
* @param ids
* the IDs of the targets to be deleted
*
* @throws EntityNotFoundException
* if (at least one) of the given target IDs does not exist
* @param ids the IDs of the targets to be deleted
* @throws EntityNotFoundException if (at least one) of the given target IDs does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_DELETE_TARGET)
void delete(@NotEmpty Collection<Long> ids);
@@ -241,11 +208,8 @@ public interface TargetManagement {
/**
* Deletes target with the given controller ID.
*
* @param controllerId
* the controller ID of the target to be deleted
*
* @throws EntityNotFoundException
* if target with given ID does not exist
* @param controllerId the controller ID of the target to be deleted
* @throws EntityNotFoundException if target with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_DELETE_TARGET)
void deleteByControllerID(@NotEmpty String controllerId);
@@ -255,16 +219,11 @@ public interface TargetManagement {
* that don't have the specified distribution set in their action history and
* are compatible with the passed {@link DistributionSetType}.
*
* @param pageRequest
* the pageRequest to enhance the query for paging and sorting
* @param distributionSetId
* id of the {@link DistributionSet}
* @param rsqlParam
* filter definition in RSQL syntax
* @param pageRequest the pageRequest to enhance the query for paging and sorting
* @param distributionSetId id of the {@link DistributionSet}
* @param rsqlParam filter definition in RSQL syntax
* @return a page of the found {@link Target}s
*
* @throws EntityNotFoundException
* if distribution set with given ID does not exist
* @throws EntityNotFoundException if distribution set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
Slice<Target> findByTargetFilterQueryAndNonDSAndCompatibleAndUpdatable(@NotNull Pageable pageRequest,
@@ -275,14 +234,10 @@ public interface TargetManagement {
* that don't have the specified distribution set in their action history and
* are compatible with the passed {@link DistributionSetType}.
*
* @param distributionSetId
* id of the {@link DistributionSet}
* @param rsqlParam
* filter definition in RSQL syntax
* @param distributionSetId id of the {@link DistributionSet}
* @param rsqlParam filter definition in RSQL syntax
* @return the count of found {@link Target}s
*
* @throws EntityNotFoundException
* if distribution set with given ID does not exist
* @throws EntityNotFoundException if distribution set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
long countByRsqlAndNonDSAndCompatibleAndUpdatable(long distributionSetId, @NotNull String rsqlParam);
@@ -292,14 +247,10 @@ public interface TargetManagement {
* that are not assigned to one of the {@link RolloutGroup}s and are compatible
* with the passed {@link DistributionSetType}.
*
* @param pageRequest
* the pageRequest to enhance the query for paging and sorting
* @param groups
* the list of {@link RolloutGroup}s
* @param targetFilterQuery
* filter definition in RSQL syntax
* @param distributionSetType
* type of the {@link DistributionSet} the targets must be compatible
* @param pageRequest the pageRequest to enhance the query for paging and sorting
* @param groups the list of {@link RolloutGroup}s
* @param targetFilterQuery filter definition in RSQL syntax
* @param distributionSetType type of the {@link DistributionSet} the targets must be compatible
* withs
* @return a page of the found {@link Target}s
*/
@@ -321,12 +272,9 @@ public interface TargetManagement {
* assigned to one of the retried {@link RolloutGroup}s and are compatible with
* the passed {@link DistributionSetType}.
*
* @param pageRequest
* the pageRequest to enhance the query for paging and sorting
* @param groups
* the list of {@link RolloutGroup}s
* @param rolloutId
* rolloutId of the rollout to be retried.
* @param pageRequest the pageRequest to enhance the query for paging and sorting
* @param groups the list of {@link RolloutGroup}s
* @param rolloutId rolloutId of the rollout to be retried.
* @return a page of the found {@link Target}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -338,12 +286,9 @@ public interface TargetManagement {
* that are not assigned to one of the {@link RolloutGroup}s and are compatible
* with the passed {@link DistributionSetType}.
*
* @param groups
* the list of {@link RolloutGroup}s
* @param rsqlParam
* filter definition in RSQL syntax
* @param distributionSetType
* type of the {@link DistributionSet} the targets must be compatible
* @param groups the list of {@link RolloutGroup}s
* @param rsqlParam filter definition in RSQL syntax
* @param distributionSetType type of the {@link DistributionSet} the targets must be compatible
* with
* @return count of the found {@link Target}s
*/
@@ -356,10 +301,8 @@ public interface TargetManagement {
* assigned to one of the {@link RolloutGroup}s and are compatible with the
* passed {@link DistributionSetType}.
*
* @param groups
* the list of {@link RolloutGroup}s
* @param rolloutId
* rolloutId of the rollout to be retried.
* @param groups the list of {@link RolloutGroup}s
* @param rolloutId rolloutId of the rollout to be retried.
* @return count of the found {@link Target}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -369,14 +312,10 @@ public interface TargetManagement {
* Finds all targets of the provided {@link RolloutGroup} that have no Action
* for the RolloutGroup.
*
* @param pageRequest
* the pageRequest to enhance the query for paging and sorting
* @param group
* the {@link RolloutGroup}
* @param pageRequest the pageRequest to enhance the query for paging and sorting
* @param group the {@link RolloutGroup}
* @return the found {@link Target}s
*
* @throws EntityNotFoundException
* if rollout group with given ID does not exist
* @throws EntityNotFoundException if rollout group with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Slice<Target> findByInRolloutGroupWithoutAction(@NotNull Pageable pageRequest, long group);
@@ -384,16 +323,10 @@ public interface TargetManagement {
/**
* retrieves {@link Target}s by the assigned {@link DistributionSet}.
*
* @param pageReq
* page parameter
* @param distributionSetId
* the ID of the {@link DistributionSet}
*
*
* @param pageReq page parameter
* @param distributionSetId the ID of the {@link DistributionSet}
* @return the found {@link Target}s
*
* @throws EntityNotFoundException
* if distribution set with given ID does not exist
* @throws EntityNotFoundException if distribution set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY_AND_READ_TARGET)
Page<Target> findByAssignedDistributionSet(@NotNull Pageable pageReq, long distributionSetId);
@@ -402,21 +335,14 @@ public interface TargetManagement {
* Retrieves {@link Target}s by the assigned {@link DistributionSet} possible
* including additional filtering based on the given {@code spec}.
*
* @param pageReq
* page parameter
* @param distributionSetId
* the ID of the {@link DistributionSet}
* @param rsqlParam
* the specification to filter the result set
*
* @param pageReq page parameter
* @param distributionSetId the ID of the {@link DistributionSet}
* @param rsqlParam the specification to filter the result set
* @return the found {@link Target}s, never {@code null}
* @throws RSQLParameterUnsupportedFieldException
* if a field in the RSQL string is used but not provided by the
* @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
* if distribution set with given ID does not exist
* @throws RSQLParameterSyntaxException if the RSQL syntax is wrong
* @throws EntityNotFoundException if distribution set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY_AND_READ_TARGET)
Page<Target> findByAssignedDistributionSetAndRsql(@NotNull Pageable pageReq, long distributionSetId,
@@ -425,8 +351,7 @@ public interface TargetManagement {
/**
* Find {@link Target}s based a given IDs.
*
* @param controllerIDs
* to look for.
* @param controllerIDs to look for.
* @return List of found{@link Target}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -435,8 +360,7 @@ public interface TargetManagement {
/**
* Find a {@link Target} based a given ID.
*
* @param controllerId
* to look for.
* @param controllerId to look for.
* @return {@link Target}
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -446,16 +370,11 @@ public interface TargetManagement {
* Filter {@link Target}s for all the given parameters. If all parameters except
* pageable are null, all available {@link Target}s are returned.
*
* @param pageable
* page parameters
* @param filterParams
* the filters to apply; only filters are enabled that have non-null
* @param pageable page parameters
* @param filterParams the filters to apply; only filters are enabled that have non-null
* value; filters are AND-gated
*
* @return the found {@link Target}s
*
* @throws EntityNotFoundException
* if distribution set with given ID does not exist
* @throws EntityNotFoundException if distribution set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Slice<Target> findByFilters(@NotNull Pageable pageable, @NotNull FilterParams filterParams);
@@ -463,15 +382,10 @@ public interface TargetManagement {
/**
* retrieves {@link Target}s by the installed {@link DistributionSet}.
*
* @param pageReq
* page parameter
* @param distributionSetId
* the ID of the {@link DistributionSet}
*
* @param pageReq page parameter
* @param distributionSetId the ID of the {@link DistributionSet}
* @return the found {@link Target}s
*
* @throws EntityNotFoundException
* if distribution set with given ID does not exist
* @throws EntityNotFoundException if distribution set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY_AND_READ_TARGET)
Page<Target> findByInstalledDistributionSet(@NotNull Pageable pageReq, long distributionSetId);
@@ -480,23 +394,14 @@ public interface TargetManagement {
* retrieves {@link Target}s by the installed {@link DistributionSet} including
* additional filtering based on the given {@code spec}.
*
* @param pageReq
* page parameter
* @param distributionSetId
* the ID of the {@link DistributionSet}
* @param rsqlParam
* the specification to filter the result
*
* @param pageReq page parameter
* @param distributionSetId the ID of the {@link DistributionSet}
* @param rsqlParam the specification to filter the result
* @return the found {@link Target}s, never {@code null}
*
* @throws RSQLParameterUnsupportedFieldException
* if a field in the RSQL string is used but not provided by the
* @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
* if distribution set with given ID does not exist
* @throws RSQLParameterSyntaxException if the RSQL syntax is wrong
* @throws EntityNotFoundException if distribution set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY_AND_READ_TARGET)
Page<Target> findByInstalledDistributionSetAndRsql(@NotNull Pageable pageReq, long distributionSetId,
@@ -505,10 +410,8 @@ public interface TargetManagement {
/**
* Retrieves the {@link Target} which have a certain {@link TargetUpdateStatus}.
*
* @param pageable
* page parameter
* @param status
* the {@link TargetUpdateStatus} to be filtered on
* @param pageable page parameter
* @param status the {@link TargetUpdateStatus} to be filtered on
* @return the found {@link Target}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -517,8 +420,7 @@ public interface TargetManagement {
/**
* Retrieves all targets.
*
* @param pageable
* pagination parameter
* @param pageable pagination parameter
* @return the found {@link Target}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -527,19 +429,12 @@ public interface TargetManagement {
/**
* Retrieves all targets.
*
* @param pageable
* pagination parameter
* @param rsqlParam
* in RSQL notation
*
* @param pageable pagination parameter
* @param rsqlParam in RSQL notation
* @return the found {@link Target}s, never {@code null}
*
*
* @throws RSQLParameterUnsupportedFieldException
* if a field in the RSQL string is used but not provided by the
* @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 RSQLParameterSyntaxException if the RSQL syntax is wrong
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Slice<Target> findByRsql(@NotNull Pageable pageable, @NotNull String rsqlParam);
@@ -547,20 +442,13 @@ public interface TargetManagement {
/**
* Retrieves all target based on {@link TargetFilterQuery}.
*
* @param pageable
* pagination parameter
* @param targetFilterQueryId
* {@link TargetFilterQuery#getId()}
*
* @param pageable pagination parameter
* @param targetFilterQueryId {@link TargetFilterQuery#getId()}
* @return the found {@link Target}s, never {@code null}
*
* @throws EntityNotFoundException
* if {@link TargetFilterQuery} with given ID does not exist.
* @throws RSQLParameterUnsupportedFieldException
* if a field in the RSQL string is used but not provided by the
* @throws EntityNotFoundException if {@link TargetFilterQuery} 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
* @throws RSQLParameterSyntaxException if the RSQL syntax is wrong
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Slice<Target> findByTargetFilterQuery(@NotNull Pageable pageable, long targetFilterQueryId);
@@ -577,18 +465,13 @@ public interface TargetManagement {
* {@link DistributionSet}</li>
* </ol>
*
* @param pageable
* the page request to page the result set
* @param orderByDistributionSetId
* {@link DistributionSet#getId()} to be ordered by
* @param filterParams
* the filters to apply; only filters are enabled that have non-null
* @param pageable the page request to page the result set
* @param orderByDistributionSetId {@link DistributionSet#getId()} to be ordered by
* @param filterParams the filters to apply; only filters are enabled that have non-null
* value; filters are AND-gated
* @return a paged result {@link Page} of the {@link Target}s in a defined
* order.
*
* @throws EntityNotFoundException
* if distribution set with given ID does not exist
* @throws EntityNotFoundException if distribution set with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Slice<Target> findByFilterOrderByLinkedDistributionSet(@NotNull Pageable pageable, long orderByDistributionSetId,
@@ -597,14 +480,10 @@ public interface TargetManagement {
/**
* Find targets by tag name.
*
* @param pageable
* the page request parameter for paging and sorting the result
* @param tagId
* tag ID
* @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
* @throws EntityNotFoundException if target tag with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Page<Target> findByTag(@NotNull Pageable pageable, long tagId);
@@ -612,22 +491,14 @@ public interface TargetManagement {
/**
* 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
*
* @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
* @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
* @throws RSQLParameterSyntaxException if the RSQL syntax is wrong
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Page<Target> findByRsqlAndTag(@NotNull Pageable pageable, @NotNull String rsqlParam, long tagId);
@@ -638,15 +509,11 @@ public interface TargetManagement {
* get assigned. If all targets are already of that type, there will be no
* un-assignment.
*
* @param controllerIds
* to set the type to
* @param typeId
* to assign targets to
* @param controllerIds to set the type to
* @param typeId to assign targets to
* @return {@link TargetTypeAssignmentResult} with all metadata of the
* assignment outcome.
*
* @throws EntityNotFoundException
* if target type with given id does not exist
* @throws EntityNotFoundException if target type with given id does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
TargetTypeAssignmentResult assignType(@NotEmpty Collection<String> controllerIds, @NotNull Long typeId);
@@ -655,8 +522,7 @@ public interface TargetManagement {
* Initiates {@link TargetType} un-assignment to given {@link Target}s. The type
* of the targets will be set to {@code null}
*
* @param controllerIds
* to remove the type from
* @param controllerIds to remove the type from
* @return {@link TargetTypeAssignmentResult} with all metadata of the
* assignment outcome.
*/
@@ -718,7 +584,6 @@ public interface TargetManagement {
*
* @param controllerId to un-assign for
* @return the unassigned target
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
Target unassignType(@NotEmpty String controllerId);
@@ -726,14 +591,10 @@ public interface TargetManagement {
/**
* Assign a {@link TargetType} assignment to given {@link Target}.
*
* @param controllerId
* to un-assign for
* @param targetTypeId
* Target type id
* @param controllerId to un-assign for
* @param targetTypeId Target type id
* @return the unassigned target
*
* @throws EntityNotFoundException
* if TargetType with given target ID does not exist
* @throws EntityNotFoundException if TargetType with given target ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
Target assignType(@NotEmpty String controllerId, @NotNull Long targetTypeId);
@@ -741,15 +602,10 @@ public interface TargetManagement {
/**
* updates the {@link Target}.
*
* @param update
* to be updated
*
* @param update to be updated
* @return the updated {@link Target}
*
* @throws EntityNotFoundException
* if given target does not exist
* @throws ConstraintViolationException
* if fields are not filled as specified. Check {@link TargetUpdate}
* @throws EntityNotFoundException if given target does not exist
* @throws ConstraintViolationException if fields are not filled as specified. Check {@link TargetUpdate}
* for field constraints.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
@@ -758,8 +614,7 @@ public interface TargetManagement {
/**
* Find a {@link Target} based a given ID.
*
* @param id
* to look for
* @param id to look for
* @return {@link Target}
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -768,8 +623,7 @@ public interface TargetManagement {
/**
* Retrieves all targets.
*
* @param ids
* the ids to for
* @param ids the ids to for
* @return the found {@link Target}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -778,12 +632,9 @@ public interface TargetManagement {
/**
* Get controller attributes of given {@link Target}.
*
* @param controllerId
* of the target
* @param controllerId of the target
* @return controller attributes as key/value pairs
*
* @throws EntityNotFoundException
* if target with given ID does not exist
* @throws EntityNotFoundException if target with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Map<String, String> getControllerAttributes(@NotEmpty String controllerId);
@@ -791,11 +642,8 @@ public interface TargetManagement {
/**
* Trigger given {@link Target} to update its attributes.
*
* @param controllerId
* of the target
*
* @throws EntityNotFoundException
* if target with given ID does not exist
* @param controllerId of the target
* @throws EntityNotFoundException if target with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
void requestControllerAttributes(@NotEmpty String controllerId);
@@ -803,8 +651,7 @@ public interface TargetManagement {
/**
* Check if update of given {@link Target} attributes is already requested.
*
* @param controllerId
* of target
* @param controllerId of target
* @return {@code true}: update of controller attributes triggered.
* {@code false}: update of controller attributes not requested.
*/
@@ -815,11 +662,8 @@ public interface TargetManagement {
* Retrieves {@link Target}s where
* {@link #isControllerAttributesRequested(String)}.
*
* @param pageReq
* page parameter
*
* @param pageReq page parameter
* @return the found {@link Target}s
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Page<Target> findByControllerAttributesRequested(@NotNull Pageable pageReq);
@@ -828,8 +672,7 @@ public interface TargetManagement {
* Verifies that {@link Target} with given controller ID exists in the
* repository.
*
* @param controllerId
* of target
* @param controllerId of target
* @return {@code true} if target with given ID exists
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -839,15 +682,12 @@ public interface TargetManagement {
* Verify if a target matches a specific target filter query, does not have a
* specific DS already assigned and is compatible with it.
*
* @param controllerId
* of the {@link org.eclipse.hawkbit.repository.model.Target} to
* @param controllerId of the {@link org.eclipse.hawkbit.repository.model.Target} to
* check
* @param distributionSetId
* of the
* @param distributionSetId of the
* {@link org.eclipse.hawkbit.repository.model.DistributionSet} to
* consider
* @param targetFilterQuery
* to execute
* @param targetFilterQuery to execute
* @return true if it matches
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY_AND_READ_TARGET)
@@ -867,21 +707,13 @@ public interface TargetManagement {
/**
* Creates a list of target meta data entries.
*
* @param controllerId
* {@link Target} controller id the metadata has to be created for
* @param metadata
* the meta data entries to create or update
* @param controllerId {@link Target} controller id the metadata has to be created for
* @param metadata the meta data entries to create or update
* @return the updated or created target metadata entries
*
* @throws EntityNotFoundException
* if given target does not exist
*
* @throws EntityAlreadyExistsException
* in case one of the metadata entry already exists for the specific
* @throws EntityNotFoundException if given target does not exist
* @throws EntityAlreadyExistsException in case one of the metadata entry already exists for the specific
* key
*
* @throws AssignmentQuotaExceededException
* if the maximum number of {@link MetaData} entries is exceeded for
* @throws AssignmentQuotaExceededException if the maximum number of {@link MetaData} entries is exceeded for
* the addressed {@link Target}
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
@@ -890,13 +722,9 @@ public interface TargetManagement {
/**
* Deletes a target meta data entry.
*
* @param controllerId
* where metadata has to be deleted
* @param key
* of the meta data element
*
* @throws EntityNotFoundException
* if given target does not exist
* @param controllerId where metadata has to be deleted
* @param key of the meta data element
* @throws EntityNotFoundException if given target does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
void deleteMetaData(@NotEmpty String controllerId, @NotEmpty String key);
@@ -904,15 +732,10 @@ public interface TargetManagement {
/**
* Finds all meta data by the given target id.
*
* @param pageable
* the page request to page the result
* @param controllerId
* the controller id to retrieve the metadata from
*
* @param pageable the page request to page the result
* @param controllerId the controller id to retrieve the metadata from
* @return a paged result of all meta data entries for a given target id
*
* @throws EntityNotFoundException
* if target with given ID does not exist
* @throws EntityNotFoundException if target with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Page<TargetMetadata> findMetaDataByControllerId(@NotNull Pageable pageable, @NotEmpty String controllerId);
@@ -920,13 +743,9 @@ public interface TargetManagement {
/**
* Counts all meta data by the given target id.
*
* @param controllerId
* the controller id to retrieve the meta data from
*
* @param controllerId the controller id to retrieve the meta data from
* @return count of all meta data entries for a given target id
*
* @throws EntityNotFoundException
* if target with given ID does not exist
* @throws EntityNotFoundException if target with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
long countMetaDataByControllerId(@NotEmpty String controllerId);
@@ -934,24 +753,14 @@ public interface TargetManagement {
/**
* Finds all metadata by the given target id and query.
*
* @param pageable
* the page request to page the result
* @param controllerId
* the controller id to retrieve the metadata from
* @param rsqlParam
* rsql query string
*
* @param pageable the page request to page the result
* @param controllerId the controller id to retrieve the metadata from
* @param rsqlParam rsql query string
* @return a paged result of all meta data entries for a given target id
*
* @throws RSQLParameterUnsupportedFieldException
* if a field in the RSQL string is used but not provided by the
* @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
* if target with given ID does not exist
* @throws RSQLParameterSyntaxException if the RSQL syntax is wrong
* @throws EntityNotFoundException if target with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Page<TargetMetadata> findMetaDataByControllerIdAndRsql(@NotNull Pageable pageable, @NotEmpty String controllerId,
@@ -960,14 +769,10 @@ public interface TargetManagement {
/**
* Finds a single target meta data by its id.
*
* @param controllerId
* of the {@link Target}
* @param key
* of the meta data element
* @param controllerId of the {@link Target}
* @param key of the meta data element
* @return the found TargetMetadata
*
* @throws EntityNotFoundException
* if target with given ID does not exist
* @throws EntityNotFoundException if target with given ID does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
Optional<TargetMetadata> getMetaDataByControllerId(@NotEmpty String controllerId, @NotEmpty String key);
@@ -975,14 +780,10 @@ public interface TargetManagement {
/**
* Updates a target meta data value if corresponding entry exists.
*
* @param controllerId
* {@link Target} controller id of the metadata entry to be updated
* @param metadata
* meta data entry to be updated
* @param controllerId {@link Target} controller id of the metadata entry to be updated
* @param metadata meta data entry to be updated
* @return the updated meta data entry
*
* @throws EntityNotFoundException
* in case the metadata entry does not exist and cannot be updated
* @throws EntityNotFoundException in case the metadata entry does not exist and cannot be updated
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
TargetMetadata updateMetadata(@NotEmpty String controllerId, @NotNull MetaData metadata);
@@ -993,11 +794,11 @@ public interface TargetManagement {
* assigned, they will be. Only if all of them have the tag already assigned
* they will be removed instead.
*
* @deprecated since 0.6.0 - not very usable with very unclear logic
* @param controllerIds to toggle for
* @param tagName to toggle
* @return TagAssigmentResult with all metadata of the assignment outcome.
* @throws EntityNotFoundException if tag with given name does not exist
* @deprecated since 0.6.0 - not very usable with very unclear logic
*/
@Deprecated
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
@@ -1006,11 +807,11 @@ public interface TargetManagement {
/**
* Un-assign a {@link TargetTag} assignment to given {@link Target}.
*
* @deprecated since 0.6.0 - use {@link #unassignTag(Collection, long)} (List, long)} instead
* @param controllerId to un-assign for
* @param targetTagId to un-assign
* @return the unassigned target or <null> if no target is unassigned
* @throws EntityNotFoundException if TAG with given ID does not exist
* @deprecated since 0.6.0 - use {@link #unassignTag(Collection, long)} (List, long)} instead
*/
@Deprecated(forRemoval = true)
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)

View File

@@ -12,7 +12,6 @@ package org.eclipse.hawkbit.repository;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import jakarta.validation.ConstraintViolationException;
import jakarta.validation.Valid;
@@ -130,7 +129,6 @@ public interface TargetTagManagement {
*
* @param update the {@link TargetTag} with updated values
* @return the updated {@link TargetTag}
*
* @throws EntityNotFoundException in case the {@link TargetTag} does not exist and cannot be updated
* @throws ConstraintViolationException if fields are not filled as specified. Check {@link TagUpdate} for field constraints.
*/

View File

@@ -28,21 +28,18 @@ import org.springframework.security.access.prepost.PreAuthorize;
/**
* Management service for {@link TargetType}s.
*
*/
public interface TargetTypeManagement {
/**
* @param key
* as {@link TargetType#getKey()}
* @param key as {@link TargetType#getKey()}
* @return {@link TargetType}
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Optional<TargetType> getByKey(@NotEmpty String key);
/**
* @param name
* as {@link TargetType#getName()}
* @param name as {@link TargetType#getName()}
* @return {@link TargetType}
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -55,49 +52,42 @@ public interface TargetTypeManagement {
long count();
/**
* @param name
* as {@link TargetType#getName()}
* @param name as {@link TargetType#getName()}
* @return total count by name
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.HAS_AUTH_READ_TARGET)
long countByName(String name);
/**
* @param create
* TargetTypeCreate
* @param create TargetTypeCreate
* @return targetType
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.HAS_AUTH_CREATE_TARGET)
TargetType create(@NotNull @Valid TargetTypeCreate create);
/**
* @param creates
* List of TargetTypeCreate
* @param creates List of TargetTypeCreate
* @return List of targetType
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.HAS_AUTH_CREATE_TARGET)
List<TargetType> create(@NotEmpty @Valid Collection<TargetTypeCreate> creates);
/**
* @param id
* targetTypeId
* @param id targetTypeId
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.HAS_AUTH_DELETE_TARGET)
void delete(@NotNull Long id);
/**
* @param pageable
* Page
* @param pageable Page
* @return TargetType page
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Slice<TargetType> findAll(@NotNull Pageable pageable);
/**
* @param pageable
* Page
* @param rsqlParam
* query param
* @param pageable Page
* @param rsqlParam query param
* @return Target type
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -106,44 +96,37 @@ public interface TargetTypeManagement {
/**
* Retrieves {@link TargetType}s by filtering on the given parameters.
*
* @param pageable
* page parameter
* @param name
* has text of filters to be applied.
* @param pageable page parameter
* @param name has text of filters to be applied.
* @return the page of found {@link TargetType}
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Slice<TargetType> findByName(@NotNull Pageable pageable, String name);
/**
* @param id
* Target type ID
* @param id Target type ID
* @return Target Type
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Optional<TargetType> get(long id);
/**
* @param ids
* List of Target type ID
* @param ids List of Target type ID
* @return Target type list
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.HAS_AUTH_READ_TARGET)
List<TargetType> get(@NotEmpty Collection<Long> ids);
/**
* @param update
* TargetTypeUpdate
* @param update TargetTypeUpdate
* @return Target Type
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
TargetType update(@NotNull @Valid TargetTypeUpdate update);
/**
* @param id
* Target type ID
* @param distributionSetTypeIds
* Distribution set ID
* @param id Target type ID
* @param distributionSetTypeIds Distribution set ID
* @return Target type
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY_AND_UPDATE_TARGET)
@@ -151,10 +134,8 @@ public interface TargetTypeManagement {
@NotEmpty Collection<Long> distributionSetTypeIds);
/**
* @param id
* Target type ID
* @param distributionSetTypeIds
* Distribution set ID
* @param id Target type ID
* @param distributionSetTypeIds Distribution set ID
* @return Target type
*/
@PreAuthorize(SpPermission.SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY_AND_UPDATE_TARGET)

View File

@@ -30,25 +30,19 @@ import org.springframework.security.access.prepost.PreAuthorize;
/**
* Management service for tenant configurations.
*
*/
public interface TenantConfigurationManagement {
/**
* Adds or updates a specific configuration for a specific tenant.
*
*
* @param configurationKeyName
* the key of the configuration
* @param value
* the configuration value which will be written into the
* @param configurationKeyName the key of the configuration
* @param value the configuration value which will be written into the
* database.
* @return the configuration value which was just written into the database.
* @throws TenantConfigurationValidatorException
* if the {@code propertyType} and the value in general does not
* @throws TenantConfigurationValidatorException if the {@code propertyType} and the value in general does not
* match the expected type and format defined by the Key
* @throws ConversionFailedException
* if the property cannot be converted to the given
* @throws ConversionFailedException if the property cannot be converted to the given
*/
@PreAuthorize(value = SpringEvalExpressions.HAS_AUTH_TENANT_CONFIGURATION)
<T extends Serializable> TenantConfigurationValue<T> addOrUpdateConfiguration(String configurationKeyName, T value);
@@ -56,15 +50,11 @@ public interface TenantConfigurationManagement {
/**
* Adds or updates a specific configuration for a specific tenant.
*
*
* @param configurations
* map containing the key - value of the configuration
* @param configurations map containing the key - value of the configuration
* @return map of all configuration values which were written into the database.
* @throws TenantConfigurationValidatorException
* if the {@code propertyType} and the value in general does not
* @throws TenantConfigurationValidatorException if the {@code propertyType} and the value in general does not
* match the expected type and format defined by the Key
* @throws ConversionFailedException
* if the property cannot be converted to the given
* @throws ConversionFailedException if the property cannot be converted to the given
*/
@PreAuthorize(value = SpringEvalExpressions.HAS_AUTH_TENANT_CONFIGURATION)
<T extends Serializable> Map<String, TenantConfigurationValue<T>> addOrUpdateConfiguration(Map<String, T> configurations);
@@ -73,8 +63,7 @@ public interface TenantConfigurationManagement {
* Deletes a specific configuration for the current tenant. Does nothing in
* case there is no tenant specific configuration value.
*
* @param configurationKey
* the configuration key to be deleted
* @param configurationKey the configuration key to be deleted
*/
@PreAuthorize(value = SpringEvalExpressions.HAS_AUTH_TENANT_CONFIGURATION)
void deleteConfiguration(String configurationKey);
@@ -84,17 +73,14 @@ public interface TenantConfigurationManagement {
* configuration values or in case the tenant does not a have a specific
* configuration the global default value hold in the {@link Environment}.
*
* @param configurationKeyName
* the key of the configuration
* @param configurationKeyName the key of the configuration
* @return the converted configuration value either from the tenant specific
* configuration stored or from the fall back default values or
* {@code null} in case key has not been configured and not default
* value exists
* @throws TenantConfigurationValidatorException
* if the {@code propertyType} and the value in general does not
* @throws TenantConfigurationValidatorException if the {@code propertyType} and the value in general does not
* match the expected type and format defined by the Key
* @throws ConversionFailedException
* if the property cannot be converted to the given
* @throws ConversionFailedException if the property cannot be converted to the given
* {@code propertyType}
*/
@PreAuthorize(value = SpringEvalExpressions.HAS_AUTH_TENANT_CONFIGURATION_READ)
@@ -105,22 +91,17 @@ public interface TenantConfigurationManagement {
* configuration values or in case the tenant does not a have a specific
* configuration the global default value hold in the {@link Environment}.
*
* @param <T>
* the type of the configuration value
* @param configurationKeyName
* the key of the configuration
* @param propertyType
* the type of the configuration value, e.g. {@code String.class}
* @param <T> the type of the configuration value
* @param configurationKeyName the key of the configuration
* @param propertyType the type of the configuration value, e.g. {@code String.class}
* , {@code Integer.class}, etc
* @return the converted configuration value either from the tenant specific
* configuration stored or from the fallback default values or
* {@code null} in case key has not been configured and not default
* value exists
* @throws TenantConfigurationValidatorException
* if the {@code propertyType} and the value in general does not
* @throws TenantConfigurationValidatorException if the {@code propertyType} and the value in general does not
* match the expected type and format defined by the Key
* @throws ConversionFailedException
* if the property cannot be converted to the given
* @throws ConversionFailedException if the property cannot be converted to the given
* {@code propertyType}
*/
@PreAuthorize(value = SpringEvalExpressions.HAS_AUTH_TENANT_CONFIGURATION_READ)
@@ -131,20 +112,15 @@ public interface TenantConfigurationManagement {
* returns the global configuration property either defined in the property
* file or an default value otherwise.
*
* @param <T>
* the type of the configuration value
* @param configurationKeyName
* the key of the configuration
* @param propertyType
* the type of the configuration value, e.g. {@code String.class}
* @param <T> the type of the configuration value
* @param configurationKeyName the key of the configuration
* @param propertyType the type of the configuration value, e.g. {@code String.class}
* , {@code Integer.class}, etc
* @return the global configured value
* @throws TenantConfigurationValidatorException
* if the {@code propertyType} and the value in the property
* @throws TenantConfigurationValidatorException if the {@code propertyType} and the value in the property
* file or the default value does not match the expected type
* and format defined by the Key
* @throws ConversionFailedException
* if the property cannot be converted to the given
* @throws ConversionFailedException if the property cannot be converted to the given
* {@code propertyType}
*/
@PreAuthorize(value = SpringEvalExpressions.HAS_AUTH_TENANT_CONFIGURATION_READ)

View File

@@ -15,7 +15,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
/**
* Management service for statistics of a single tenant.
*
*/
@FunctionalInterface
public interface TenantStatsManagement {

View File

@@ -19,7 +19,6 @@ import jakarta.validation.Payload;
/**
* Constraint for strings submitted into the repository.
*
*/
@Constraint(validatedBy = ValidStringValidator.class)
@Target({ ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR,

View File

@@ -9,11 +9,10 @@
*/
package org.eclipse.hawkbit.repository;
import com.cronutils.utils.StringUtils;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import com.cronutils.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
@@ -34,15 +33,6 @@ public class ValidStringValidator implements ConstraintValidator<ValidString, St
return StringUtils.isEmpty(value) || isValidString(value);
}
private boolean isValidString(final String value) {
try {
return cleaner.isValid(stringToDocument(value));
} catch (final Exception ex) {
log.error(String.format("There was an exception during bean field value (%s) validation", value), ex);
return false;
}
}
private static Document stringToDocument(final String value) {
final Document xmlFragment = Jsoup.parse(value, "", Parser.xmlParser());
final Document resultingDocument = Document.createShell("");
@@ -51,4 +41,13 @@ public class ValidStringValidator implements ConstraintValidator<ValidString, St
return resultingDocument;
}
private boolean isValidString(final String value) {
try {
return cleaner.isValid(stringToDocument(value));
} catch (final Exception ex) {
log.error(String.format("There was an exception during bean field value (%s) validation", value), ex);
return false;
}
}
}

View File

@@ -25,8 +25,7 @@ public interface AutoAssignExecutor {
/**
* Method performs an auto assign check for a specific device only
*
* @param controllerId
* of the device to check
* @param controllerId of the device to check
*/
void checkSingleTarget(String controllerId);

View File

@@ -13,14 +13,12 @@ import org.eclipse.hawkbit.repository.model.ActionStatus;
/**
* Builder for {@link ActionStatus}.
*
*/
@FunctionalInterface
public interface ActionStatusBuilder {
/**
* @param actionId
* the status is for
* @param actionId the status is for
* @return create builder
*/
ActionStatusCreate create(long actionId);

View File

@@ -21,19 +21,17 @@ import org.eclipse.hawkbit.repository.model.BaseEntity;
* Builder to create a new {@link ActionStatus} entry. Defines all fields that
* can be set at creation time. Other fields are set by the repository
* automatically, e.g. {@link BaseEntity#getCreatedAt()}.
*
*/
public interface ActionStatusCreate {
/**
* @param status
* {@link ActionStatus#getStatus()}
* @param status {@link ActionStatus#getStatus()}
* @return updated {@link ActionStatusCreate} object
*/
ActionStatusCreate status(@NotNull Status status);
/**
* @param occurredAt
* for {@link ActionStatus#getOccurredAt()}
* @param occurredAt for {@link ActionStatus#getOccurredAt()}
* @return updated {@link ActionStatusCreate} object
*/
ActionStatusCreate occurredAt(long occurredAt);
@@ -41,15 +39,13 @@ public interface ActionStatusCreate {
ActionStatusCreate code(int code);
/**
* @param messages
* for {@link ActionStatus#getMessages()}
* @param messages for {@link ActionStatus#getMessages()}
* @return updated {@link ActionStatusCreate} object
*/
ActionStatusCreate messages(Collection<String> messages);
/**
* @param message
* for {@link ActionStatus#getMessages()}
* @param message for {@link ActionStatus#getMessages()}
* @return updated {@link ActionStatusCreate} object
*/
ActionStatusCreate message(String message);

View File

@@ -42,8 +42,7 @@ public class AutoAssignDistributionSetUpdate {
/**
* Constructor
*
* @param targetFilterId
* ID of {@link TargetFilterQuery} to update
* @param targetFilterId ID of {@link TargetFilterQuery} to update
*/
public AutoAssignDistributionSetUpdate(final long targetFilterId) {
this.targetFilterId = targetFilterId;
@@ -52,8 +51,7 @@ public class AutoAssignDistributionSetUpdate {
/**
* Specify {@link DistributionSet}
*
* @param dsId
* ID of the {@link DistributionSet}
* @param dsId ID of the {@link DistributionSet}
* @return updated builder instance
*/
public AutoAssignDistributionSetUpdate ds(final Long dsId) {
@@ -64,8 +62,7 @@ public class AutoAssignDistributionSetUpdate {
/**
* Specify {@link DistributionSet}
*
* @param actionType
* {@link ActionType} used for the auto assignment
* @param actionType {@link ActionType} used for the auto assignment
* @return updated builder instance
*/
public AutoAssignDistributionSetUpdate actionType(final ActionType actionType) {
@@ -76,8 +73,7 @@ public class AutoAssignDistributionSetUpdate {
/**
* Specify weight of resulting {@link Action}
*
* @param weight
* weight used for the auto assignment
* @param weight weight used for the auto assignment
* @return updated builder instance
*/
public AutoAssignDistributionSetUpdate weight(final Integer weight) {
@@ -88,8 +84,7 @@ public class AutoAssignDistributionSetUpdate {
/**
* Specify initial confirmation state of resulting {@link Action}
*
* @param confirmationRequired
* if confirmation is required for this auto assignment (considered
* @param confirmationRequired if confirmation is required for this auto assignment (considered
* with confirmation flow active)
* @return updated builder instance
*/

View File

@@ -13,13 +13,11 @@ import org.eclipse.hawkbit.repository.model.DistributionSet;
/**
* Builder for {@link DistributionSet}.
*
*/
public interface DistributionSetBuilder {
/**
* @param id
* of the updatable entity
* @param id of the updatable entity
* @return builder instance
*/
DistributionSetUpdate update(long id);

View File

@@ -25,41 +25,35 @@ import org.eclipse.hawkbit.repository.model.NamedVersionedEntity;
* Builder to create a new {@link DistributionSet} entry. Defines all fields
* that can be set at creation time. Other fields are set by the repository
* automatically, e.g. {@link BaseEntity#getCreatedAt()}.
*
*/
public interface DistributionSetCreate {
/**
* @param name
* for {@link DistributionSet#getName()}
* @param name for {@link DistributionSet#getName()}
* @return updated builder instance
*/
DistributionSetCreate name(@Size(min = 1, max = NamedEntity.NAME_MAX_SIZE) @NotNull String name);
/**
* @param version
* for {@link DistributionSet#getVersion()}
* @param version for {@link DistributionSet#getVersion()}
* @return updated builder instance
*/
DistributionSetCreate version(@Size(min = 1, max = NamedVersionedEntity.VERSION_MAX_SIZE) @NotNull String version);
/**
* @param description
* for {@link DistributionSet#getDescription()}
* @param description for {@link DistributionSet#getDescription()}
* @return updated builder instance
*/
DistributionSetCreate description(@Size(max = NamedEntity.DESCRIPTION_MAX_SIZE) String description);
/**
* @param typeKey
* for {@link DistributionSet#getType()}
* @param typeKey for {@link DistributionSet#getType()}
* @return updated builder instance
*/
DistributionSetCreate type(@Size(min = 1, max = DistributionSetType.KEY_MAX_SIZE) @NotNull String typeKey);
/**
* @param type
* for {@link DistributionSet#getType()}
* @param type for {@link DistributionSet#getType()}
* @return updated builder instance
*/
default DistributionSetCreate type(final DistributionSetType type) {
@@ -67,15 +61,13 @@ public interface DistributionSetCreate {
}
/**
* @param modules
* for {@link DistributionSet#getModules()}
* @param modules for {@link DistributionSet#getModules()}
* @return updated builder instance
*/
DistributionSetCreate modules(Collection<Long> modules);
/**
* @param requiredMigrationStep
* for {@link DistributionSet#isRequiredMigrationStep()}
* @param requiredMigrationStep for {@link DistributionSet#isRequiredMigrationStep()}
* @return updated builder instance
*/
DistributionSetCreate requiredMigrationStep(Boolean requiredMigrationStep);

View File

@@ -13,13 +13,11 @@ import org.eclipse.hawkbit.repository.model.DistributionSetType;
/**
* Builder for {@link DistributionSetType}.
*
*/
public interface DistributionSetTypeBuilder {
/**
* @param id
* of the updatable entity
* @param id of the updatable entity
* @return builder instance
*/
DistributionSetTypeUpdate update(long id);

View File

@@ -25,48 +25,41 @@ import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
* Builder to create a new {@link DistributionSetType} entry. Defines all fields
* that can be set at creation time. Other fields are set by the repository
* automatically, e.g. {@link BaseEntity#getCreatedAt()}.
*
*/
public interface DistributionSetTypeCreate {
/**
* @param key
* for {@link DistributionSetType#getKey()}
* @param key for {@link DistributionSetType#getKey()}
* @return updated builder instance
*/
DistributionSetTypeCreate key(@Size(min = 1, max = DistributionSetType.KEY_MAX_SIZE) @NotNull String key);
/**
* @param name
* for {@link DistributionSetType#getName()}
* @param name for {@link DistributionSetType#getName()}
* @return updated builder instance
*/
DistributionSetTypeCreate name(@Size(min = 1, max = NamedEntity.NAME_MAX_SIZE) @NotNull String name);
/**
* @param description
* for {@link DistributionSetType#getDescription()}
* @param description for {@link DistributionSetType#getDescription()}
* @return updated builder instance
*/
DistributionSetTypeCreate description(@Size(max = NamedEntity.DESCRIPTION_MAX_SIZE) String description);
/**
* @param colour
* for {@link DistributionSetType#getColour()}
* @param colour for {@link DistributionSetType#getColour()}
* @return updated builder instance
*/
DistributionSetTypeCreate colour(@Size(max = DistributionSetType.COLOUR_MAX_SIZE) String colour);
/**
* @param mandatory
* for {@link DistributionSetType#getMandatoryModuleTypes()}
* @param mandatory for {@link DistributionSetType#getMandatoryModuleTypes()}
* @return updated builder instance
*/
DistributionSetTypeCreate mandatory(Collection<Long> mandatory);
/**
* @param mandatory
* for {@link DistributionSetType#getMandatoryModuleTypes()}
* @param mandatory for {@link DistributionSetType#getMandatoryModuleTypes()}
* @return updated builder instance
*/
default DistributionSetTypeCreate mandatory(final Long mandatory) {
@@ -74,8 +67,7 @@ public interface DistributionSetTypeCreate {
}
/**
* @param mandatory
* for {@link DistributionSetType#getOptionalModuleTypes()}
* @param mandatory for {@link DistributionSetType#getOptionalModuleTypes()}
* @return updated builder instance
*/
default DistributionSetTypeCreate mandatory(final SoftwareModuleType mandatory) {
@@ -83,15 +75,13 @@ public interface DistributionSetTypeCreate {
}
/**
* @param optional
* for {@link DistributionSetType#getOptionalModuleTypes()}
* @param optional for {@link DistributionSetType#getOptionalModuleTypes()}
* @return updated builder instance
*/
DistributionSetTypeCreate optional(Collection<Long> optional);
/**
* @param optional
* for {@link DistributionSetType#getOptionalModuleTypes()}
* @param optional for {@link DistributionSetType#getOptionalModuleTypes()}
* @return updated builder instance
*/
default DistributionSetTypeCreate optional(final Long optional) {
@@ -99,8 +89,7 @@ public interface DistributionSetTypeCreate {
}
/**
* @param optional
* for {@link DistributionSetType#getOptionalModuleTypes()}
* @param optional for {@link DistributionSetType#getOptionalModuleTypes()}
* @return updated builder instance
*/
default DistributionSetTypeCreate optional(final SoftwareModuleType optional) {

View File

@@ -19,34 +19,29 @@ import org.eclipse.hawkbit.repository.model.NamedEntity;
/**
* Builder to update an existing {@link DistributionSetType} entry. Defines all
* fields that can be updated.
*
*/
public interface DistributionSetTypeUpdate {
/**
* @param description
* for {@link DistributionSetType#getDescription()}
* @param description for {@link DistributionSetType#getDescription()}
* @return updated builder instance
*/
DistributionSetTypeUpdate description(@Size(max = NamedEntity.DESCRIPTION_MAX_SIZE) String description);
/**
* @param colour
* for {@link DistributionSetType#getColour()}
* @param colour for {@link DistributionSetType#getColour()}
* @return updated builder instance
*/
DistributionSetTypeUpdate colour(@Size(max = DistributionSetType.COLOUR_MAX_SIZE) String colour);
/**
* @param mandatory
* for {@link DistributionSetType#getMandatoryModuleTypes()}
* @param mandatory for {@link DistributionSetType#getMandatoryModuleTypes()}
* @return updated builder instance
*/
DistributionSetTypeUpdate mandatory(Collection<Long> mandatory);
/**
* @param optional
* for {@link DistributionSetType#getOptionalModuleTypes()}
* @param optional for {@link DistributionSetType#getOptionalModuleTypes()}
* @return updated builder instance
*/
DistributionSetTypeUpdate optional(Collection<Long> optional);

View File

@@ -17,14 +17,12 @@ import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.repository.model.NamedEntity;
import org.eclipse.hawkbit.repository.model.NamedVersionedEntity;
import java.util.Optional;
/**
* Builder to update an existing {@link DistributionSet} entry. Defines all
* fields that can be updated.
*
*/
public interface DistributionSetUpdate {
/**
* @param name for {@link DistributionSet#getName()}
* @return updated builder instance

View File

@@ -10,6 +10,7 @@
package org.eclipse.hawkbit.repository.builder;
import jakarta.validation.constraints.NotNull;
import lombok.Builder;
import lombok.Data;
import org.eclipse.hawkbit.repository.model.RolloutGroupConditions;

View File

@@ -25,7 +25,6 @@ import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
* Builder to create a new {@link Rollout} entry. Defines all fields that can be
* set at creation time. Other fields are set by the repository automatically,
* e.g. {@link BaseEntity#getCreatedAt()}.
*
*/
public interface RolloutCreate {

View File

@@ -26,6 +26,7 @@ import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
* automatically, e.g. {@link BaseEntity#getCreatedAt()}.
*/
public interface RolloutGroupCreate {
/**
* @param name for {@link Rollout#getName()}
* @return updated builder instance

View File

@@ -20,6 +20,7 @@ import org.eclipse.hawkbit.repository.model.Rollout;
* can be updated.
*/
public interface RolloutUpdate {
/**
* Set name of the {@link Rollout}
*

View File

@@ -13,13 +13,11 @@ import org.eclipse.hawkbit.repository.model.SoftwareModule;
/**
* Builder for {@link SoftwareModule}.
*
*/
public interface SoftwareModuleBuilder {
/**
* @param id
* of the updatable entity
* @param id of the updatable entity
* @return builder instance
*/
SoftwareModuleUpdate update(long id);

View File

@@ -24,47 +24,41 @@ import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
* Builder to create a new {@link SoftwareModule} entry. Defines all fields that
* can be set at creation time. Other fields are set by the repository
* automatically, e.g. {@link BaseEntity#getCreatedAt()}.
*
*/
public interface SoftwareModuleCreate {
/**
* @param name
* for {@link SoftwareModule#getName()}
* @param name for {@link SoftwareModule#getName()}
* @return updated builder instance
*/
SoftwareModuleCreate name(@Size(min = 1, max = NamedEntity.NAME_MAX_SIZE) @NotNull String name);
/**
* @param version
* for {@link SoftwareModule#getVersion()}
* @param version for {@link SoftwareModule#getVersion()}
* @return updated builder instance
*/
SoftwareModuleCreate version(@Size(min = 1, max = NamedVersionedEntity.VERSION_MAX_SIZE) @NotNull String version);
/**
* @param description
* for {@link SoftwareModule#getDescription()}
* @param description for {@link SoftwareModule#getDescription()}
* @return updated builder instance
*/
SoftwareModuleCreate description(@Size(max = NamedEntity.DESCRIPTION_MAX_SIZE) String description);
/**
* @param vendor
* for {@link SoftwareModule#getVendor()}
* @param vendor for {@link SoftwareModule#getVendor()}
* @return updated builder instance
*/
SoftwareModuleCreate vendor(@Size(max = SoftwareModule.VENDOR_MAX_SIZE) String vendor);
/**
* @param typeKey
* for {@link SoftwareModule#getType()}
* @param typeKey for {@link SoftwareModule#getType()}
* @return updated builder instance
*/
SoftwareModuleCreate type(@Size(min = 1, max = SoftwareModuleType.KEY_MAX_SIZE) @NotNull String typeKey);
/**
* @param type
* for {@link SoftwareModule#getType()}
* @param type for {@link SoftwareModule#getType()}
* @return updated builder instance
*/
default SoftwareModuleCreate type(final SoftwareModuleType type) {
@@ -72,8 +66,7 @@ public interface SoftwareModuleCreate {
}
/**
* @param encrypted
* if should be encrypted
* @param encrypted if should be encrypted
* @return updated builder instance
*/
SoftwareModuleCreate encrypted(boolean encrypted);

View File

@@ -15,22 +15,18 @@ import org.eclipse.hawkbit.repository.model.SoftwareModuleMetadata;
/**
* Builder for {@link SoftwareModuleMetadata}.
*
*/
public interface SoftwareModuleMetadataBuilder {
/**
* @param softwareModuleId
* of the {@link SoftwareModule} the {@link MetaData} belongs to
* @param key
* of {@link MetaData#getKey()}
* @param softwareModuleId of the {@link SoftwareModule} the {@link MetaData} belongs to
* @param key of {@link MetaData#getKey()}
* @return builder instance
*/
SoftwareModuleMetadataUpdate update(long softwareModuleId, String key);
/**
* @param softwareModuleId
* of the {@link SoftwareModule} the {@link MetaData} belongs to
* @param softwareModuleId of the {@link SoftwareModule} the {@link MetaData} belongs to
* @return builder instance
*/
SoftwareModuleMetadataCreate create(long softwareModuleId);

View File

@@ -20,27 +20,23 @@ import org.eclipse.hawkbit.repository.model.SoftwareModuleMetadata;
* Builder to create a new {@link SoftwareModuleMetadata} entry. Defines all
* fields that can be set at creation time. Other fields are set by the
* repository automatically, e.g. {@link BaseEntity#getCreatedAt()}.
*
*/
public interface SoftwareModuleMetadataCreate {
/**
* @param key
* for {@link MetaData#getKey()}
* @param key for {@link MetaData#getKey()}
* @return updated builder instance
*/
SoftwareModuleMetadataCreate key(@Size(min = 1, max = MetaData.KEY_MAX_SIZE) @NotNull String key);
/**
* @param value
* for {@link MetaData#getValue()}
* @param value for {@link MetaData#getValue()}
* @return updated builder instance
*/
SoftwareModuleMetadataCreate value(@Size(max = MetaData.VALUE_MAX_SIZE) String value);
/**
* @param visible
* for {@link SoftwareModuleMetadata#isTargetVisible()}
* @param visible for {@link SoftwareModuleMetadata#isTargetVisible()}
* @return updated builder instance
*/
SoftwareModuleMetadataCreate targetVisible(Boolean visible);

View File

@@ -18,19 +18,17 @@ import org.eclipse.hawkbit.repository.model.SoftwareModuleMetadata;
/**
* Builder to update an existing {@link SoftwareModuleMetadata} entry. Defines
* all fields that can be updated.
*
*/
public interface SoftwareModuleMetadataUpdate {
/**
* @param value
* for {@link MetaData#getValue()}
* @param value for {@link MetaData#getValue()}
* @return updated builder instance
*/
SoftwareModuleMetadataUpdate value(@Size(min = 1, max = MetaData.VALUE_MAX_SIZE) @NotNull String value);
/**
* @param visible
* for {@link SoftwareModuleMetadata#isTargetVisible()}
* @param visible for {@link SoftwareModuleMetadata#isTargetVisible()}
* @return updated builder instance
*/
SoftwareModuleMetadataUpdate targetVisible(Boolean visible);

View File

@@ -13,13 +13,11 @@ import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
/**
* Builder for {@link SoftwareModuleType}.
*
*/
public interface SoftwareModuleTypeBuilder {
/**
* @param id
* of the updatable entity
* @param id of the updatable entity
* @return builder instance
*/
SoftwareModuleTypeUpdate update(long id);

View File

@@ -20,40 +20,35 @@ import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
* Builder to create a new {@link SoftwareModuleType} entry. Defines all fields
* that can be set at creation time. Other fields are set by the repository
* automatically, e.g. {@link BaseEntity#getCreatedAt()}.
*
*/
public interface SoftwareModuleTypeCreate {
/**
* @param key
* for {@link SoftwareModuleType#getKey()}
* @param key for {@link SoftwareModuleType#getKey()}
* @return updated builder instance
*/
SoftwareModuleTypeCreate key(@Size(min = 1, max = SoftwareModuleType.KEY_MAX_SIZE) @NotNull String key);
/**
* @param name
* for {@link SoftwareModuleType#getName()}
* @param name for {@link SoftwareModuleType#getName()}
* @return updated builder instance
*/
SoftwareModuleTypeCreate name(@Size(min = 1, max = NamedEntity.NAME_MAX_SIZE) @NotNull String name);
/**
* @param description
* for {@link SoftwareModuleType#getDescription()}
* @param description for {@link SoftwareModuleType#getDescription()}
* @return updated builder instance
*/
SoftwareModuleTypeCreate description(@Size(max = NamedEntity.DESCRIPTION_MAX_SIZE) String description);
/**
* @param colour
* for {@link SoftwareModuleType#getColour()}
* @param colour for {@link SoftwareModuleType#getColour()}
* @return updated builder instance
*/
SoftwareModuleTypeCreate colour(@Size(max = SoftwareModuleType.COLOUR_MAX_SIZE) String colour);
/**
* @param maxAssignments
* for {@link SoftwareModuleType#getMaxAssignments()}
* @param maxAssignments for {@link SoftwareModuleType#getMaxAssignments()}
* @return updated builder instance
*/
SoftwareModuleTypeCreate maxAssignments(int maxAssignments);

View File

@@ -17,19 +17,17 @@ import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
/**
* Builder to update an existing {@link SoftwareModuleType} entry. Defines all
* fields that can be updated.
*
*/
public interface SoftwareModuleTypeUpdate {
/**
* @param description
* for {@link SoftwareModuleType#getDescription()}
* @param description for {@link SoftwareModuleType#getDescription()}
* @return updated builder instance
*/
SoftwareModuleTypeUpdate description(@Size(max = NamedEntity.DESCRIPTION_MAX_SIZE) String description);
/**
* @param colour
* for {@link SoftwareModuleType#getColour()}
* @param colour for {@link SoftwareModuleType#getColour()}
* @return updated builder instance
*/
SoftwareModuleTypeUpdate colour(@Size(max = SoftwareModuleType.COLOUR_MAX_SIZE) String colour);

View File

@@ -9,7 +9,6 @@
*/
package org.eclipse.hawkbit.repository.builder;
import jakarta.annotation.Nullable;
import jakarta.validation.constraints.Null;
import jakarta.validation.constraints.Size;
@@ -19,20 +18,17 @@ import org.eclipse.hawkbit.repository.model.SoftwareModule;
/**
* Builder to update an existing {@link SoftwareModule} entry. Defines all
* fields that can be updated.
*
*/
public interface SoftwareModuleUpdate {
/**
* @param description
* for {@link SoftwareModule#getDescription()}
* @param description for {@link SoftwareModule#getDescription()}
* @return updated builder instance
*/
SoftwareModuleUpdate description(@Size(max = NamedEntity.DESCRIPTION_MAX_SIZE) String description);
/**
* @param vendor
* for {@link SoftwareModule#getVendor()}
* @param vendor for {@link SoftwareModule#getVendor()}
* @return updated builder instance
*/
SoftwareModuleUpdate vendor(@Size(max = SoftwareModule.VENDOR_MAX_SIZE) String vendor);

View File

@@ -13,13 +13,11 @@ import org.eclipse.hawkbit.repository.model.Tag;
/**
* Builder for {@link Tag}.
*
*/
public interface TagBuilder {
/**
* @param id
* of the updatable entity
* @param id of the updatable entity
* @return builder instance
*/
TagUpdate update(long id);

View File

@@ -20,26 +20,23 @@ import org.eclipse.hawkbit.repository.model.Tag;
* Builder to create a new {@link Tag} entry. Defines all fields that can be set
* at creation time. Other fields are set by the repository automatically, e.g.
* {@link BaseEntity#getCreatedAt()}.
*
*/
public interface TagCreate {
/**
* @param name
* for {@link Tag#getName()}
* @param name for {@link Tag#getName()}
* @return updated builder instance
*/
TagCreate name(@Size(min = 1, max = NamedEntity.NAME_MAX_SIZE) @NotNull String name);
/**
* @param description
* for {@link Tag#getDescription()}
* @param description for {@link Tag#getDescription()}
* @return updated builder instance
*/
TagCreate description(@Size(max = NamedEntity.DESCRIPTION_MAX_SIZE) String description);
/**
* @param colour
* for {@link Tag#getColour()}
* @param colour for {@link Tag#getColour()}
* @return updated builder instance
*/
TagCreate colour(@Size(max = Tag.COLOUR_MAX_SIZE) String colour);

View File

@@ -18,26 +18,23 @@ import org.eclipse.hawkbit.repository.model.Tag;
/**
* Builder to update an existing {@link Tag} entry. Defines all fields that can
* be updated.
*
*/
public interface TagUpdate {
/**
* @param name
* for {@link Tag#getName()}
* @param name for {@link Tag#getName()}
* @return updated builder instance
*/
TagUpdate name(@Size(min = 1, max = NamedEntity.NAME_MAX_SIZE) @NotNull String name);
/**
* @param description
* for {@link Tag#getDescription()}
* @param description for {@link Tag#getDescription()}
* @return updated builder instance
*/
TagUpdate description(@Size(max = NamedEntity.DESCRIPTION_MAX_SIZE) String description);
/**
* @param colour
* for {@link Tag#getColour()}
* @param colour for {@link Tag#getColour()}
* @return updated builder instance
*/
TagUpdate colour(@Size(max = Tag.COLOUR_MAX_SIZE) String colour);

View File

@@ -15,13 +15,11 @@ import org.eclipse.hawkbit.repository.model.Target;
/**
* Builder for {@link Target}.
*
*/
public interface TargetBuilder {
/**
* @param controllerId
* of the updatable entity
* @param controllerId of the updatable entity
* @return builder instance
*/
TargetUpdate update(@NotEmpty String controllerId);

View File

@@ -21,68 +21,56 @@ import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
* Builder to create a new {@link Target} entry. Defines all fields that can be
* set at creation time. Other fields are set by the repository automatically,
* e.g. {@link BaseEntity#getCreatedAt()}.
*
*/
public interface TargetCreate {
/**
* @param controllerId
* for {@link Target#getControllerId()}
* @param controllerId for {@link Target#getControllerId()}
* @return updated builder instance
*/
TargetCreate controllerId(@Size(min = 1, max = Target.CONTROLLER_ID_MAX_SIZE) @NotNull String controllerId);
/**
* @param name
* for {@link Target#getName()} filled with
* @param name for {@link Target#getName()} filled with
* {@link #controllerId(String)} as default if not set explicitly
* @return updated builder instance
*/
TargetCreate name(@Size(min = 1, max = NamedEntity.NAME_MAX_SIZE) @NotNull String name);
/**
* @param description
* for {@link Target#getDescription()}
* @param description for {@link Target#getDescription()}
* @return updated builder instance
*/
TargetCreate description(@Size(max = NamedEntity.DESCRIPTION_MAX_SIZE) String description);
/**
* @param targetTypeId
* for {@link Target#getTargetType()}
* @param targetTypeId for {@link Target#getTargetType()}
* @return updated builder instance
*/
TargetCreate targetType(Long targetTypeId);
/**
* @param securityToken
* for {@link Target#getSecurityToken()} is generated with a
* @param securityToken for {@link Target#getSecurityToken()} is generated with a
* random sequence as default if not set explicitly
* @return updated builder instance
*/
TargetCreate securityToken(@Size(min = 1, max = Target.SECURITY_TOKEN_MAX_SIZE) @NotNull String securityToken);
/**
* @param address
* for {@link Target#getAddress()}
*
* @throws IllegalArgumentException
* If the given string violates RFC&nbsp;2396
*
* @param address for {@link Target#getAddress()}
* @return updated builder instance
* @throws IllegalArgumentException If the given string violates RFC&nbsp;2396
*/
TargetCreate address(@Size(max = Target.ADDRESS_MAX_SIZE) String address);
/**
* @param lastTargetQuery
* for {@link Target#getLastTargetQuery()}
* @param lastTargetQuery for {@link Target#getLastTargetQuery()}
* @return updated builder instance
*/
TargetCreate lastTargetQuery(Long lastTargetQuery);
/**
* @param status
* for {@link Target#getUpdateStatus()} is
* @param status for {@link Target#getUpdateStatus()} is
* {@link TargetUpdateStatus#UNKNOWN} as default if not set
* explicitly
* @return updated builder instance

View File

@@ -13,14 +13,13 @@ import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
/**
* Builder for {@link TargetFilterQuery}.
*
*/
public interface TargetFilterQueryBuilder {
/**
* Used to update a {@link TargetFilterQuery}
*
* @param id
* of the updatable entity
* @param id of the updatable entity
* @return builder instance
*/
TargetFilterQueryUpdate update(long id);
@@ -28,8 +27,7 @@ public interface TargetFilterQueryBuilder {
/**
* Used to update a the auto assignment of a {@link TargetFilterQuery}
*
* @param id
* of the updatable entity
* @param id of the updatable entity
* @return builder instance
*/
AutoAssignDistributionSetUpdate updateAutoAssign(long id);

View File

@@ -25,14 +25,13 @@ import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
* Builder to create a new {@link TargetFilterQuery} entry. Defines all fields
* that can be set at creation time. Other fields are set by the repository
* automatically, e.g. {@link BaseEntity#getCreatedAt()}.
*
*/
public interface TargetFilterQueryCreate {
/**
* Set filter name
*
* @param name
* of {@link TargetFilterQuery#getName()}
* @param name of {@link TargetFilterQuery#getName()}
* @return updated builder instance
*/
TargetFilterQueryCreate name(@Size(min = 1, max = NamedEntity.NAME_MAX_SIZE) @NotNull String name);
@@ -40,8 +39,7 @@ public interface TargetFilterQueryCreate {
/**
* Set filter query
*
* @param query
* of {@link TargetFilterQuery#getQuery()}
* @param query of {@link TargetFilterQuery#getQuery()}
* @return updated builder instance
*/
TargetFilterQueryCreate query(@Size(min = 1, max = TargetFilterQuery.QUERY_MAX_SIZE) @NotNull String query);
@@ -49,8 +47,7 @@ public interface TargetFilterQueryCreate {
/**
* Set {@link DistributionSet} for auto assignment
*
* @param distributionSet
* for {@link TargetFilterQuery#getAutoAssignDistributionSet()}
* @param distributionSet for {@link TargetFilterQuery#getAutoAssignDistributionSet()}
* @return updated builder instance
*/
default TargetFilterQueryCreate autoAssignDistributionSet(final DistributionSet distributionSet) {
@@ -60,8 +57,7 @@ public interface TargetFilterQueryCreate {
/**
* Set ID of {@link DistributionSet} for auto assignment
*
* @param dsId
* for {@link TargetFilterQuery#getAutoAssignDistributionSet()}
* @param dsId for {@link TargetFilterQuery#getAutoAssignDistributionSet()}
* @return updated builder instance
*/
TargetFilterQueryCreate autoAssignDistributionSet(Long dsId);
@@ -69,8 +65,7 @@ public interface TargetFilterQueryCreate {
/**
* Set {@link ActionType} for auto assignment
*
* @param actionType
* for {@link TargetFilterQuery#getAutoAssignActionType()}
* @param actionType for {@link TargetFilterQuery#getAutoAssignActionType()}
* @return updated builder instance
*/
TargetFilterQueryCreate autoAssignActionType(ActionType actionType);
@@ -78,8 +73,7 @@ public interface TargetFilterQueryCreate {
/**
* Set weight of {@link Action} created during auto assignment
*
* @param weight
* weight of {@link Action} generated within auto assignment
* @param weight weight of {@link Action} generated within auto assignment
* @return updated builder instance
*/
TargetFilterQueryCreate autoAssignWeight(Integer weight);
@@ -88,8 +82,7 @@ public interface TargetFilterQueryCreate {
* Specify initial confirmation state of resulting {@link Action} in auto
* assignment
*
* @param confirmationRequired
* if confirmation is required for configured auto assignment (considered
* @param confirmationRequired if confirmation is required for configured auto assignment (considered
* with confirmation flow active)
* @return updated builder instance
*/

View File

@@ -17,19 +17,17 @@ import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
/**
* Builder to update an existing {@link TargetFilterQuery} entry. Defines all
* fields that can be updated.
*
*/
public interface TargetFilterQueryUpdate {
/**
* @param name
* of {@link TargetFilterQuery#getName()}
* @param name of {@link TargetFilterQuery#getName()}
* @return updated builder instance
*/
TargetFilterQueryUpdate name(@Size(min = 1, max = NamedEntity.NAME_MAX_SIZE) String name);
/**
* @param query
* of {@link TargetFilterQuery#getQuery()}
* @param query of {@link TargetFilterQuery#getQuery()}
* @return updated builder instance
*/
TargetFilterQueryUpdate query(@Size(min = 1, max = TargetFilterQuery.QUERY_MAX_SIZE) String query);

View File

@@ -13,12 +13,11 @@ import org.eclipse.hawkbit.repository.model.TargetType;
/**
* Builder for {@link TargetType}.
*
*/
public interface TargetTypeBuilder {
/**
* @param id
* of the updatable entity
* @param id of the updatable entity
* @return builder instance
*/
TargetTypeUpdate update(long id);

View File

@@ -9,64 +9,58 @@
*/
package org.eclipse.hawkbit.repository.builder;
import java.util.Collection;
import java.util.Collections;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import org.eclipse.hawkbit.repository.model.BaseEntity;
import org.eclipse.hawkbit.repository.model.DistributionSetType;
import org.eclipse.hawkbit.repository.model.NamedEntity;
import org.eclipse.hawkbit.repository.model.TargetType;
import org.eclipse.hawkbit.repository.model.Type;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.util.Collection;
import java.util.Collections;
/**
* Builder to create a new {@link TargetType} entry. Defines all fields
* that can be set at creation time. Other fields are set by the repository
* automatically, e.g. {@link BaseEntity#getCreatedAt()}.
*
*/
public interface TargetTypeCreate {
/**
* @param name
* for {@link TargetType#getName()}
* @param name for {@link TargetType#getName()}
* @return updated builder instance
*/
TargetTypeCreate name(@Size(min = 1, max = NamedEntity.NAME_MAX_SIZE) @NotEmpty String name);
/**
* @param description
* for {@link TargetType#getDescription()}
* @param description for {@link TargetType#getDescription()}
* @return updated builder instance
*/
TargetTypeCreate description(@Size(max = NamedEntity.DESCRIPTION_MAX_SIZE) String description);
/**
* @param key
* for {@link TargetType#getName()}
* @param key for {@link TargetType#getName()}
* @return updated builder instance
*/
TargetTypeCreate key(@Size(min = 1, max = Type.KEY_MAX_SIZE) @NotEmpty String key);
/**
* @param colour
* for {@link TargetType#getColour()}
* @param colour for {@link TargetType#getColour()}
* @return updated builder instance
*/
TargetTypeCreate colour(@Size(max = Type.COLOUR_MAX_SIZE) String colour);
/**
* @param compatible
* for {@link TargetType#getCompatibleDistributionSetTypes()}
* @param compatible for {@link TargetType#getCompatibleDistributionSetTypes()}
* @return updated builder instance
*/
TargetTypeCreate compatible(@NotEmpty Collection<Long> compatible);
/**
* @param compatible
* for {@link TargetType#getCompatibleDistributionSetTypes()}
* @param compatible for {@link TargetType#getCompatibleDistributionSetTypes()}
* @return updated builder instance
*/
default TargetTypeCreate compatible(@NotNull final Long compatible) {
@@ -74,8 +68,7 @@ public interface TargetTypeCreate {
}
/**
* @param compatible
* for {@link TargetType#getCompatibleDistributionSetTypes()}
* @param compatible for {@link TargetType#getCompatibleDistributionSetTypes()}
* @return updated builder instance
*/
default TargetTypeCreate compatible(@NotNull final DistributionSetType compatible) {

View File

@@ -9,34 +9,31 @@
*/
package org.eclipse.hawkbit.repository.builder;
import jakarta.validation.constraints.Size;
import org.eclipse.hawkbit.repository.model.NamedEntity;
import org.eclipse.hawkbit.repository.model.TargetType;
import jakarta.validation.constraints.Size;
/**
* Builder to update an existing {@link TargetType} entry. Defines all
* fields that can be updated.
*
*/
public interface TargetTypeUpdate {
/**
* @param description
* for {@link TargetType#getDescription()}
* @param description for {@link TargetType#getDescription()}
* @return updated builder instance
*/
TargetTypeUpdate description(@Size(max = NamedEntity.DESCRIPTION_MAX_SIZE) String description);
/**
* @param colour
* for {@link TargetType#getColour()}
* @param colour for {@link TargetType#getColour()}
* @return updated builder instance
*/
TargetTypeUpdate colour(@Size(max = TargetType.COLOUR_MAX_SIZE) String colour);
/**
* @param name
* Name
* @param name Name
* @return updated builder instance
*/
TargetTypeUpdate name(@Size(max = TargetType.NAME_MAX_SIZE) String name);

View File

@@ -19,59 +19,48 @@ import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
/**
* Builder to update an existing {@link Target} entry. Defines all fields that
* can be updated.
*
*/
public interface TargetUpdate {
/**
* @param name
* for {@link Target#getName()}
* @param name for {@link Target#getName()}
* @return updated builder instance
*/
TargetUpdate name(@Size(min = 1, max = NamedEntity.NAME_MAX_SIZE) @NotNull String name);
/**
* @param description
* for {@link Target#getDescription()}
* @param description for {@link Target#getDescription()}
* @return updated builder instance
*/
TargetUpdate description(@Size(max = NamedEntity.DESCRIPTION_MAX_SIZE) String description);
/**
* @param securityToken
* for {@link Target#getSecurityToken()}
* @param securityToken for {@link Target#getSecurityToken()}
* @return updated builder instance
*/
TargetUpdate securityToken(@Size(min = 1, max = Target.SECURITY_TOKEN_MAX_SIZE) @NotNull String securityToken);
/**
* @param targetTypeId
* for {@link Target#getTargetType()}
* @param targetTypeId for {@link Target#getTargetType()}
* @return updated builder instance
*/
TargetUpdate targetType(@NotNull Long targetTypeId);
/**
* @param address
* for {@link Target#getAddress()}
*
* @throws IllegalArgumentException
* If the given string violates RFC&nbsp;2396
*
* @param address for {@link Target#getAddress()}
* @return updated builder instance
* @throws IllegalArgumentException If the given string violates RFC&nbsp;2396
*/
TargetUpdate address(@Size(max = Target.ADDRESS_MAX_SIZE) String address);
/**
* @param lastTargetQuery
* for {@link Target#getLastTargetQuery()}
* @param lastTargetQuery for {@link Target#getLastTargetQuery()}
* @return updated builder instance
*/
TargetUpdate lastTargetQuery(Long lastTargetQuery);
/**
* @param status
* for {@link Target#getUpdateStatus()}
* @param status for {@link Target#getUpdateStatus()}
* @return updated builder instance
*/
TargetUpdate status(@NotNull TargetUpdateStatus status);

View File

@@ -14,15 +14,12 @@ import org.springframework.context.ApplicationEvent;
/**
* ApplicationEventFilter for hawkBit internal {@link ApplicationEvent}
* publishing.
*
*/
@FunctionalInterface
public interface ApplicationEventFilter {
/**
*
* @param event
* to verify
* @param event to verify
* @return true if event should be filtered
*/
boolean filter(final ApplicationEvent event);

View File

@@ -11,10 +11,6 @@ package org.eclipse.hawkbit.repository.event;
/**
* Events to be published to refresh data on UI.
*
*
*
*
*/
public enum CustomEvents {

View File

@@ -12,7 +12,6 @@ package org.eclipse.hawkbit.repository.event;
/**
* An event declaration which holds an revision for each event so consumers have
* the chance to know if they might already retrieved a newer event.
*
*/
@FunctionalInterface
public interface TenantAwareEvent {

View File

@@ -9,16 +9,16 @@
*/
package org.eclipse.hawkbit.repository.event.remote;
import lombok.Data;
import org.eclipse.hawkbit.repository.model.Action;
import org.eclipse.hawkbit.repository.model.ActionProperties;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import lombok.Data;
import org.eclipse.hawkbit.repository.model.Action;
import org.eclipse.hawkbit.repository.model.ActionProperties;
/**
* Abstract class providing information about an assignment.
*/

View File

@@ -30,12 +30,9 @@ public class DistributionSetDeletedEvent extends RemoteIdEvent implements Entity
/**
* Constructor.
*
* @param tenant
* the tenant
* @param entityId
* the entity id
* @param applicationId
* the origin application id
* @param tenant the tenant
* @param entityId the entity id
* @param applicationId the origin application id
*/
public DistributionSetDeletedEvent(final String tenant, final Long entityId,
final Class<? extends TenantAwareBaseEntity> entityClass, final String applicationId) {

View File

@@ -30,14 +30,10 @@ public class DistributionSetTagDeletedEvent extends RemoteIdEvent implements Ent
/**
* Constructor for json serialization.
*
* @param tenant
* the tenant
* @param entityId
* the entity id
* @param entityClass
* the entity class
* @param applicationId
* the origin application id
* @param tenant the tenant
* @param entityId the entity id
* @param entityClass the entity class
* @param applicationId the origin application id
*/
public DistributionSetTagDeletedEvent(final String tenant, final Long entityId,

View File

@@ -14,7 +14,6 @@ import org.eclipse.hawkbit.repository.model.DistributionSetType;
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
/**
*
* Defines the remote event of deleting a {@link DistributionSetType}.
*/
public class DistributionSetTypeDeletedEvent extends RemoteIdEvent implements EntityDeletedEvent {
@@ -31,14 +30,10 @@ public class DistributionSetTypeDeletedEvent extends RemoteIdEvent implements En
/**
* Constructor for json serialization.
*
* @param tenant
* the tenant
* @param entityId
* the entity id
* @param entityClass
* the entity class
* @param applicationId
* the origin application id
* @param tenant the tenant
* @param entityId the entity id
* @param entityClass the entity class
* @param applicationId the origin application id
*/
public DistributionSetTypeDeletedEvent(final String tenant, final Long entityId,
final Class<? extends TenantAwareBaseEntity> entityClass, final String applicationId) {

View File

@@ -14,7 +14,6 @@ import org.eclipse.hawkbit.repository.model.ActionStatus;
/**
* TenantAwareEvent that contains an updated download progress for a given
* ActionStatus that was written for a download request.
*
*/
public class DownloadProgressEvent extends RemoteTenantAwareEvent {
@@ -32,14 +31,10 @@ public class DownloadProgressEvent extends RemoteTenantAwareEvent {
/**
* Constructor.
*
* @param tenant
* the tenant
* @param actionStatusId
* of the {@link ActionStatus} the download belongs to
* @param shippedBytesSinceLast
* the shippedBytesSinceLast
* @param applicationId
* the application id.
* @param tenant the tenant
* @param actionStatusId of the {@link ActionStatus} the download belongs to
* @param shippedBytesSinceLast the shippedBytesSinceLast
* @param applicationId the application id.
*/
public DownloadProgressEvent(final String tenant, final Long actionStatusId, final long shippedBytesSinceLast,
final String applicationId) {

View File

@@ -20,12 +20,9 @@ public interface EventEntityManager {
/**
* Find an entity by given id and return it.
*
* @param tenant
* the tenant
* @param id
* the id
* @param entityType
* the entity type
* @param tenant the tenant
* @param id the id
* @param entityType the entity type
* @return the entity
*/
<E extends TenantAwareBaseEntity> E findEntity(String tenant, Long id, Class<E> entityType);

View File

@@ -14,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired;
/**
* A singleton bean which holds the event entity manager to have autowiring in
* the events.
*
*/
public final class EventEntityManagerHolder {

View File

@@ -9,12 +9,12 @@
*/
package org.eclipse.hawkbit.repository.event.remote;
import java.util.List;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.eclipse.hawkbit.repository.model.Action;
import java.util.List;
/**
* Generic deployment event for the Multi-Assignments feature. The event extends
* the {@link MultiActionEvent} and holds a list of controller IDs to identify
@@ -30,12 +30,9 @@ public class MultiActionAssignEvent extends MultiActionEvent {
/**
* Constructor.
*
* @param tenant
* tenant the event is scoped to
* @param applicationId
* the application id
* @param actions
* the actions of the deployment action
* @param tenant tenant the event is scoped to
* @param applicationId the application id
* @param actions the actions of the deployment action
*/
public MultiActionAssignEvent(String tenant, String applicationId, List<Action> actions) {
super(tenant, applicationId, actions);

View File

@@ -34,12 +34,9 @@ public class MultiActionCancelEvent extends MultiActionEvent {
/**
* Constructor.
*
* @param tenant
* tenant the event is scoped to
* @param applicationId
* the application id
* @param actions
* the actions to be canceled
* @param tenant tenant the event is scoped to
* @param applicationId the application id
* @param actions the actions to be canceled
*/
public MultiActionCancelEvent(String tenant, String applicationId, List<Action> actions) {
super(tenant, applicationId, actions);

View File

@@ -43,12 +43,9 @@ public abstract class MultiActionEvent extends RemoteTenantAwareEvent implements
/**
* Constructor.
*
* @param tenant
* tenant the event is scoped to
* @param applicationId
* the application id
* @param actions
* the actions involved
* @param tenant tenant the event is scoped to
* @param applicationId the application id
* @param actions the actions involved
*/
protected MultiActionEvent(String tenant, String applicationId, List<Action> actions) {
super(applicationId, tenant, applicationId);

View File

@@ -9,6 +9,9 @@
*/
package org.eclipse.hawkbit.repository.event.remote;
import java.io.Serial;
import java.util.Arrays;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
@@ -16,9 +19,6 @@ import lombok.NoArgsConstructor;
import lombok.ToString;
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
import java.io.Serial;
import java.util.Arrays;
/**
* An base definition class for an event which contains an id.
*/
@@ -40,14 +40,10 @@ public class RemoteIdEvent extends RemoteTenantAwareEvent {
/**
* Constructor for json serialization.
*
* @param entityId
* the entity Id
* @param tenant
* the tenant
* @param entityClass
* the entity class
* @param applicationId
* the origin application id
* @param entityId the entity Id
* @param tenant the tenant
* @param entityClass the entity class
* @param applicationId the origin application id
*/
protected RemoteIdEvent(final Long entityId, final String tenant,
final Class<? extends TenantAwareBaseEntity> entityClass, final String applicationId) {

View File

@@ -9,16 +9,15 @@
*/
package org.eclipse.hawkbit.repository.event.remote;
import java.io.Serial;
import com.cronutils.utils.StringUtils;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import org.eclipse.hawkbit.repository.event.TenantAwareEvent;
import org.springframework.cloud.bus.event.RemoteApplicationEvent;
import com.cronutils.utils.StringUtils;
import java.io.Serial;
/**
* A distributed tenant aware event. It's the base class of the other
* distributed events. All the necessary information of distributing events to
@@ -44,12 +43,9 @@ public class RemoteTenantAwareEvent extends RemoteApplicationEvent implements Te
/**
* Constructor.
*
* @param source
* the for the remote event.
* @param tenant
* the tenant
* @param applicationId
* the applicationId
* @param source the for the remote event.
* @param tenant the tenant
* @param applicationId the applicationId
*/
public RemoteTenantAwareEvent(final Object source, final String tenant, final String applicationId) {
// due to a bug in Spring Cloud, we cannot pass null for applicationId

View File

@@ -14,7 +14,6 @@ import org.eclipse.hawkbit.repository.model.Rollout;
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
/**
*
* Defines the remote event of deleting a {@link Rollout}.
*/
public class RolloutDeletedEvent extends RemoteIdEvent implements EntityDeletedEvent {
@@ -31,14 +30,10 @@ public class RolloutDeletedEvent extends RemoteIdEvent implements EntityDeletedE
/**
* Constructor for json serialization.
*
* @param tenant
* the tenant
* @param entityId
* the entity id
* @param entityClass
* the entity class
* @param applicationId
* the origin application id
* @param tenant the tenant
* @param entityId the entity id
* @param entityClass the entity class
* @param applicationId the origin application id
*/
public RolloutDeletedEvent(final String tenant, final Long entityId,
final Class<? extends TenantAwareBaseEntity> entityClass, final String applicationId) {

View File

@@ -14,7 +14,6 @@ import org.eclipse.hawkbit.repository.model.RolloutGroup;
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
/**
*
* Defines the remote event of deleting a {@link RolloutGroup}.
*/
public class RolloutGroupDeletedEvent extends RemoteIdEvent implements EntityDeletedEvent {
@@ -31,14 +30,10 @@ public class RolloutGroupDeletedEvent extends RemoteIdEvent implements EntityDel
/**
* Constructor for json serialization.
*
* @param tenant
* the tenant
* @param entityId
* the entity id
* @param entityClass
* the entity class
* @param applicationId
* the origin application id
* @param tenant the tenant
* @param entityId the entity id
* @param entityClass the entity class
* @param applicationId the origin application id
*/
public RolloutGroupDeletedEvent(final String tenant, final Long entityId,
final Class<? extends TenantAwareBaseEntity> entityClass, final String applicationId) {

View File

@@ -15,7 +15,6 @@ import lombok.Data;
import org.eclipse.hawkbit.repository.model.DistributionSet;
/**
*
* Event that is published when a rollout is stopped due to invalidation of a
* {@link DistributionSet}.
*/
@@ -37,14 +36,10 @@ public class RolloutStoppedEvent extends RemoteTenantAwareEvent {
/**
* Constructor for json serialization.
*
* @param tenant
* the tenant
* @param entityId
* the entity id
* @param entityClass
* the entity class
* @param applicationId
* the origin application id
* @param tenant the tenant
* @param entityId the entity id
* @param entityClass the entity class
* @param applicationId the origin application id
*/
public RolloutStoppedEvent(final String tenant, final String applicationId, final long rolloutId,
final Collection<Long> rolloutGroupIds) {

View File

@@ -14,7 +14,6 @@ import org.eclipse.hawkbit.repository.model.SoftwareModule;
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
/**
*
* Defines the remote event of deleting a {@link SoftwareModule}.
*/
public class SoftwareModuleDeletedEvent extends RemoteIdEvent implements EntityDeletedEvent {
@@ -31,14 +30,10 @@ public class SoftwareModuleDeletedEvent extends RemoteIdEvent implements EntityD
/**
* Constructor for json serialization.
*
* @param tenant
* the tenant
* @param entityId
* the entity id
* @param entityClass
* the entity class
* @param applicationId
* the origin application id
* @param tenant the tenant
* @param entityId the entity id
* @param entityClass the entity class
* @param applicationId the origin application id
*/
public SoftwareModuleDeletedEvent(final String tenant, final Long entityId,
final Class<? extends TenantAwareBaseEntity> entityClass, final String applicationId) {

View File

@@ -14,7 +14,6 @@ import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
/**
*
* Defines the remote event of deleting a {@link SoftwareModuleType}.
*/
public class SoftwareModuleTypeDeletedEvent extends RemoteIdEvent implements EntityDeletedEvent {
@@ -31,14 +30,10 @@ public class SoftwareModuleTypeDeletedEvent extends RemoteIdEvent implements Ent
/**
* Constructor for json serialization.
*
* @param tenant
* the tenant
* @param entityId
* the entity id
* @param entityClass
* the entity class
* @param applicationId
* the origin application id
* @param tenant the tenant
* @param entityId the entity id
* @param entityClass the entity class
* @param applicationId the origin application id
*/
public SoftwareModuleTypeDeletedEvent(final String tenant, final Long entityId,
final Class<? extends TenantAwareBaseEntity> entityClass, final String applicationId) {

View File

@@ -38,16 +38,11 @@ public class TargetAssignDistributionSetEvent extends AbstractAssignmentEvent {
/**
* Constructor.
*
* @param tenant
* of the event
* @param distributionSetId
* of the set that was assigned
* @param a
* the actions and the targets
* @param applicationId
* the application id.
* @param maintenanceWindowAvailable
* see {@link Action#isMaintenanceWindowAvailable()}
* @param tenant of the event
* @param distributionSetId of the set that was assigned
* @param a the actions and the targets
* @param applicationId the application id.
* @param maintenanceWindowAvailable see {@link Action#isMaintenanceWindowAvailable()}
*/
public TargetAssignDistributionSetEvent(final String tenant, final long distributionSetId, final List<Action> a,
final String applicationId, final boolean maintenanceWindowAvailable) {
@@ -62,10 +57,8 @@ public class TargetAssignDistributionSetEvent extends AbstractAssignmentEvent {
/**
* Constructor.
*
* @param action
* the action created for this assignment
* @param applicationId
* the application id
* @param action the action created for this assignment
* @param applicationId the application id
*/
public TargetAssignDistributionSetEvent(final Action action, final String applicationId) {
this(action.getTenant(), action.getDistributionSet().getId(), Collections.singletonList(action), applicationId,

View File

@@ -9,14 +9,14 @@
*/
package org.eclipse.hawkbit.repository.event.remote;
import java.io.Serial;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
import java.io.Serial;
/**
* Defines the remote event of triggering attribute updates of a {@link Target}.
*/
@@ -41,18 +41,12 @@ public class TargetAttributesRequestedEvent extends RemoteIdEvent {
/**
* Constructor json serialization
*
* @param tenant
* the tenant
* @param entityId
* the entity id
* @param controllerId
* the controllerId of the target
* @param targetAddress
* the target address
* @param entityClass
* the entity class
* @param applicationId
* the origin application id
* @param tenant the tenant
* @param entityId the entity id
* @param controllerId the controllerId of the target
* @param targetAddress the target address
* @param entityClass the entity class
* @param applicationId the origin application id
*/
public TargetAttributesRequestedEvent(final String tenant, final Long entityId, final String controllerId,
final String targetAddress, final Class<? extends TenantAwareBaseEntity> entityClass,

View File

@@ -9,6 +9,8 @@
*/
package org.eclipse.hawkbit.repository.event.remote;
import java.io.Serial;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
@@ -16,8 +18,6 @@ import org.eclipse.hawkbit.repository.event.entity.EntityDeletedEvent;
import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
import java.io.Serial;
/**
* Defines the remote event of deleting a {@link Target}.
*/
@@ -40,19 +40,12 @@ public class TargetDeletedEvent extends RemoteIdEvent implements EntityDeletedEv
}
/**
*
* @param tenant
* the tenant
* @param entityId
* the entity id
* @param controllerId
* the controllerId of the target
* @param targetAddress
* the target address
* @param entityClass
* the entity class
* @param applicationId
* the origin application id
* @param tenant the tenant
* @param entityId the entity id
* @param controllerId the controllerId of the target
* @param targetAddress the target address
* @param entityClass the entity class
* @param applicationId the origin application id
*/
public TargetDeletedEvent(final String tenant, final Long entityId, final String controllerId,
final String targetAddress, final Class<? extends TenantAwareBaseEntity> entityClass,

View File

@@ -14,7 +14,6 @@ import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
/**
*
* Defines the remote event of deleting a {@link TargetFilterQuery}.
*/
public class TargetFilterQueryDeletedEvent extends RemoteIdEvent implements EntityDeletedEvent {
@@ -29,15 +28,10 @@ public class TargetFilterQueryDeletedEvent extends RemoteIdEvent implements Enti
}
/**
*
* @param tenant
* the tenant
* @param entityId
* the entity id
* @param entityClass
* the entity class
* @param applicationId
* the origin application id
* @param tenant the tenant
* @param entityId the entity id
* @param entityClass the entity class
* @param applicationId the origin application id
*/
public TargetFilterQueryDeletedEvent(final String tenant, final Long entityId,
final Class<? extends TenantAwareBaseEntity> entityClass, final String applicationId) {

View File

@@ -9,13 +9,13 @@
*/
package org.eclipse.hawkbit.repository.event.remote;
import java.io.Serial;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import org.eclipse.hawkbit.repository.model.Target;
import java.io.Serial;
/**
* Event is send in case a target polls either through DDI or DMF.
*/

View File

@@ -15,7 +15,6 @@ import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
/**
* Defines the remote event of delete a {@link TargetTag}.
*
*/
public class TargetTagDeletedEvent extends RemoteIdEvent implements EntityDeletedEvent {
@@ -31,14 +30,10 @@ public class TargetTagDeletedEvent extends RemoteIdEvent implements EntityDelete
/**
* Constructor for json serialization.
*
* @param tenant
* the tenant
* @param entityId
* the entity id
* @param entityClass
* the entity class
* @param applicationId
* the origin application id
* @param tenant the tenant
* @param entityId the entity id
* @param entityClass the entity class
* @param applicationId the origin application id
*/
public TargetTagDeletedEvent(final String tenant, final Long entityId,
final Class<? extends TenantAwareBaseEntity> entityClass, final String applicationId) {

View File

@@ -14,7 +14,6 @@ import org.eclipse.hawkbit.repository.model.TargetType;
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
/**
*
* Defines the remote event of deleting a {@link TargetType}.
*/
public class TargetTypeDeletedEvent extends RemoteIdEvent implements EntityDeletedEvent {
@@ -31,14 +30,10 @@ public class TargetTypeDeletedEvent extends RemoteIdEvent implements EntityDelet
/**
* Constructor for json serialization.
*
* @param tenant
* the tenant
* @param entityId
* the entity id
* @param entityClass
* the entity class
* @param applicationId
* the origin application id
* @param tenant the tenant
* @param entityId the entity id
* @param entityClass the entity class
* @param applicationId the origin application id
*/
public TargetTypeDeletedEvent(final String tenant, final Long entityId,
final Class<? extends TenantAwareBaseEntity> entityClass, final String applicationId) {

View File

@@ -9,6 +9,8 @@
*/
package org.eclipse.hawkbit.repository.event.remote;
import java.io.Serial;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
@@ -16,8 +18,6 @@ import lombok.ToString;
import org.eclipse.hawkbit.repository.event.entity.EntityDeletedEvent;
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
import java.io.Serial;
/**
* Defines the remote event of deleting a {@link org.eclipse.hawkbit.repository.model.TenantConfiguration}.
*/

View File

@@ -18,6 +18,7 @@ import org.eclipse.hawkbit.repository.model.RolloutGroup;
* updated
*/
public abstract class AbstractRolloutGroupEvent extends RemoteEntityEvent<RolloutGroup> {
private static final long serialVersionUID = 1L;
private final Long rolloutId;

Some files were not shown because too many files have changed in this diff Show More