@Override protected String getDeletedEntityName(final Long entityId) { final Optional<DistributionSet> distribution = distributionSetManagement.get(entityId); if (distribution.isPresent()) { return distribution.get().getName(); } return ""; }
private DistributionSet findDistributionSetAndThrowExceptionIfNotFound(final Long setId) { return distributionSetManagement.get(setId) .orElseThrow(() -> new EntityNotFoundException(DistributionSet.class, setId)); } }
private DistributionSet findDistributionSetAndThrowExceptionIfNotFound(final Long setId) { return distributionSetManagement.get(setId) .orElseThrow(() -> new EntityNotFoundException(DistributionSet.class, setId)); }
private DistributionSet findDistributionSetAndThrowExceptionIfNotFound(final Long setId) { return distributionSetManagement.get(setId) .orElseThrow(() -> new EntityNotFoundException(DistributionSet.class, setId)); } }
@Override protected String getDeletedEntityName(final Long entityId) { final Optional<DistributionSet> distribution = distributionSetManagement.get(entityId); if (distribution.isPresent()) { return distribution.get().getName(); } return ""; }
private DistributionSet findDistributionSetWithExceptionIfNotFound(final Long distributionSetId) { return distributionSetManagement.get(distributionSetId) .orElseThrow(() -> new EntityNotFoundException(DistributionSet.class, distributionSetId)); } }
@Override protected String getDeletedEntityName(final Long entityId) { final Optional<DistributionSet> distribution = distributionSetManagement.get(entityId); if (distribution.isPresent()) { return distribution.get().getName(); } return ""; }
@Override protected String getDeletedEntityName(final Long entityId) { final Optional<DistributionSet> distribution = distributionSetManagement.get(entityId); if (distribution.isPresent()) { return distribution.get().getName(); } return ""; }
private DistributionSet findDistributionSetAndThrowExceptionIfNotFound(final Long setId) { return distributionSetManagement.get(setId) .orElseThrow(() -> new EntityNotFoundException(DistributionSet.class, setId)); }
@Override protected void showMetadataDetails(final String metadataKey) { distributionSetManagement.get(selectedDistSetId) .ifPresent(distSet -> UI.getCurrent().addWindow(dsMetadataPopupLayout.getWindow(distSet, metadataKey))); }
private DistributionSet findDistributionSetOrThrowException(final MgmtRolloutRestRequestBody rolloutRequestBody) { return this.distributionSetManagement.get(rolloutRequestBody.getDistributionSetId()).orElseThrow( () -> new EntityNotFoundException(DistributionSet.class, rolloutRequestBody.getDistributionSetId())); } }
@Override protected void showMetadataDetails(final String metadataKey) { distributionSetManagement.get(selectedDistSetId) .ifPresent(distSet -> UI.getCurrent().addWindow(dsMetadataPopupLayout.getWindow(distSet, metadataKey))); }
private String saveAllAssignments() { final ActionType actionType = ActionType.FORCED; final long forcedTimeStamp = new Date().getTime(); final TargetBulkUpload targetBulkUpload = managementUIState.getTargetTableFilters().getBulkUpload(); final List<String> targetsList = targetBulkUpload.getTargetsCreated(); final Long dsSelected = (Long) comboBox.getValue(); if (!distributionSetManagement.get(dsSelected).isPresent()) { return i18n.getMessage("message.bulk.upload.assignment.failed"); } deploymentManagement.assignDistributionSet(targetBulkUpload.getDsNameAndVersion(), actionType, forcedTimeStamp, targetsList); return null; }
private String saveAllAssignments() { final ActionType actionType = ActionType.FORCED; final long forcedTimeStamp = new Date().getTime(); final TargetBulkUpload targetBulkUpload = managementUIState.getTargetTableFilters().getBulkUpload(); final List<String> targetsList = targetBulkUpload.getTargetsCreated(); final Long dsSelected = (Long) comboBox.getValue(); if (!distributionSetManagement.get(dsSelected).isPresent()) { return i18n.getMessage("message.bulk.upload.assignment.failed"); } deploymentManagement.assignDistributionSet(targetBulkUpload.getDsNameAndVersion(), actionType, forcedTimeStamp, targetsList); return null; }
private void handleSmToDsAssignment(final Set<Long> softwareModulesIdList, final long distId) { final Optional<DistributionSet> distributionSet = distributionSetManagement.get(distId); if (!distributionSet.isPresent()) { getNotification().displayWarning(getI18n().getMessage("distributionset.not.exists")); return; } distributionSet.ifPresent(ds -> { selectDroppedEntities(ds.getId()); final Set<SoftwareModule> softwareModules = getAssignableSoftwareModules(softwareModulesIdList, ds); if (softwareModules.isEmpty()) { return; } assignSoftwareModulesToDs(softwareModules, ds); openConfirmationWindowForAssignment(ds.getName(), softwareModules.stream().map(SoftwareModuleIdName::new) .toArray(size -> new SoftwareModuleIdName[size])); }); }
private void handleSmToDsAssignment(final Set<Long> softwareModulesIdList, final long distId) { final Optional<DistributionSet> distributionSet = distributionSetManagement.get(distId); if (!distributionSet.isPresent()) { getNotification().displayWarning(getI18n().getMessage("distributionset.not.exists")); return; } distributionSet.ifPresent(ds -> { selectDroppedEntities(ds.getId()); final Set<SoftwareModule> softwareModules = getAssignableSoftwareModules(softwareModulesIdList, ds); if (softwareModules.isEmpty()) { return; } assignSoftwareModulesToDs(softwareModules, ds); openConfirmationWindowForAssignment(ds.getName(), softwareModules.stream().map(SoftwareModuleIdName::new) .toArray(size -> new SoftwareModuleIdName[size])); }); }
@Override protected void showMetadata(final ClickEvent event) { final Optional<DistributionSet> ds = distributionSetManagement.get(getSelectedBaseEntityId()); if (!ds.isPresent()) { uiNotification.displayWarning(getI18n().getMessage("distributionset.not.exists")); return; } UI.getCurrent().addWindow(dsMetadataPopupLayout.getWindow(ds.get(), null)); }
@Override protected void showMetadata(final ClickEvent event) { final Optional<DistributionSet> ds = distributionSetManagement.get(getSelectedBaseEntityId()); if (!ds.isPresent()) { uiNotification.displayWarning(getI18n().getMessage("distributionset.not.exists")); return; } UI.getCurrent().addWindow(dsMetadataPopupLayout.getWindow(ds.get(), null)); }
private void assignTargetToDs(final Item item, final List<Target> targetDetailsList) { if (item == null || item.getItemProperty("id") == null) { return; } if (targetDetailsList.isEmpty()) { getNotification().displayWarning(getI18n().getMessage(TARGETS_NOT_EXISTS)); return; } final Long distId = (Long) item.getItemProperty("id").getValue(); selectDroppedEntities(distId); final Optional<DistributionSet> findDistributionSetById = distributionSetManagement.get(distId); if (!findDistributionSetById.isPresent()) { getNotification().displayWarning(getI18n().getMessage(DISTRIBUTIONSET_NOT_EXISTS)); return; } addNewDistributionToAssignmentList(targetDetailsList, findDistributionSetById.get()); openConfirmationWindowForAssignment(findDistributionSetById.get().getName(), targetDetailsList); }
private void assignTargetToDs(final Item item, final List<Target> targetDetailsList) { if (item == null || item.getItemProperty("id") == null) { return; } if (targetDetailsList.isEmpty()) { getNotification().displayWarning(getI18n().getMessage(TARGETS_NOT_EXISTS)); return; } final Long distId = (Long) item.getItemProperty("id").getValue(); selectDroppedEntities(distId); final Optional<DistributionSet> findDistributionSetById = distributionSetManagement.get(distId); if (!findDistributionSetById.isPresent()) { getNotification().displayWarning(getI18n().getMessage(DISTRIBUTIONSET_NOT_EXISTS)); return; } addNewDistributionToAssignmentList(targetDetailsList, findDistributionSetById.get()); openConfirmationWindowForAssignment(findDistributionSetById.get().getName(), targetDetailsList); }