package com.kofax.kmc.kut.utilities.appstats.dao; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteStatement; import com.kofax.kmc.ken.engines.data.ImageSource; import com.kofax.kmc.kut.utilities.appstats.AppStatsDsExportHandler; import com.kofax.kmc.kut.utilities.appstats.AppStatsSqLiteDs; import com.kofax.kmc.kut.utilities.appstats.dao.AppStatsDao; import com.kofax.kmc.kut.utilities.appstats.type.AppStatsDbFieldKeyType; import com.kofax.kmc.kut.utilities.appstats.type.AppStatsDbFieldType; import com.kofax.kmc.kut.utilities.appstats.type.AppStatsDsFieldType; import com.kofax.kmc.kut.utilities.appstats.type.AppStatsDsOpType; import java.util.ArrayList; import java.util.List; import java.util.UUID; /* loaded from: classes3.dex */ public class ImageDao extends AppStatsDao implements Cloneable { private static final String TAG = "ImageDao"; private static final String ro = "Image"; private static Integer rr; private static Integer rs = 0; private static final List rt; Long rP; private String id = new String(); private long rK = 0; private ImageSource rQ = null; private String iL = null; private String rp = new String(); private String oA = null; static { ArrayList arrayList = new ArrayList(); rt = arrayList; arrayList.add(new AppStatsDao.FieldTemplate("ID", AppStatsDsFieldType.DS_FIELD_TYPE_STRING, AppStatsDbFieldType.DB_FIELD_TYPE_GUID, AppStatsDbFieldKeyType.DB_FIELD_PRIMARY_KEY)); arrayList.add(new AppStatsDao.FieldTemplate("EnvironmentID", AppStatsDsFieldType.DS_FIELD_TYPE_STRING, AppStatsDbFieldType.DB_FIELD_TYPE_GUID, AppStatsDbFieldKeyType.DB_FIELD_FOREIGN_KEY)); arrayList.add(new AppStatsDao.FieldTemplate("CreationTime", AppStatsDsFieldType.DS_FIELD_TYPE_DATE, AppStatsDbFieldType.DB_FIELD_TYPE_DATETIME, AppStatsDbFieldKeyType.DB_FIELD_NO_KEY)); arrayList.add(new AppStatsDao.FieldTemplate("FileSize", AppStatsDsFieldType.DS_FIELD_TYPE_LONG, AppStatsDbFieldType.DB_FIELD_TYPE_FLOAT, AppStatsDbFieldKeyType.DB_FIELD_NO_KEY)); arrayList.add(new AppStatsDao.FieldTemplate("Source", AppStatsDsFieldType.DS_FIELD_TYPE_STRING, AppStatsDbFieldType.DB_FIELD_TYPE_TEXT, AppStatsDbFieldKeyType.DB_FIELD_NO_KEY)); arrayList.add(new AppStatsDao.FieldTemplate("DocumentID", AppStatsDsFieldType.DS_FIELD_TYPE_STRING, AppStatsDbFieldType.DB_FIELD_TYPE_GUID, AppStatsDbFieldKeyType.DB_FIELD_FOREIGN_KEY)); arrayList.add(new AppStatsDao.FieldTemplate("StoragePath", AppStatsDsFieldType.DS_FIELD_TYPE_STRING, AppStatsDbFieldType.DB_FIELD_TYPE_TEXT, AppStatsDbFieldKeyType.DB_FIELD_NO_KEY)); arrayList.add(new AppStatsDao.FieldTemplate("SessionKey", AppStatsDsFieldType.DS_FIELD_TYPE_STRING, AppStatsDbFieldType.DB_FIELD_TYPE_TEXT, AppStatsDbFieldKeyType.DB_FIELD_NO_KEY)); } @Override // com.kofax.kmc.kut.utilities.appstats.dao.AppStatsDao public List getWriteToDbStatements(SQLiteDatabase sQLiteDatabase) { String str; SQLiteStatement createInsertStatement; if (this.rQ == ImageSource.IMAGE) { str = ro; } else if (this.rQ == ImageSource.PROCESSOR) { str = "ImageProcessor"; } else { str = this.rQ == ImageSource.CAPTURE ? "ImageCapture" : null; } ArrayList arrayList = new ArrayList(); arrayList.add(String.valueOf(this.id)); arrayList.add(String.valueOf(this.rp)); arrayList.add(String.valueOf(dateStringFromEventTime(getEventTime()))); arrayList.add(this.rP); if (this.dsOperation != AppStatsDsOpType.APP_STATS_DS_UPDATE) { str = String.valueOf(str); } arrayList.add(str); arrayList.add(this.dsOperation == AppStatsDsOpType.APP_STATS_DS_UPDATE ? this.iL : String.valueOf(this.iL)); arrayList.add(""); arrayList.add(String.valueOf(this.oA)); if (this.dsOperation == AppStatsDsOpType.APP_STATS_DS_UPDATE) { createInsertStatement = createUpdateStatement(ro, this.id, rt, arrayList, sQLiteDatabase); } else { createInsertStatement = createInsertStatement(ro, rt, arrayList, sQLiteDatabase); } ArrayList arrayList2 = new ArrayList(); arrayList2.add(createInsertStatement); return arrayList2; } public static long countRows() { return AppStatsSqLiteDs.getInstance().countrows(ro); } public static void export(String str, AppStatsDsExportHandler appStatsDsExportHandler) { export(str, appStatsDsExportHandler, ro, rt); } public long getFileSize() { return this.rP.longValue(); } public void setFileSize(long j) { this.rP = Long.valueOf(j); } @Override // com.kofax.kmc.kut.utilities.appstats.dao.AppStatsDao protected AppStatsDao createDaoSampleSizingObj() { ImageDao imageDao = new ImageDao(); imageDao.id = UUID.randomUUID().toString(); imageDao.rp = UUID.randomUUID().toString(); imageDao.rK = this.rK; imageDao.iL = this.iL; imageDao.rP = this.rP; imageDao.rQ = this.rQ; return imageDao; } public void setSource(ImageSource imageSource) { this.rQ = imageSource; } public void setSessionKey(String str) { this.oA = str; } public void setId(String str) { this.id = str; } public void setEventTime(long j) { this.rK = j; } @Override // com.kofax.kmc.kut.utilities.appstats.dao.AppStatsDao public void setEnvironmentId(String str) { this.rp = str; } public void setDocumentId(String str) { this.iL = str; } @Override // com.kofax.kmc.kut.utilities.appstats.dao.AppStatsDao protected void setAppStatsDaoObjSizeInstCnt(Integer num) { rs = num; } @Override // com.kofax.kmc.kut.utilities.appstats.dao.AppStatsDao protected void setAppStatsDaoObjSize(Integer num) { rr = num; } public ImageSource getSource() { return this.rQ; } public String getSessionKey() { return this.oA; } public String getId() { return this.id; } public long getEventTime() { return this.rK; } @Override // com.kofax.kmc.kut.utilities.appstats.dao.AppStatsDao public String getEnvironmentId() { return this.rp; } public String getDocumentId() { return this.iL; } @Override // com.kofax.kmc.kut.utilities.appstats.dao.AppStatsDao protected Integer getAppStatsDaoObjSizeInstCnt() { return rs; } @Override // com.kofax.kmc.kut.utilities.appstats.dao.AppStatsDao protected Integer getAppStatsDaoObjSize() { return rr; } }