Package tigase.http.upload.db
Class DummyFileUploadRepository
java.lang.Object
tigase.http.upload.db.DummyFileUploadRepository
- All Implemented Interfaces:
tigase.db.DataSourceAware,FileUploadRepository
@Bean(name="repo",
exportable=true,
active=true)
public class DummyFileUploadRepository
extends Object
implements FileUploadRepository
Created by andrzej on 08.08.2016.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
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.Retrieves information from database about slotlonggetUsedSpaceForDomain(String domain) Calculates space used by files upload by all users from domainlonggetUsedSpaceForUser(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.voidremoveExpiredSlots(tigase.xmpp.jid.BareJID domain, LocalDateTime before, int limit) Removes metadata of expired slotsvoidremoveSlot(tigase.xmpp.jid.BareJID user, String slotId) Removes slot with idvoidsetDataSource(tigase.db.DataSource dataSource) voidupdateSlot(tigase.xmpp.jid.BareJID sender, String slotId) Looks for slot for particular sender with exact slot id, file name and file sizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface tigase.http.upload.db.FileUploadRepository
allocateSlot
-
Constructor Details
-
DummyFileUploadRepository
public DummyFileUploadRepository()
-
-
Method Details
-
allocateSlot
public FileUploadRepository.Slot allocateSlot(tigase.xmpp.jid.BareJID 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- Throws:
tigase.db.TigaseDBException
-
updateSlot
public void updateSlot(tigase.xmpp.jid.BareJID sender, String slotId) throws tigase.db.TigaseDBException Description copied from interface:FileUploadRepositoryLooks for slot for particular sender with exact slot id, file name and file size- Specified by:
updateSlotin interfaceFileUploadRepository- Throws:
tigase.db.TigaseDBException
-
getSlot
public DummyFileUploadRepository.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- 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- Throws:
tigase.db.TigaseDBException
-
removeExpiredSlots
public void removeExpiredSlots(tigase.xmpp.jid.BareJID domain, LocalDateTime before, int limit) throws tigase.db.TigaseDBException Description copied from interface:FileUploadRepositoryRemoves metadata of expired slots- Specified by:
removeExpiredSlotsin interfaceFileUploadRepository- Throws:
tigase.db.TigaseDBException
-
getUsedSpaceForDomain
Description copied from interface:FileUploadRepositoryCalculates space used by files upload by all users from domain- Specified by:
getUsedSpaceForDomainin interfaceFileUploadRepository- Returns:
- Throws:
tigase.db.TigaseDBException
-
getUsedSpaceForUser
public long getUsedSpaceForUser(tigase.xmpp.jid.BareJID user) throws tigase.db.TigaseDBException Description copied from interface:FileUploadRepositoryCalculates space used by files upload by the user- Specified by:
getUsedSpaceForUserin interfaceFileUploadRepository- Returns:
- Throws:
tigase.db.TigaseDBException
-
querySlots
public List<FileUploadRepository.Slot> querySlots(tigase.xmpp.jid.BareJID user, String afterId, int limit) throws tigase.db.TigaseDBException Description copied from interface:FileUploadRepositoryRetrieves list of slots after slot with provided id. If id is null, first slots will be returned.- Specified by:
querySlotsin interfaceFileUploadRepository- Returns:
- Throws:
tigase.db.TigaseDBException
-
querySlots
public List<FileUploadRepository.Slot> querySlots(String domain, String afterId, int limit) throws tigase.db.TigaseDBException Description copied from interface:FileUploadRepositoryRetrieves list of slots after slot with provided id. If id is null, first slots will be returned.- Specified by:
querySlotsin interfaceFileUploadRepository- Returns:
- Throws:
tigase.db.TigaseDBException
-
removeSlot
public void removeSlot(tigase.xmpp.jid.BareJID user, String slotId) throws tigase.db.TigaseDBException Description copied from interface:FileUploadRepositoryRemoves slot with id- Specified by:
removeSlotin interfaceFileUploadRepository- Throws:
tigase.db.TigaseDBException
-
setDataSource
public void setDataSource(tigase.db.DataSource dataSource) - Specified by:
setDataSourcein interfacetigase.db.DataSourceAware
-