use of com.thinkbiganalytics.feedmgr.rest.model.UploadProgress in project kylo by Teradata.
the class UploadProgressService method addUploadStatus.
public UploadProgressMessage addUploadStatus(String uploadKey, String message, boolean complete, boolean success) {
UploadProgress uploadProgress = getUploadStatus(uploadKey);
if (uploadProgress != null) {
UploadProgressMessage uploadProgressMessage = new UploadProgressMessage(message);
if (complete) {
uploadProgressMessage.complete(success);
}
uploadProgress.getMessages().add(uploadProgressMessage);
return uploadProgressMessage;
}
return null;
}
use of com.thinkbiganalytics.feedmgr.rest.model.UploadProgress in project kylo by Teradata.
the class UploadProgressService method updateUploadStatus.
public UploadProgressMessage updateUploadStatus(String uploadKey, String messageKey, String message, boolean complete) {
UploadProgress uploadProgress = getUploadStatus(uploadKey);
if (uploadProgress != null) {
UploadProgressMessage uploadProgressMessage = uploadProgress.getMessage(messageKey);
if (uploadProgressMessage == null) {
uploadProgressMessage = new UploadProgressMessage();
uploadProgressMessage.setMessageKey(messageKey);
}
uploadProgressMessage.setMessage(message);
uploadProgressMessage.setDateTime(DateTime.now());
uploadProgressMessage.setComplete(complete);
uploadProgress.getMessages().add(new UploadProgressMessage(message));
return uploadProgressMessage;
}
return null;
}
use of com.thinkbiganalytics.feedmgr.rest.model.UploadProgress in project kylo by Teradata.
the class FeedImporter method validateAndImport.
public ImportFeed validateAndImport() {
UploadProgress progress = uploadProgressService.getUploadStatus(importFeedOptions.getUploadKey());
progress.setSections(ImportSection.sectionsForImportAsString(ImportType.FEED));
validate();
if (this.importFeed.isValid()) {
try {
importFeed();
} catch (Exception e) {
// rollback
log.error("Error importing feed {}", fileName, e);
}
}
return importFeed;
}
use of com.thinkbiganalytics.feedmgr.rest.model.UploadProgress in project kylo by Teradata.
the class UploadProgressService method completeSection.
public void completeSection(ImportOptions options, ImportSection.Section section) {
UploadProgress progress = getUploadStatus(options.getUploadKey());
progress.completeSection(section.name());
}
use of com.thinkbiganalytics.feedmgr.rest.model.UploadProgress in project kylo by Teradata.
the class TemplateImporter method initializeImportTemplateArchive.
private void initializeImportTemplateArchive() throws ImportException {
try {
UploadProgress progress = uploadProgressService.getUploadStatus(importOptions.getUploadKey());
progress.setSections(ImportSection.sectionsForImportAsString(ImportType.TEMPLATE));
InputStream inputStream = new ByteArrayInputStream(file);
this.importTemplate = ImportUtil.openZip(fileName, inputStream);
this.importTemplate.setValid(true);
Set<ImportComponentOption> componentOptions = ImportUtil.inspectZipComponents(file, ImportType.TEMPLATE);
importTemplateOptions.addOptionsIfNotExists(componentOptions);
importTemplateOptions.findImportComponentOption(ImportComponent.TEMPLATE_CONNECTION_INFORMATION).addConnectionInfo(importTemplate.getReusableTemplateConnections());
importTemplateOptions.findImportComponentOption(ImportComponent.REMOTE_INPUT_PORT).addRemoteProcessGroupInputPorts(importTemplate.getRemoteProcessGroupInputPortNames());
importTemplate.setImportOptions(this.importTemplateOptions);
} catch (Exception e) {
throw new ImportException("Unable to open template archive " + fileName + " for import. ", e);
}
}
Aggregations