Package de.elo.ix.client.imfs
Class MapHashToCreateRef
java.lang.Object
de.elo.ix.client.imfs.MapHashToCreateRef
This map temporarily stores a list of parent IDs where a document with a given MD5 hash is to be
created. Checking duplicates cannot be exclusively performed via DB, since two documents with the
same MD5 hash could be inserted simultaneously. That's why the MD5 hash is stored in this map for
the duration of import. If meanwhile other documents with the same MD5 are to be inserted, their
parent IDs are mapped to the MD5. After the first document has been inserted, references are
created for the others found in the map.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
addAndCheckCreateRef
(String md5, int parentId) Add MD5 into map and memorize parentId if MD5 has already been inserted.void
removeAndCreateRefs
(IXConnection conn, String md5, int excludeParentId, int objId) Remove MD5 hash from map and create references.void
removePreparedRef
(String md5, int parentId) Remove entry added byaddAndCheckCreateRef(String, int)
from map.
-
Constructor Details
-
MapHashToCreateRef
public MapHashToCreateRef()
-
-
Method Details
-
addAndCheckCreateRef
Add MD5 into map and memorize parentId if MD5 has already been inserted.- Parameters:
md5
- MD5parentId
- Parent ID- Returns:
- true, if MD5 has already been inserted before. This means that another thread is currently inserting a document with the same MD5.
-
removeAndCreateRefs
public void removeAndCreateRefs(IXConnection conn, String md5, int excludeParentId, int objId) throws Exception Remove MD5 hash from map and create references.- Parameters:
conn
- IXConnection objectmd5
- MD5excludeParentId
- Create references except for this parent ID.objId
- Create references to this object.- Throws:
Exception
-
removePreparedRef
Remove entry added byaddAndCheckCreateRef(String, int)
from map.- Parameters:
md5
- HashparentId
- Parent ID
-