@Override protected Optional<SoftwareModule> findEntityByTableValue(final Long lastSelectedId) { return softwareModuleManagement.get(lastSelectedId); }
@Override protected Optional<SoftwareModule> findEntityByTableValue(final Long entityTableId) { return softwareModuleManagement.get(entityTableId); }
@Override protected Optional<SoftwareModule> findEntityByTableValue(final Long entityTableId) { return softwareModuleManagement.get(entityTableId); }
private Collection<SoftwareModule> findSoftwareModuleWithExceptionIfNotFound( final Collection<Long> softwareModuleId) { if (CollectionUtils.isEmpty(softwareModuleId)) { return Collections.emptyList(); } final Collection<SoftwareModule> module = softwareModuleManagement.get(softwareModuleId); if (module.size() < softwareModuleId.size()) { throw new EntityNotFoundException(SoftwareModule.class, softwareModuleId); } return module; }
private Optional<SoftwareModule> findSelectedSoftwareModule() { final Optional<Long> selectedBaseSwModuleId = artifactUploadState.getSelectedBaseSwModuleId(); if (selectedBaseSwModuleId.isPresent()) { return softwareModuleManagement.get(selectedBaseSwModuleId.get()); } return Optional.empty(); }
private Optional<SoftwareModule> findSelectedSoftwareModule() { final Optional<Long> selectedBaseSwModuleId = artifactUploadState.getSelectedBaseSwModuleId(); if (selectedBaseSwModuleId.isPresent()) { return softwareModuleManagement.get(selectedBaseSwModuleId.get()); } return Optional.empty(); }
private Collection<SoftwareModule> findSoftwareModuleWithExceptionIfNotFound( final Collection<Long> softwareModuleId) { if (CollectionUtils.isEmpty(softwareModuleId)) { return Collections.emptyList(); } final Collection<SoftwareModule> module = softwareModuleManagement.get(softwareModuleId); if (module.size() < softwareModuleId.size()) { throw new EntityNotFoundException(SoftwareModule.class, softwareModuleId); } return module; }
private Set<SoftwareModule> getAssignableSoftwareModules(final Set<Long> softwareModulesIds, final DistributionSet distributionSet) { final Set<SoftwareModule> assignableModules = new HashSet<>(); for (final Long softwareModuleId : softwareModulesIds) { final Optional<SoftwareModule> softwareModule = softwareModuleManagement.get(softwareModuleId); softwareModule.ifPresent(sm -> { if (validateAssignment(sm, distributionSet)){ assignableModules.add(sm); } }); } return assignableModules; }
@Override protected String getDeletedEntityName(final Long entityId) { final Optional<SoftwareModule> softwareModule = softwareModuleManagement.get(entityId); if (softwareModule.isPresent()) { return softwareModule.get().getName() + ":" + softwareModule.get().getVersion(); } return ""; }
@Override protected String getDeletedEntityName(final Long entityId) { final Optional<SoftwareModule> softwareModule = softwareModuleManagement.get(entityId); if (softwareModule.isPresent()) { return softwareModule.get().getName() + ":" + softwareModule.get().getVersion(); } return ""; }
@Override protected String getDeletedEntityName(final Long entityId) { final Optional<SoftwareModule> softwareModule = softwareModuleManagement.get(entityId); if (softwareModule.isPresent()) { return softwareModule.get().getName() + ":" + softwareModule.get().getVersion(); } return ""; }
@Override protected String getDeletedEntityName(final Long entityId) { final Optional<SoftwareModule> softwareModule = softwareModuleManagement.get(entityId); if (softwareModule.isPresent()) { return softwareModule.get().getName() + ":" + softwareModule.get().getVersion(); } return ""; }
private SoftwareModule getSelectedSoftwareModule() { if (getUploadState().isMoreThanOneSoftwareModulesSelected()) { throw new IllegalStateException("More than one SoftwareModul selected but only one is allowed"); } final long selectedId = getUploadState().getSelectedBaseSwModuleId() .orElseThrow(() -> new IllegalStateException("No SoftwareModul selected")); return softwareModuleManagement.get(selectedId) .orElseThrow(() -> new IllegalStateException("SoftwareModul with unknown ID selected")); }
private SoftwareModule findSoftwareModuleWithExceptionIfNotFound(final Long softwareModuleId, final Long artifactId) { final SoftwareModule module = softwareModuleManagement.get(softwareModuleId) .orElseThrow(() -> new EntityNotFoundException(SoftwareModule.class, softwareModuleId)); if (artifactId != null && !module.getArtifact(artifactId).isPresent()) { throw new EntityNotFoundException(Artifact.class, artifactId); } return module; } }
@Override protected void showMetadataDetails(final String metadataKey) { softwareModuleManagement.get(selectedSWModuleId).ifPresent( swmodule -> UI.getCurrent().addWindow(swMetadataPopupLayout.getWindow(swmodule, metadataKey))); }
@Override protected void showMetadataDetails(final String metadataKey) { softwareModuleManagement.get(selectedSWModuleId).ifPresent( swmodule -> UI.getCurrent().addWindow(swMetadataPopupLayout.getWindow(swmodule, metadataKey))); }
@Override public JpaSoftwareModuleMetadata build() { final SoftwareModule module = softwareModuleManagement.get(softwareModuleId) .orElseThrow(() -> new EntityNotFoundException(SoftwareModule.class, softwareModuleId)); if (key == null) { new JpaSoftwareModuleMetadata(key, module, value, isTargetVisible().orElse(false)); } return new JpaSoftwareModuleMetadata(key, module, value, isTargetVisible().orElse(false)); }
@Override public JpaSoftwareModuleMetadata build() { final SoftwareModule module = softwareModuleManagement.get(softwareModuleId) .orElseThrow(() -> new EntityNotFoundException(SoftwareModule.class, softwareModuleId)); if (key == null) { new JpaSoftwareModuleMetadata(key, module, value, isTargetVisible().orElse(false)); } return new JpaSoftwareModuleMetadata(key, module, value, isTargetVisible().orElse(false)); }
@Override protected void showMetadata(final ClickEvent event) { softwareModuleManagement.get(getSelectedBaseEntityId()) .ifPresent(swmodule -> UI.getCurrent().addWindow(swMetadataPopupLayout.getWindow(swmodule, null))); }
@Override protected void showMetadata(final ClickEvent event) { softwareModuleManagement.get(getSelectedBaseEntityId()) .ifPresent(swmodule -> UI.getCurrent().addWindow(swMetadataPopupLayout.getWindow(swmodule, null))); }