Additionally, * removed DistributionSet.getAutoAssignFilters and * removed SoftwareModule.getAssignedTo both are not used and exposed via Mgmt API. Maybe, if needed, they could be returned back along with exposing them via Mgmt API. Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -26,11 +26,41 @@ import java.util.Set;
|
|||||||
public interface DistributionSet extends NamedVersionedEntity {
|
public interface DistributionSet extends NamedVersionedEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return <code>true</code> if the set is deleted and only kept for history
|
* @return type of the {@link DistributionSet}.
|
||||||
|
*/
|
||||||
|
DistributionSetType getType();
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return unmodifiableSet of {@link SoftwareModule}.
|
||||||
|
*/
|
||||||
|
Set<SoftwareModule> getModules();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return <code>true</code> if all defined
|
||||||
|
* {@link DistributionSetType#getMandatoryModuleTypes()} of
|
||||||
|
* {@link #getType()} are present in this {@link DistributionSet}.
|
||||||
|
*/
|
||||||
|
boolean isComplete();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return <code>true</code> if this {@link DistributionSet} is locked. If so it's 'functional'
|
||||||
|
* properties (e.g. software modules) could not be modified anymore.
|
||||||
|
*/
|
||||||
|
boolean isLocked();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return <code>true</code> if this {@link DistributionSet} is deleted and only kept for history
|
||||||
* purposes.
|
* purposes.
|
||||||
*/
|
*/
|
||||||
boolean isDeleted();
|
boolean isDeleted();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return <code>false</code> if this {@link DistributionSet} is
|
||||||
|
* invalidated.
|
||||||
|
*/
|
||||||
|
boolean isValid();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return <code>true</code> if {@link DistributionSet} contains a mandatory
|
* @return <code>true</code> if {@link DistributionSet} contains a mandatory
|
||||||
* migration step, i.e. unfinished {@link Action}s will kept active
|
* migration step, i.e. unfinished {@link Action}s will kept active
|
||||||
@@ -38,17 +68,6 @@ public interface DistributionSet extends NamedVersionedEntity {
|
|||||||
*/
|
*/
|
||||||
boolean isRequiredMigrationStep();
|
boolean isRequiredMigrationStep();
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the auto assign target filters
|
|
||||||
*/
|
|
||||||
List<TargetFilterQuery> getAutoAssignFilters();
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @return unmodifiableSet of {@link SoftwareModule}.
|
|
||||||
*/
|
|
||||||
Set<SoftwareModule> getModules();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Searches through modules for the given type.
|
* Searches through modules for the given type.
|
||||||
*
|
*
|
||||||
@@ -59,23 +78,4 @@ public interface DistributionSet extends NamedVersionedEntity {
|
|||||||
default Optional<SoftwareModule> findFirstModuleByType(final SoftwareModuleType type) {
|
default Optional<SoftwareModule> findFirstModuleByType(final SoftwareModuleType type) {
|
||||||
return getModules().stream().filter(module -> module.getType().equals(type)).findAny();
|
return getModules().stream().filter(module -> module.getType().equals(type)).findAny();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @return type of the {@link DistributionSet}.
|
|
||||||
*/
|
|
||||||
DistributionSetType getType();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return <code>true</code> if all defined
|
|
||||||
* {@link DistributionSetType#getMandatoryModuleTypes()} of
|
|
||||||
* {@link #getType()} are present in this {@link DistributionSet}.
|
|
||||||
*/
|
|
||||||
boolean isComplete();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return <code>false</code> if this {@link DistributionSet} is
|
|
||||||
* invalidated.
|
|
||||||
*/
|
|
||||||
boolean isValid();
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -14,14 +14,47 @@ import java.util.Optional;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Software package as sub element of a {@link DistributionSet}.
|
* Software package as sub element of a {@link DistributionSet}.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public interface SoftwareModule extends NamedVersionedEntity {
|
public interface SoftwareModule extends NamedVersionedEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum length of software vendor.
|
* Maximum length of software vendor.
|
||||||
*/
|
*/
|
||||||
int VENDOR_MAX_SIZE = 256;
|
int VENDOR_MAX_SIZE = 256;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the type of the software module
|
||||||
|
*/
|
||||||
|
SoftwareModuleType getType();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return immutable list of all artifacts
|
||||||
|
*/
|
||||||
|
List<Artifact> getArtifacts();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the vendor of this {@link SoftwareModule}.
|
||||||
|
*/
|
||||||
|
String getVendor();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {@code true} if this software module is marked as encrypted
|
||||||
|
* otherwise {@code false}
|
||||||
|
*/
|
||||||
|
boolean isEncrypted();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return <code>true</code> if this {@link SoftwareModule} is locked. If so it's 'functional'
|
||||||
|
* properties (e.g. software modules) could not be modified anymore.
|
||||||
|
*/
|
||||||
|
boolean isLocked();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {@code true} if this {@link SoftwareModule} is marked as deleted
|
||||||
|
* otherwise {@code false}
|
||||||
|
*/
|
||||||
|
boolean isDeleted();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param artifactId
|
* @param artifactId
|
||||||
* to look for
|
* to look for
|
||||||
@@ -40,37 +73,4 @@ public interface SoftwareModule extends NamedVersionedEntity {
|
|||||||
return getArtifacts().stream().filter(artifact -> artifact.getFilename().equalsIgnoreCase(fileName.trim()))
|
return getArtifacts().stream().filter(artifact -> artifact.getFilename().equalsIgnoreCase(fileName.trim()))
|
||||||
.findAny();
|
.findAny();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @return immutable list of all artifacts
|
|
||||||
*/
|
|
||||||
List<Artifact> getArtifacts();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the vendor of this software module
|
|
||||||
*/
|
|
||||||
String getVendor();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the type of the software module
|
|
||||||
*/
|
|
||||||
SoftwareModuleType getType();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return {@code true} if this software module is marked as deleted
|
|
||||||
* otherwise {@code false}
|
|
||||||
*/
|
|
||||||
boolean isDeleted();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return immutable list of {@link DistributionSet}s the module is assigned
|
|
||||||
* to
|
|
||||||
*/
|
|
||||||
List<DistributionSet> getAssignedTo();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return {@code true} if this software module is marked as encrypted
|
|
||||||
* otherwise {@code false}
|
|
||||||
*/
|
|
||||||
boolean isEncrypted();
|
|
||||||
}
|
|
||||||
@@ -123,6 +123,7 @@ public class JpaDistributionSet extends AbstractJpaNamedVersionedEntity implemen
|
|||||||
private boolean requiredMigrationStep;
|
private boolean requiredMigrationStep;
|
||||||
|
|
||||||
@ToString.Exclude
|
@ToString.Exclude
|
||||||
|
@Getter(AccessLevel.NONE)
|
||||||
@OneToMany(mappedBy = "autoAssignDistributionSet", targetEntity = JpaTargetFilterQuery.class, fetch = FetchType.LAZY)
|
@OneToMany(mappedBy = "autoAssignDistributionSet", targetEntity = JpaTargetFilterQuery.class, fetch = FetchType.LAZY)
|
||||||
private List<TargetFilterQuery> autoAssignFilters;
|
private List<TargetFilterQuery> autoAssignFilters;
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,9 @@ public class JpaSoftwareModule extends AbstractJpaNamedVersionedEntity implement
|
|||||||
@Size(max = SoftwareModule.VENDOR_MAX_SIZE)
|
@Size(max = SoftwareModule.VENDOR_MAX_SIZE)
|
||||||
private String vendor;
|
private String vendor;
|
||||||
|
|
||||||
|
@Column(name = "encrypted")
|
||||||
|
private boolean encrypted;
|
||||||
|
|
||||||
@ToString.Exclude
|
@ToString.Exclude
|
||||||
@CascadeOnDelete
|
@CascadeOnDelete
|
||||||
@OneToMany(mappedBy = "softwareModule", fetch = FetchType.LAZY, targetEntity = JpaSoftwareModuleMetadata.class)
|
@OneToMany(mappedBy = "softwareModule", fetch = FetchType.LAZY, targetEntity = JpaSoftwareModuleMetadata.class)
|
||||||
@@ -99,9 +102,6 @@ public class JpaSoftwareModule extends AbstractJpaNamedVersionedEntity implement
|
|||||||
@Column(name = "deleted")
|
@Column(name = "deleted")
|
||||||
private boolean deleted;
|
private boolean deleted;
|
||||||
|
|
||||||
@Column(name = "encrypted")
|
|
||||||
private boolean encrypted;
|
|
||||||
|
|
||||||
@ToString.Exclude
|
@ToString.Exclude
|
||||||
@Getter(AccessLevel.NONE)
|
@Getter(AccessLevel.NONE)
|
||||||
@CascadeOnDelete
|
@CascadeOnDelete
|
||||||
@@ -190,15 +190,6 @@ public class JpaSoftwareModule extends AbstractJpaNamedVersionedEntity implement
|
|||||||
this.encrypted = encrypted;
|
this.encrypted = encrypted;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<DistributionSet> getAssignedTo() {
|
|
||||||
if (assignedTo == null) {
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
|
|
||||||
return Collections.unmodifiableList(assignedTo);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fireCreateEvent(final DescriptorEvent descriptorEvent) {
|
public void fireCreateEvent(final DescriptorEvent descriptorEvent) {
|
||||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(
|
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(
|
||||||
|
|||||||
Reference in New Issue
Block a user