Skip to content

Commit

Permalink
[#1580] Software Module & Distribution Set lock: add lock at db level (
Browse files Browse the repository at this point in the history
…#1643)

1. add _locked_ column in the tables
2. add _locked_ field to the JPA entities
3. add lock set/get at JPA level (with lock DS checking for complete)
4. along with that little reordering of code is made to make it more structured

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
  • Loading branch information
avgustinmm committed Feb 14, 2024
1 parent 4ebabcb commit 9bc0e74
Show file tree
Hide file tree
Showing 9 changed files with 171 additions and 247 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public enum SpServerError {
*
*/
SP_DS_INCOMPLETE("hawkbit.server.error.distributionset.incomplete",
"Distribution set is assigned to a target that is incomplete (i.e. mandatory modules are missing)"),
"Distribution set is assigned/locked to a target that is incomplete (i.e. mandatory modules are missing)"),

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ public JpaArtifact() {
*/
public JpaArtifact(@NotEmpty final String sha1Hash, @NotNull final String filename,
final SoftwareModule softwareModule) {
setSoftwareModule(softwareModule);
this.sha1Hash = sha1Hash;
this.filename = filename;
this.softwareModule = (JpaSoftwareModule) softwareModule;
this.softwareModule.addArtifact(this);
}

@Override
Expand Down Expand Up @@ -130,11 +131,6 @@ public SoftwareModule getSoftwareModule() {
return softwareModule;
}

public final void setSoftwareModule(final SoftwareModule softwareModule) {
this.softwareModule = (JpaSoftwareModule) softwareModule;
this.softwareModule.addArtifact(this);
}

@Override
public String getFilename() {
return filename;
Expand Down
Loading

0 comments on commit 9bc0e74

Please sign in to comment.