Move Target tag deprecations to end of classes (#1882)

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-10-16 15:15:10 +03:00
committed by GitHub
parent 745663f083
commit 8d9f076271
4 changed files with 146 additions and 178 deletions

View File

@@ -632,22 +632,6 @@ public interface TargetManagement {
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Page<Target> findByRsqlAndTag(@NotNull Pageable pageable, @NotNull String rsqlParam, long tagId);
/**
* Toggles {@link TargetTag} assignment to given {@link Target}s by means that
* if some (or all) of the targets in the list have the {@link Tag} not yet
* 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
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
TargetTagAssignmentResult toggleTagAssignment(@NotEmpty Collection<String> controllerIds, @NotEmpty String tagName);
/**
* Initiates {@link TargetType} assignment to given {@link Target}s. If some
* targets in the list have the {@link TargetType} not yet assigned, they will
@@ -705,19 +689,6 @@ public interface TargetManagement {
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
List<Target> unassignTag(@NotEmpty List<String> controllerIds, long targetTagId);
/**
* Un-assign a {@link TargetTag} assignment to given {@link Target}.
*
* @deprecated since 0.6.0 - use {@link #unassignTag(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(forRemoval = true)
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
Target unassignTag(@NotEmpty String controllerId, long targetTagId);
/**
* Un-assign a {@link TargetType} assignment to given {@link Target}.
*
@@ -991,4 +962,33 @@ public interface TargetManagement {
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
TargetMetadata updateMetadata(@NotEmpty String controllerId, @NotNull MetaData metadata);
}
/**
* Toggles {@link TargetTag} assignment to given {@link Target}s by means that
* if some (or all) of the targets in the list have the {@link Tag} not yet
* 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
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
TargetTagAssignmentResult toggleTagAssignment(@NotEmpty Collection<String> controllerIds, @NotEmpty String tagName);
/**
* Un-assign a {@link TargetTag} assignment to given {@link Target}.
*
* @deprecated since 0.6.0 - use {@link #unassignTag(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(forRemoval = true)
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
Target unassignTag(@NotEmpty String controllerId, long targetTagId);
}

View File

@@ -34,12 +34,11 @@ import org.springframework.security.access.prepost.PreAuthorize;
/**
* Management service for {@link TargetTag}s.
*
*/
public interface TargetTagManagement {
/**
* count {@link TargetTag}s.
* Count {@link TargetTag}s.
*
* @return size of {@link TargetTag}s
*/
@@ -49,32 +48,21 @@ public interface TargetTagManagement {
/**
* Creates a new {@link TargetTag}.
*
* @param create
* to be created
*
* @param create to be created
* @return the new created {@link TargetTag}
*
* @throws EntityAlreadyExistsException
* if given object already exists
* @throws ConstraintViolationException
* if fields are not filled as specified. Check
* {@link TagCreate} for field constraints.
* @throws EntityAlreadyExistsException if given object already exists
* @throws ConstraintViolationException if fields are not filled as specified. Check {@link TagCreate} for field constraints.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_CREATE_TARGET)
TargetTag create(@NotNull @Valid TagCreate create);
/**
* created multiple {@link TargetTag}s.
* Created multiple {@link TargetTag}s.
*
* @param creates
* to be created
* @param creates to be created
* @return the new created {@link TargetTag}s
*
* @throws EntityAlreadyExistsException
* if given object has already an ID.
* @throws ConstraintViolationException
* if fields are not filled as specified. Check
* {@link TagCreate} for field constraints.
* @throws EntityAlreadyExistsException if given object has already an ID.
* @throws ConstraintViolationException if fields are not filled as specified. Check {@link TagCreate} for field constraints.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_CREATE_TARGET)
List<TargetTag> create(@NotNull @Valid Collection<TagCreate> creates);
@@ -82,11 +70,8 @@ public interface TargetTagManagement {
/**
* Deletes {@link TargetTag} with given name.
*
* @param targetTagName
* tag name of the {@link TargetTag} to be deleted
*
* @throws EntityNotFoundException
* if tag with given name does not exist
* @param targetTagName tag name of the {@link TargetTag} to be deleted
* @throws EntityNotFoundException if tag with given name does not exist
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_DELETE_TARGET)
void delete(@NotEmpty String targetTagName);
@@ -94,9 +79,7 @@ public interface TargetTagManagement {
/**
* returns all {@link TargetTag}s.
*
* @param pageable
* page parameter
*
* @param pageable page parameter
* @return all {@link TargetTag}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -105,18 +88,12 @@ public interface TargetTagManagement {
/**
* Retrieves all target tags based on the given specification.
*
* @param pageable
* pagination parameter
* @param rsqlParam
* rsql query string
*
* @param pageable pagination parameter
* @param rsqlParam rsql query string
* @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)
Page<TargetTag> findByRsql(@NotNull Pageable pageable, @NotNull String rsqlParam);
@@ -124,8 +101,7 @@ public interface TargetTagManagement {
/**
* Find {@link TargetTag} based on given Name.
*
* @param name
* to look for.
* @param name to look for.
* @return {@link TargetTag}
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -134,8 +110,7 @@ public interface TargetTagManagement {
/**
* Finds {@link TargetTag} by given id.
*
* @param id
* to search for
* @param id to search for
* @return the found {@link TargetTag}
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
@@ -144,28 +119,21 @@ public interface TargetTagManagement {
/**
* Finds {@link TargetTag} by given ids.
*
* @param ids
* the ids to for
* @param ids the ids to for
* @return the found {@link TargetTag}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
List<TargetTag> get(@NotEmpty Collection<Long> ids);
/**
* updates the {@link TargetTag}.
* Updates the {@link TargetTag}.
*
* @param update
* the {@link TargetTag} with updated values
* @param update the {@link TargetTag} with updated values
* @return the updated {@link TargetTag}
*
* @throws EntityNotFoundException
* in case the {@link TargetTag} does not exists and cannot be
* updated
* @throws ConstraintViolationException
* if fields are not filled as specified. Check
* {@link TagUpdate} for field constraints.
* @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.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
TargetTag update(@NotNull @Valid TagUpdate update);
}
}