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
Nested Classes Modifier and Type Interface Description static class
FileUploadRepository.Slot
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description FileUploadRepository.Slot
allocateSlot(tigase.xmpp.jid.BareJID sender, java.lang.String slotId, java.lang.String filename, long filesize, java.lang.String contentType)
Create slot in database for file upload.default FileUploadRepository.Slot
allocateSlot(tigase.xmpp.jid.JID sender, java.lang.String slotId, java.lang.String filename, long filesize, java.lang.String contentType)
Deprecated.FileUploadRepository.Slot
getSlot(tigase.xmpp.jid.BareJID sender, java.lang.String slotId)
Retrieves information from database about slotlong
getUsedSpaceForDomain(java.lang.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 userjava.util.List<FileUploadRepository.Slot>
listExpiredSlots(tigase.xmpp.jid.BareJID domain, java.time.LocalDateTime before, int limit)
Retrieves list of ids of expired slotsjava.util.List<FileUploadRepository.Slot>
querySlots(java.lang.String domain, java.lang.String afterId, int limit)
Retrieves list of slots after slot with provided id.java.util.List<FileUploadRepository.Slot>
querySlots(tigase.xmpp.jid.BareJID user, java.lang.String afterId, int limit)
Retrieves list of slots after slot with provided id.void
removeExpiredSlots(tigase.xmpp.jid.BareJID domain, java.time.LocalDateTime before, int limit)
Removes metadata of expired slotsvoid
removeSlot(tigase.xmpp.jid.BareJID user, java.lang.String slotId)
Removes slot with idvoid
updateSlot(tigase.xmpp.jid.BareJID sender, java.lang.String slotId)
Looks for slot for particular sender with exact slot id, file name and file size
-
-
-
Method Detail
-
allocateSlot
FileUploadRepository.Slot allocateSlot(tigase.xmpp.jid.BareJID sender, java.lang.String slotId, java.lang.String filename, long filesize, java.lang.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, java.lang.String slotId, java.lang.String filename, long filesize, java.lang.String contentType) throws tigase.db.TigaseDBException
Deprecated.Create slot in database for file upload.- Throws:
tigase.db.TigaseDBException
-
updateSlot
void updateSlot(tigase.xmpp.jid.BareJID sender, java.lang.String slotId) throws tigase.db.TigaseDBException
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, java.lang.String slotId) throws tigase.db.TigaseDBException
Retrieves information from database about slot- Throws:
tigase.db.TigaseDBException
-
listExpiredSlots
java.util.List<FileUploadRepository.Slot> listExpiredSlots(tigase.xmpp.jid.BareJID domain, java.time.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, java.time.LocalDateTime before, int limit) throws tigase.db.TigaseDBException
Removes metadata of expired slots- Throws:
tigase.db.TigaseDBException
-
getUsedSpaceForDomain
long getUsedSpaceForDomain(java.lang.String domain) throws tigase.db.TigaseDBException
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
java.util.List<FileUploadRepository.Slot> querySlots(tigase.xmpp.jid.BareJID user, java.lang.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
java.util.List<FileUploadRepository.Slot> querySlots(java.lang.String domain, java.lang.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
void removeSlot(tigase.xmpp.jid.BareJID user, java.lang.String slotId) throws tigase.db.TigaseDBException
Removes slot with id- Parameters:
slotId
-- Throws:
tigase.db.TigaseDBException
-
-