/** * Constructor using a copy object. * * @param toCopy */ public IngestReport(IngestReport toCopy) { this.totalPackageSize = toCopy.getTotalPackageSize(); this.dataItemsPerCollectionCount = toCopy.getDataItemsPerCollectionCount(); this.fileTypeCount = toCopy.getFileTypeCount(); this.generatedChecksumsCount = toCopy.getGeneratedChecksumsCount(); this.verifiedChecksumsCount = toCopy.getVerifiedChecksumsCount(); this.unverifiedChecksumsCount = toCopy.getUnverifiedChecksumsCount(); this.unmatchedFileTypes = toCopy.getUnmatchedFileTypes(); this.unmatchedRegisteredSchemasCount = toCopy.getUnmatchedRegisteredSchemasCount(); this.registeredSchemasCount = toCopy.getRegisteredSchemasCount(); this.unRegisteredSchemasCount = toCopy.getUnRegisteredSchemasCount(); this.invalidMetadataFileWRegisteredSchemas = toCopy.getInvalidMetadataFileWRegisteredSchemas(); this.packageReadable = toCopy.isPackageReadable(); this.packageConforming = toCopy.isPackageConforming(); this.packageHasUnresolvableIds = toCopy.packageHasUnresolvableIds; this.status = toCopy.getStatus(); this.validatedMetadataMessages = toCopy.getValidatedMetadataMessages(); }
@Override public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { IngestReport ingestReport = new IngestReport(); String value = reader.getValue(); if (!isEmptyOrNull(value)) { ingestReport.setTotalPackageSize(Long.parseLong(value.trim())); ingestReport.setFileTypeCount(matchedFileTypes); ingestReport.setDataItemsPerCollectionCount(dataItemsPerCollectionCount); ingestReport.setGeneratedChecksumsCount(generatedChecksums); ingestReport.setVerifiedChecksumsCount(verifiedChecksums); ingestReport.setUnverifiedChecksumsCount(unverifiedChecksums); ingestReport.setRegisteredSchemasCount(registeredSchemas); ingestReport.setUnRegisteredSchemasCount(unregisteredSchemas); ingestReport.setInvalidMetadataFileWRegisteredSchemas(invalidMetadataFiles); ingestReport.setUnmatchedFileTypes(unmatchedFileTypes); ingestReport.setUnmatchedRegisteredSchemasCount(unmatchedRegisteredSchemas); ingestReport.setContentDetectionTools(contentDetectionTools);
private IngestReport buildIngestReport(String depositId, IngestWorkflowState state) throws ReportServiceException { IngestReport report = new IngestReport(); report.setStatus(IngestReport.Status.ERRORS); report.setStatusMessage(reportSummary.toString()); } else { report.setStatus(IngestReport.Status.WARNINGS); Map<String, String> filesWithUnverifiedFormats = new HashMap<String, String>(); reportSummary.append("Pre-ingest process produced the following warning(s): <br/>" ); report.setUnmatchedFileTypes(filesWithUnverifiedFormats); report.setStatusMessage(reportSummary.toString()); } else { //no events which constitute warning conditions -> SUCCESS report.setStatus(IngestReport.Status.SUCCESSFUL); report.setStatusMessage("Pre-ingest process completed successfully with no warnings or errors."); report.setDataItemsPerCollectionCount(buildDataItemCountToCollectionIdMap(state)); report.setTotalPackageSize(getTotalBytesForIngest(state)); report.setGeneratedChecksumsCount(getGeneratedChecksumsCount(depositId, state)); report.setContentDetectionTools(getContentDetectionToolInfo(fileAttributeSets)); report.setFileTypeCount(getFileCountByFormat(fileAttributeSets)); report.setValidatedMetadataMessages(metadataValidationSuccessMessages);
@Override public Map<String, Integer> getDataItemsPerCollectionCount(IngestReport ingestReport) { Map<String, Integer> dataItemsPerCollectionCount = new HashMap<String, Integer>(); for (String key : ingestReport.getDataItemsPerCollectionCount().keySet()) { if (verifyCollectionId(key)) { if (collection != null) { dataItemsPerCollectionCount.put("'" + collection.getTitle() + "' (Existing)", ingestReport .getDataItemsPerCollectionCount().get(key)); dataItemsPerCollectionCount.put("'" + key + "' (New)", ingestReport.getDataItemsPerCollectionCount() .get(key));
@Override public Map<String, Integer> getDataItemsPerCollectionCount(IngestReport ingestReport) { Map<String, Integer> dataItemsPerCollectionCount = new HashMap<String, Integer>(); for (String key : ingestReport.getDataItemsPerCollectionCount().keySet()) { if (verifyCollectionId(key)) { if (collection != null) { dataItemsPerCollectionCount.put("'" + collection.getTitle() + "' (Existing)", ingestReport .getDataItemsPerCollectionCount().get(key)); dataItemsPerCollectionCount.put("'" + key + "' (New)", ingestReport.getDataItemsPerCollectionCount() .get(key));
writer.setValue(Long.toString(ingestReport.getTotalPackageSize())); writer.endNode(); if (ingestReport.getFileTypeCount() != null) { Map<String, Integer> fileTypeCount = ingestReport.getFileTypeCount(); writer.startNode(E_FILE_TYPES); for (String name : fileTypeCount.keySet()) { if (ingestReport.getDataItemsPerCollectionCount() != null) { Map<String, Integer> dataItemsPerCollectionCount = ingestReport.getDataItemsPerCollectionCount(); writer.startNode(E_COLLECTIONS); for (String collectionId : dataItemsPerCollectionCount.keySet()) { if (ingestReport.getGeneratedChecksumsCount() != null) { Map<String, Integer> generatedChecksumsCount = ingestReport.getGeneratedChecksumsCount(); writer.startNode(E_GENERATED_CHECKSUMS); for (String algorithm : generatedChecksumsCount.keySet()) { if (ingestReport.getVerifiedChecksumsCount() != null) { Map<String, Integer> verifiedChecksumsCount = ingestReport.getVerifiedChecksumsCount(); writer.startNode(E_VERIFIED_CHECKSUMS); for (String algorithm : verifiedChecksumsCount.keySet()) { if (ingestReport.getUnverifiedChecksumsCount() != null) { Map<String, Integer> unverifiedChecksumsCount = ingestReport.getUnverifiedChecksumsCount(); writer.startNode(E_UNVERIFIED_CHECKSUMS); for (String algorithm : unverifiedChecksumsCount.keySet()) { if (ingestReport.getRegisteredSchemasCount() != null) { Map<String, Integer> registeredSchemasCount = ingestReport.getRegisteredSchemasCount();