Skip to content
Snippets Groups Projects
Unverified Commit 285724dd authored by Richard Cordovano's avatar Richard Cordovano Committed by GitHub
Browse files

Merge pull request #1946 from APriestman/6415_streamingIngestPipeline

6415 streaming ingest pipeline
parents 679bde48 4b55817a
No related branches found
No related tags found
No related merge requests found
......@@ -84,11 +84,6 @@ TskAutoDbJava::initializeJni(JNIEnv * jniEnv, jobject jobj) {
return TSK_ERR;
}
m_addImageNameMethodID = m_jniEnv->GetMethodID(m_callbackClass, "addImageName", "(JLjava/lang/String;J)I");
if (m_addImageNameMethodID == NULL) {
return TSK_ERR;
}
m_addVolumeSystemMethodID = m_jniEnv->GetMethodID(m_callbackClass, "addVsInfo", "(JIJJ)J");
if (m_addVolumeSystemMethodID == NULL) {
return TSK_ERR;
......@@ -227,29 +222,6 @@ TskAutoDbJava::addImageInfo(int type, TSK_OFF_T ssize, int64_t & objId, const st
return TSK_OK;
}
/**
* Adds one image name
* @param objId The object ID of the image
* @param imgName The image name
* @param sequence The sequence number for this image name
* @returns TSK_ERR on error, TSK_OK on success
*/
TSK_RETVAL_ENUM
TskAutoDbJava::addImageName(int64_t objId, char const* imgName, int sequence) {
jstring imgNamej = m_jniEnv->NewStringUTF(imgName);
jint res = m_jniEnv->CallIntMethod(m_javaDbObj, m_addImageNameMethodID,
objId, imgNamej, (int64_t)sequence);
if (res == 0) {
return TSK_OK;
}
else {
return TSK_ERR;
}
}
/**
* Adds volume system to database. Object ID for new vs stored in objId.
*
......
......@@ -125,7 +125,13 @@ long addImageInfo(int type, long ssize, String timezone,
}
commitTransaction();
addDataSourceCallbacks.onDataSourceAdded(objId);
try {
addDataSourceCallbacks.onDataSourceAdded(objId);
} catch (Exception ex) {
// Exception firewall - we do not want to return to the native code without
// passing it the data source ID
logger.log(Level.SEVERE, "Unexpected error from data source added callback", ex);
}
return objId;
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Error adding image to the database", ex);
......@@ -134,30 +140,6 @@ long addImageInfo(int type, long ssize, String timezone,
}
}
/**
* Add an image name to the database.
* Intended to be called from the native code during the add image process.
*
* @param objId The object id of the image.
* @param name The file name for the image
* @param sequence The sequence number of this file.
*
* @return 0 if successful, -1 if not
*/
int addImageName(long objId, String name, long sequence) {
try {
beginTransaction();
caseDb.addImageNameJNI(objId, name, sequence, trans);
commitTransaction();
return 0;
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Error adding image name to the database - image obj ID: " + objId + ", image name: " + name
+ ", sequence: " + sequence, ex);
revertTransaction();
return -1;
}
}
/**
* Add a volume system to the database.
* Intended to be called from the native code during the add image process.
......@@ -394,7 +376,12 @@ private long addBatchedFilesToDb() {
}
}
commitTransaction();
addDataSourceCallbacks.onFilesAdded(newObjIds);
try {
addDataSourceCallbacks.onFilesAdded(newObjIds);
} catch (Exception ex) {
// Exception firewall to prevent unexpected return to the native code
logger.log(Level.SEVERE, "Unexpected error from files added callback", ex);
}
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Error adding batched files to database", ex);
revertTransaction();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment