Commit 0aa693b4 authored by Thomas Bernhart's avatar Thomas Bernhart
Browse files

Add Ingester

parent 49160029
Pipeline #11487 failed with stages
in 1 minute and 25 seconds
......@@ -4,32 +4,34 @@ import org.apache.logging.log4j.LogManager
import org.fcrepo.client.FcrepoOperationFailedException
import org.memobase.fedora.FedoraClient
import org.memobase.sftp.SftpClient
import java.io.File
import java.io.InputStream
import java.net.URI
class Ingest (
class Ingester (
private val sftpClient: SftpClient,
private val fedoraClient: FedoraClient) {
private val log = LogManager.getLogger("IngestService")
fun ingest(id: String): Report {
@Throws(FcrepoOperationFailedException::class)
fun ingest(id: String) {
log.info("Ingest record $id.")
return try {
// fedoraClient.createOrUpdateRdfResource()
throw FcrepoOperationFailedException(
URI("http://mb-fed1.memobase.unibas.ch:8080/fcrepo/rest"), 501, "Not Implemented."
)
Report(
id = id,
status = ReportStatus.success,
message = ReportMessages.ingestedRecord(id)
)
} catch (e: FcrepoOperationFailedException) {
Report(
id = id,
status = org.memobase.ReportStatus.failure,
message = org.memobase.ReportMessages.ingestFailed(id)
)
}
// fedoraClient.createOrUpdateRdfResource()
// if (rdf.hasFileReference()) {
// fedoraClient.createOrUpdateBinaryResource()
// }
throw FcrepoOperationFailedException(
URI("http://mb-fed1.memobase.unibas.ch:8080/fcrepo/rest"), 501, "Not Implemented."
)
}
// private fun parseRdf(rdf: String) {
// "<https://www.ica.org/standards/RiC/ontology#identifier>"
// }
// private fun openSftpFile(file: File): InputStream {
// sftpClient.open(file)
// }
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment