Class HibernateBaseFileTransferDaoImpl
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- org.springframework.orm.hibernate5.support.HibernateDaoSupport
-
- org.ikasan.connector.basefiletransfer.outbound.persistence.HibernateBaseFileTransferDaoImpl
-
- All Implemented Interfaces:
BaseFileTransferDao,org.springframework.beans.factory.InitializingBean
public class HibernateBaseFileTransferDaoImpl extends org.springframework.orm.hibernate5.support.HibernateDaoSupport implements BaseFileTransferDao
Implementation for Hibernate interactions involving File Transfer connectors- Author:
- Ikasan Development Team
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCOUNT_FILE_FILTER_FROMstatic java.lang.StringFILE_FILTER_CLIENT_EQUALS_PREDICATEstatic java.lang.StringFILE_FILTER_CLIENT_LIKE_PREDICATEstatic java.lang.StringFILE_FILTER_CRITERIA_EQUALS_PREDICATEstatic java.lang.StringFILE_FILTER_CRITERIA_LIKE_PREDICATEstatic java.lang.StringFILE_FILTER_FROMstatic java.lang.StringFILE_FILTER_LAST_MODIFIED_EQUALS_PREDICATEstatic java.lang.StringFILE_FILTER_SIZE_EQUALS_PREDICATEstatic java.lang.StringFILE_FILTER_TO_SELECT_ONE_QUERYstatic java.lang.StringHOUSEKEEP_FILE_FILTER_FROM
-
Constructor Summary
Constructors Constructor Description HibernateBaseFileTransferDaoImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(FileFilter fileFilter)Deletes givenFileFilter.org.ikasan.spec.search.PagedSearchResult<FileFilter>find(int pageNo, int pageSize, java.lang.String criteria, java.lang.String clientId)Find a Paged List ofFileFilterby its id: clientId or and clientIdFileFilterfindById(int id)FindsFileFilterby given id.voidhousekeep(java.lang.String clientId, int ageOfFiles, int maxRows)Delete entries from the FileFilter table based on their age of creation and their clientIdbooleanisDuplicate(ClientListEntry entry, boolean filterOnFilename, boolean filterOnLastModifiedDate)Method that checks if anClientListEntryis already included in the filter table.voidpersistClientListEntry(ClientListEntry entry)Derives anFileFilterfrom the providedClientListEntryand persists it to the filtering table.FileFiltersave(FileFilter fileFilter)Saves givenFileFilter.
-
-
-
Field Detail
-
FILE_FILTER_TO_SELECT_ONE_QUERY
public static final java.lang.String FILE_FILTER_TO_SELECT_ONE_QUERY
- See Also:
- Constant Field Values
-
HOUSEKEEP_FILE_FILTER_FROM
public static final java.lang.String HOUSEKEEP_FILE_FILTER_FROM
- See Also:
- Constant Field Values
-
COUNT_FILE_FILTER_FROM
public static final java.lang.String COUNT_FILE_FILTER_FROM
- See Also:
- Constant Field Values
-
FILE_FILTER_FROM
public static final java.lang.String FILE_FILTER_FROM
- See Also:
- Constant Field Values
-
FILE_FILTER_CLIENT_EQUALS_PREDICATE
public static final java.lang.String FILE_FILTER_CLIENT_EQUALS_PREDICATE
- See Also:
- Constant Field Values
-
FILE_FILTER_CRITERIA_EQUALS_PREDICATE
public static final java.lang.String FILE_FILTER_CRITERIA_EQUALS_PREDICATE
- See Also:
- Constant Field Values
-
FILE_FILTER_SIZE_EQUALS_PREDICATE
public static final java.lang.String FILE_FILTER_SIZE_EQUALS_PREDICATE
- See Also:
- Constant Field Values
-
FILE_FILTER_LAST_MODIFIED_EQUALS_PREDICATE
public static final java.lang.String FILE_FILTER_LAST_MODIFIED_EQUALS_PREDICATE
- See Also:
- Constant Field Values
-
FILE_FILTER_CLIENT_LIKE_PREDICATE
public static final java.lang.String FILE_FILTER_CLIENT_LIKE_PREDICATE
- See Also:
- Constant Field Values
-
FILE_FILTER_CRITERIA_LIKE_PREDICATE
public static final java.lang.String FILE_FILTER_CRITERIA_LIKE_PREDICATE
- See Also:
- Constant Field Values
-
-
Method Detail
-
isDuplicate
public boolean isDuplicate(ClientListEntry entry, boolean filterOnFilename, boolean filterOnLastModifiedDate) throws org.hibernate.HibernateException
Description copied from interface:BaseFileTransferDaoMethod that checks if anClientListEntryis already included in the filter table.- Specified by:
isDuplicatein interfaceBaseFileTransferDao- Parameters:
entry- TheClientListEntryto filter- Returns:
trueif the entry is a duplicate,falseotherwise.- Throws:
org.hibernate.HibernateException- See Also:
BaseFileTransferDao.isDuplicate(ClientListEntry, boolean, boolean)
-
persistClientListEntry
public void persistClientListEntry(ClientListEntry entry) throws org.hibernate.HibernateException
Description copied from interface:BaseFileTransferDaoDerives anFileFilterfrom the providedClientListEntryand persists it to the filtering table.- Specified by:
persistClientListEntryin interfaceBaseFileTransferDao- Parameters:
entry- theClientListEntryto save.- Throws:
org.hibernate.HibernateException- See Also:
BaseFileTransferDao.persistClientListEntry(org.ikasan.connector.basefiletransfer.net.ClientListEntry)
-
housekeep
public void housekeep(java.lang.String clientId, int ageOfFiles, int maxRows) throws org.hibernate.HibernateExceptionDelete entries from the FileFilter table based on their age of creation and their clientIdTODO This is _not_ a platform independent solution as we are using a Sybase specific functions (dateadd() & getdate())
- Specified by:
housekeepin interfaceBaseFileTransferDao- Parameters:
clientId-ageOfFiles-maxRows-- Throws:
org.hibernate.HibernateException
-
findById
public FileFilter findById(int id)
Description copied from interface:BaseFileTransferDaoFindsFileFilterby given id.- Specified by:
findByIdin interfaceBaseFileTransferDao- Parameters:
id- of a FileFilter entry- Returns:
- FileFilter entry for given id
-
delete
public void delete(FileFilter fileFilter)
Description copied from interface:BaseFileTransferDaoDeletes givenFileFilter.- Specified by:
deletein interfaceBaseFileTransferDao- Parameters:
fileFilter- to be deleted
-
save
public FileFilter save(FileFilter fileFilter)
Description copied from interface:BaseFileTransferDaoSaves givenFileFilter.- Specified by:
savein interfaceBaseFileTransferDao- Parameters:
fileFilter- to be deleted
-
find
public org.ikasan.spec.search.PagedSearchResult<FileFilter> find(int pageNo, int pageSize, java.lang.String criteria, java.lang.String clientId)
Description copied from interface:BaseFileTransferDaoFind a Paged List ofFileFilterby its id: clientId or and clientId- Specified by:
findin interfaceBaseFileTransferDao- Parameters:
pageNo- page numberpageSize- page Size to be returnedcriteria- ofFileFilters to be foundclientId- ofFileFilters to be found- Returns:
- The found Paged Search result of
FileFilteror empty if nothing found in persistence.
-
-