use of org.folio.dataimport.util.marc.MarcRecordType in project mod-source-record-manager by folio-org.
the class DataImportPayloadContextBuilderImpl method getEntityType.
private EntityType getEntityType(Record marcRecord) {
requireNonNull(marcRecord.getParsedRecord(), "Parsed record is null");
requireNonNull(marcRecord.getParsedRecord().getContent(), "Parsed record content is null");
MarcRecordType type = analyzer.process(new JsonObject(marcRecord.getParsedRecord().getContent().toString()));
EntityType entityType = MARC_TO_ENTITY_TYPE.get(type);
if (entityType == null) {
throw new IllegalStateException("Unsupported Marc record type");
}
return entityType;
}
use of org.folio.dataimport.util.marc.MarcRecordType in project mod-source-record-manager by folio-org.
the class ChangeEngineServiceImpl method inferRecordType.
private RecordType inferRecordType(JobExecution jobExecution, ParsedResult recordParsedResult, String recordId, String chunkId) {
if (Objects.equals(jobExecution.getJobProfileInfo().getDataType(), DataType.MARC)) {
MarcRecordType marcRecordType = marcRecordAnalyzer.process(recordParsedResult.getParsedRecord());
checkLeaderLine(marcRecordType, recordParsedResult, jobExecution, recordId, chunkId);
return MarcRecordType.NA == marcRecordType ? null : RecordType.valueOf(MARC_FORMAT + marcRecordType.name());
}
return RecordType.valueOf(jobExecution.getJobProfileInfo().getDataType().value());
}
Aggregations