Enable specifying target type when created using DMF API (#1472)

Extension of DMF API with possibility of setting target
type name when creating target. If a target type with the
provided name is found (was created beforehand) then it
is associated with the new target.

Signed-off-by: Ondrej Charvat <ondrej.charvat@proton.me>
This commit is contained in:
charvadzo
2024-01-22 14:01:00 +01:00
committed by GitHub
parent af56b71d53
commit 49a5509e89
8 changed files with 236 additions and 24 deletions

View File

@@ -223,7 +223,8 @@ public interface ControllerManagement {
/**
* Register new target in the repository (plug-and-play) and in case it
* already exists updates {@link Target#getAddress()} and
* {@link Target#getLastTargetQuery()} and {@link Target#getName()} and
* {@link Target#getLastTargetQuery()} and {@link Target#getName()}
* and {@link Target#getTargetType()} and
* switches if {@link TargetUpdateStatus#UNKNOWN} to
* {@link TargetUpdateStatus#REGISTERED}.
*
@@ -233,10 +234,13 @@ public interface ControllerManagement {
* 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)
Target findOrRegisterTargetIfItDoesNotExist(@NotEmpty String controllerId, @NotNull URI address, String name);
Target findOrRegisterTargetIfItDoesNotExist(@NotEmpty String controllerId, @NotNull URI address, String name,
String type);
/**
* Retrieves last {@link Action} for a download of an artifact of given