Package tigase.http.upload.db
Class FileUploadRepositoryPool<R extends FileUploadRepository<tigase.db.DataSource>>
- java.lang.Object
-
- tigase.db.beans.MDRepositoryBean<R>
-
- tigase.http.upload.db.FileUploadRepositoryPool<R>
-
- All Implemented Interfaces:
tigase.db.DataSourceAware,FileUploadRepository,tigase.kernel.beans.Initializable,tigase.kernel.beans.RegistrarBean,tigase.kernel.beans.RegistrarBeanWithDefaultBeanClass,tigase.kernel.beans.UnregisterAware
@Bean(name="repositoryPool", parent=FileUploadComponent.class, active=true, exportable=true) public class FileUploadRepositoryPool<R extends FileUploadRepository<tigase.db.DataSource>> extends tigase.db.beans.MDRepositoryBean<R> implements FileUploadRepositoryCreated by andrzej on 10.08.2016.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileUploadRepositoryPool.FileUploadRepositoryConfigBean-
Nested classes/interfaces inherited from class tigase.db.beans.MDRepositoryBean
tigase.db.beans.MDRepositoryBean.MDRepositoryConfigBean<A extends tigase.db.DataSourceAware>, tigase.db.beans.MDRepositoryBean.SelectorType
-
Nested classes/interfaces inherited from interface tigase.http.upload.db.FileUploadRepository
FileUploadRepository.Slot
-
-
Constructor Summary
Constructors Constructor Description FileUploadRepositoryPool()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileUploadRepository.SlotallocateSlot(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.FileUploadRepository.SlotallocateSlot(tigase.xmpp.jid.JID sender, java.lang.String slotId, java.lang.String filename, long filesize, java.lang.String contentType)Create slot in database for file upload.protected java.lang.ClassfindClassForDataSource(tigase.db.DataSource dataSource)java.lang.Class<?>getDefaultBeanClass()FileUploadRepository.SlotgetSlot(tigase.xmpp.jid.BareJID sender, java.lang.String slotId)Retrieves information from database about slotlonggetUsedSpaceForDomain(java.lang.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 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.voidremoveExpiredSlots(tigase.xmpp.jid.BareJID domain, java.time.LocalDateTime before, int limit)Removes metadata of expired slotsvoidremoveSlot(tigase.xmpp.jid.BareJID user, java.lang.String slotId)Removes slot with idvoidsetDataSource(tigase.db.DataSource dataSource)voidupdateSlot(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
public 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
Description copied from interface:FileUploadRepositoryCreate slot in database for file upload.- Specified by:
allocateSlotin interfaceFileUploadRepository<R extends FileUploadRepository<tigase.db.DataSource>>- Throws:
tigase.db.TigaseDBException
-
allocateSlot
public 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
Description copied from interface:FileUploadRepositoryCreate slot in database for file upload.- Specified by:
allocateSlotin interfaceFileUploadRepository<R extends FileUploadRepository<tigase.db.DataSource>>- Throws:
tigase.db.TigaseDBException
-
updateSlot
public void updateSlot(tigase.xmpp.jid.BareJID sender, java.lang.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<R extends FileUploadRepository<tigase.db.DataSource>>- Throws:
tigase.db.TigaseDBException
-
getSlot
public FileUploadRepository.Slot getSlot(tigase.xmpp.jid.BareJID sender, java.lang.String slotId) throws tigase.db.TigaseDBException
Description copied from interface:FileUploadRepositoryRetrieves information from database about slot- Specified by:
getSlotin interfaceFileUploadRepository<R extends FileUploadRepository<tigase.db.DataSource>>- Throws:
tigase.db.TigaseDBException
-
listExpiredSlots
public java.util.List<FileUploadRepository.Slot> listExpiredSlots(tigase.xmpp.jid.BareJID domain, java.time.LocalDateTime before, int limit) throws tigase.db.TigaseDBException
Description copied from interface:FileUploadRepositoryRetrieves list of ids of expired slots- Specified by:
listExpiredSlotsin interfaceFileUploadRepository<R extends FileUploadRepository<tigase.db.DataSource>>- Throws:
tigase.db.TigaseDBException
-
removeExpiredSlots
public void removeExpiredSlots(tigase.xmpp.jid.BareJID domain, java.time.LocalDateTime before, int limit) throws tigase.db.TigaseDBExceptionDescription copied from interface:FileUploadRepositoryRemoves metadata of expired slots- Specified by:
removeExpiredSlotsin interfaceFileUploadRepository<R extends FileUploadRepository<tigase.db.DataSource>>- Throws:
tigase.db.TigaseDBException
-
getUsedSpaceForDomain
public long getUsedSpaceForDomain(java.lang.String domain) throws tigase.db.TigaseDBExceptionDescription copied from interface:FileUploadRepositoryCalculates space used by files upload by all users from domain- Specified by:
getUsedSpaceForDomainin interfaceFileUploadRepository<R extends FileUploadRepository<tigase.db.DataSource>>- Returns:
- Throws:
tigase.db.TigaseDBException
-
getUsedSpaceForUser
public long getUsedSpaceForUser(tigase.xmpp.jid.BareJID user) throws tigase.db.TigaseDBExceptionDescription copied from interface:FileUploadRepositoryCalculates space used by files upload by the user- Specified by:
getUsedSpaceForUserin interfaceFileUploadRepository<R extends FileUploadRepository<tigase.db.DataSource>>- Returns:
- Throws:
tigase.db.TigaseDBException
-
querySlots
public java.util.List<FileUploadRepository.Slot> querySlots(tigase.xmpp.jid.BareJID user, java.lang.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<R extends FileUploadRepository<tigase.db.DataSource>>- Returns:
- Throws:
tigase.db.TigaseDBException
-
querySlots
public java.util.List<FileUploadRepository.Slot> querySlots(java.lang.String domain, java.lang.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<R extends FileUploadRepository<tigase.db.DataSource>>- Returns:
- Throws:
tigase.db.TigaseDBException
-
removeSlot
public void removeSlot(tigase.xmpp.jid.BareJID user, java.lang.String slotId) throws tigase.db.TigaseDBExceptionDescription copied from interface:FileUploadRepositoryRemoves slot with id- Specified by:
removeSlotin interfaceFileUploadRepository<R extends FileUploadRepository<tigase.db.DataSource>>- Throws:
tigase.db.TigaseDBException
-
setDataSource
public void setDataSource(tigase.db.DataSource dataSource)
- Specified by:
setDataSourcein interfacetigase.db.DataSourceAware<R extends FileUploadRepository<tigase.db.DataSource>>
-
getDefaultBeanClass
public java.lang.Class<?> getDefaultBeanClass()
- Specified by:
getDefaultBeanClassin interfacetigase.kernel.beans.RegistrarBeanWithDefaultBeanClass
-
findClassForDataSource
protected java.lang.Class findClassForDataSource(tigase.db.DataSource dataSource) throws tigase.db.DBInitException- Specified by:
findClassForDataSourcein classtigase.db.beans.MDRepositoryBean<R extends FileUploadRepository<tigase.db.DataSource>>- Throws:
tigase.db.DBInitException
-
-