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.
  • 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

      void updateSlot(tigase.xmpp.jid.BareJID sender, 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, 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

      long getUsedSpaceForDomain(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

      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

      void removeSlot(tigase.xmpp.jid.BareJID user, String slotId) throws tigase.db.TigaseDBException
      Removes slot with id
      Parameters:
      slotId -
      Throws:
      tigase.db.TigaseDBException