Package tigase.http.upload.db
Interface FileUploadRepository<DS extends tigase.db.DataSource>
- All Superinterfaces:
tigase.db.DataSourceAware<DS>
- All Known Implementing Classes:
DummyFileUploadRepository
,FileUploadRepositoryPool
,JDBCFileUploadRepository
public interface FileUploadRepository<DS extends tigase.db.DataSource>
extends tigase.db.DataSourceAware<DS>
Created by andrzej on 07.08.2016.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionallocateSlot
(tigase.xmpp.jid.BareJID sender, String slotId, String filename, long filesize, String contentType) Create slot in database for file upload.default FileUploadRepository.Slot
allocateSlot
(tigase.xmpp.jid.JID sender, String slotId, String filename, long filesize, String contentType) Deprecated.Retrieves information from database about slotlong
getUsedSpaceForDomain
(String domain) Calculates space used by files upload by all users from domainlong
getUsedSpaceForUser
(tigase.xmpp.jid.BareJID user) Calculates space used by files upload by the userlistExpiredSlots
(tigase.xmpp.jid.BareJID domain, LocalDateTime before, int limit) Retrieves list of ids of expired slotsquerySlots
(String domain, String afterId, int limit) Retrieves list of slots after slot with provided id.querySlots
(tigase.xmpp.jid.BareJID user, String afterId, int limit) Retrieves list of slots after slot with provided id.void
removeExpiredSlots
(tigase.xmpp.jid.BareJID domain, LocalDateTime before, int limit) Removes metadata of expired slotsvoid
removeSlot
(tigase.xmpp.jid.BareJID user, String slotId) Removes slot with idvoid
updateSlot
(tigase.xmpp.jid.BareJID sender, String slotId) Looks for slot for particular sender with exact slot id, file name and file sizeMethods inherited from interface tigase.db.DataSourceAware
setDataSource
-
Method Details
-
allocateSlot
FileUploadRepository.Slot allocateSlot(tigase.xmpp.jid.BareJID sender, String slotId, String filename, long filesize, String contentType) throws tigase.db.TigaseDBException Create slot in database for file upload.- Throws:
tigase.db.TigaseDBException
-
allocateSlot
@Deprecated default FileUploadRepository.Slot allocateSlot(tigase.xmpp.jid.JID sender, String slotId, String filename, long filesize, String contentType) throws tigase.db.TigaseDBException Deprecated.Create slot in database for file upload.- Throws:
tigase.db.TigaseDBException
-
updateSlot
Looks for slot for particular sender with exact slot id, file name and file size- Throws:
tigase.db.TigaseDBException
-
getSlot
FileUploadRepository.Slot getSlot(tigase.xmpp.jid.BareJID sender, String slotId) throws tigase.db.TigaseDBException Retrieves information from database about slot- Throws:
tigase.db.TigaseDBException
-
listExpiredSlots
List<FileUploadRepository.Slot> listExpiredSlots(tigase.xmpp.jid.BareJID domain, LocalDateTime before, int limit) throws tigase.db.TigaseDBException Retrieves list of ids of expired slots- Throws:
tigase.db.TigaseDBException
-
removeExpiredSlots
void removeExpiredSlots(tigase.xmpp.jid.BareJID domain, LocalDateTime before, int limit) throws tigase.db.TigaseDBException Removes metadata of expired slots- Throws:
tigase.db.TigaseDBException
-
getUsedSpaceForDomain
Calculates space used by files upload by all users from domain- Parameters:
domain
-- Returns:
- Throws:
tigase.db.TigaseDBException
-
getUsedSpaceForUser
long getUsedSpaceForUser(tigase.xmpp.jid.BareJID user) throws tigase.db.TigaseDBException Calculates space used by files upload by the user- Parameters:
jid
-- Returns:
- Throws:
tigase.db.TigaseDBException
-
querySlots
List<FileUploadRepository.Slot> querySlots(tigase.xmpp.jid.BareJID user, String afterId, int limit) throws tigase.db.TigaseDBException Retrieves list of slots after slot with provided id. If id is null, first slots will be returned.- Parameters:
user
-afterId
-- Returns:
- Throws:
tigase.db.TigaseDBException
-
querySlots
List<FileUploadRepository.Slot> querySlots(String domain, String afterId, int limit) throws tigase.db.TigaseDBException Retrieves list of slots after slot with provided id. If id is null, first slots will be returned.- Parameters:
user
-afterId
-- Returns:
- Throws:
tigase.db.TigaseDBException
-
removeSlot
Removes slot with id- Parameters:
slotId
-- Throws:
tigase.db.TigaseDBException
-