Package tigase.http.upload.db
Class JDBCFileUploadRepository
- java.lang.Object
-
- tigase.http.upload.db.JDBCFileUploadRepository
-
- All Implemented Interfaces:
tigase.db.DataSourceAware<tigase.db.DataRepository>,tigase.db.util.RepositoryVersionAware,FileUploadRepository<tigase.db.DataRepository>
public class JDBCFileUploadRepository extends Object implements FileUploadRepository<tigase.db.DataRepository>, tigase.db.util.RepositoryVersionAware
Created by andrzej on 07.08.2016.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface tigase.http.upload.db.FileUploadRepository
FileUploadRepository.Slot
-
-
Constructor Summary
Constructors Constructor Description JDBCFileUploadRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileUploadRepository.SlotallocateSlot(tigase.xmpp.jid.JID sender, String slotId, String filename, long filesize, String contentType)Create slot in database for file upload.FileUploadRepository.SlotgetSlot(tigase.xmpp.jid.BareJID sender, String slotId)Retrieves information from database about slotList<FileUploadRepository.Slot>listExpiredSlots(tigase.xmpp.jid.BareJID domain, LocalDateTime before, int limit)Retrieves list of ids of expired slotsvoidremoveExpiredSlots(tigase.xmpp.jid.BareJID domain, LocalDateTime before, int limit)Removes metadata of expired slotsvoidsetDataSource(tigase.db.DataRepository dataSource)voidupdateSlot(tigase.xmpp.jid.BareJID userJid, String slotId)Looks for slot for particular sender with exact slot id, file name and file size
-
-
-
Method Detail
-
allocateSlot
public FileUploadRepository.Slot allocateSlot(tigase.xmpp.jid.JID sender, String slotId, String filename, long filesize, String contentType) throws tigase.db.TigaseDBException
Description copied from interface:FileUploadRepositoryCreate slot in database for file upload.- Specified by:
allocateSlotin interfaceFileUploadRepository<tigase.db.DataRepository>- Returns:
- slotId - may be changed by repository implementation
- Throws:
tigase.db.TigaseDBException
-
updateSlot
public void updateSlot(tigase.xmpp.jid.BareJID userJid, String slotId) throws tigase.db.TigaseDBExceptionDescription copied from interface:FileUploadRepositoryLooks for slot for particular sender with exact slot id, file name and file size- Specified by:
updateSlotin interfaceFileUploadRepository<tigase.db.DataRepository>- Throws:
tigase.db.TigaseDBException
-
getSlot
public FileUploadRepository.Slot getSlot(tigase.xmpp.jid.BareJID sender, String slotId) throws tigase.db.TigaseDBException
Description copied from interface:FileUploadRepositoryRetrieves information from database about slot- Specified by:
getSlotin interfaceFileUploadRepository<tigase.db.DataRepository>- Throws:
tigase.db.TigaseDBException
-
listExpiredSlots
public List<FileUploadRepository.Slot> listExpiredSlots(tigase.xmpp.jid.BareJID domain, LocalDateTime before, int limit) throws tigase.db.TigaseDBException
Description copied from interface:FileUploadRepositoryRetrieves list of ids of expired slots- Specified by:
listExpiredSlotsin interfaceFileUploadRepository<tigase.db.DataRepository>- Throws:
tigase.db.TigaseDBException
-
removeExpiredSlots
public void removeExpiredSlots(tigase.xmpp.jid.BareJID domain, LocalDateTime before, int limit) throws tigase.db.TigaseDBExceptionDescription copied from interface:FileUploadRepositoryRemoves metadata of expired slots- Specified by:
removeExpiredSlotsin interfaceFileUploadRepository<tigase.db.DataRepository>- Throws:
tigase.db.TigaseDBException
-
setDataSource
public void setDataSource(tigase.db.DataRepository dataSource)
- Specified by:
setDataSourcein interfacetigase.db.DataSourceAware<tigase.db.DataRepository>
-
-