Class S3Store

  • All Implemented Interfaces:
    tigase.http.upload.store.Store, tigase.kernel.beans.config.ConfigurationChangedAware

    @Bean(name="store",
          active=true,
          exportable=true)
    public class S3Store
    extends java.lang.Object
    implements tigase.http.upload.store.Store, tigase.kernel.beans.config.ConfigurationChangedAware
    • Constructor Summary

      Constructors 
      Constructor Description
      S3Store()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void beanConfigurationChanged​(java.util.Collection<java.lang.String> collection)  
      long count()  
      protected java.lang.String createKey​(java.lang.String slotId, java.lang.String filename)  
      protected java.lang.String createKeyPrefix​(java.lang.String slotId)  
      java.nio.channels.ReadableByteChannel getContent​(tigase.xmpp.jid.BareJID uploader, java.lang.String slotId, java.lang.String filename)  
      java.lang.String getRegion()  
      void remove​(tigase.xmpp.jid.BareJID uploader, java.lang.String slotId)  
      void setContent​(tigase.xmpp.jid.BareJID uploader, java.lang.String slotId, java.lang.String filename, long size, java.nio.channels.ReadableByteChannel source)  
      void setRegion​(java.lang.String region)  
      long size()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • s3

        protected com.amazonaws.services.s3.AmazonS3 s3
      • bucket

        @ConfigField(desc="S3 bucket")
        protected java.lang.String bucket
      • autocreateBucket

        @ConfigField(desc="Autocreate bucket")
        protected boolean autocreateBucket
      • accessKeyId

        @ConfigField(desc="S3 access key id")
        protected java.lang.String accessKeyId
      • secretKey

        @ConfigField(desc="S3 secret key")
        protected java.lang.String secretKey
      • endpointUrl

        @ConfigField(desc="S3 endpoint url")
        protected java.lang.String endpointUrl
      • pathStyleAccess

        @ConfigField(desc="AWS path style access")
        protected java.lang.Boolean pathStyleAccess
      • signerOverride

        @ConfigField(desc="S3 signer override")
        protected java.lang.String signerOverride
    • Constructor Detail

      • S3Store

        public S3Store()
    • Method Detail

      • getRegion

        public java.lang.String getRegion()
      • setRegion

        public void setRegion​(java.lang.String region)
      • count

        public long count()
                   throws java.io.IOException
        Specified by:
        count in interface tigase.http.upload.store.Store
        Throws:
        java.io.IOException
      • size

        public long size()
                  throws java.io.IOException
        Specified by:
        size in interface tigase.http.upload.store.Store
        Throws:
        java.io.IOException
      • getContent

        public java.nio.channels.ReadableByteChannel getContent​(tigase.xmpp.jid.BareJID uploader,
                                                                java.lang.String slotId,
                                                                java.lang.String filename)
                                                         throws java.io.IOException
        Specified by:
        getContent in interface tigase.http.upload.store.Store
        Throws:
        java.io.IOException
      • setContent

        public void setContent​(tigase.xmpp.jid.BareJID uploader,
                               java.lang.String slotId,
                               java.lang.String filename,
                               long size,
                               java.nio.channels.ReadableByteChannel source)
                        throws java.io.IOException
        Specified by:
        setContent in interface tigase.http.upload.store.Store
        Throws:
        java.io.IOException
      • remove

        public void remove​(tigase.xmpp.jid.BareJID uploader,
                           java.lang.String slotId)
                    throws java.io.IOException
        Specified by:
        remove in interface tigase.http.upload.store.Store
        Throws:
        java.io.IOException
      • beanConfigurationChanged

        public void beanConfigurationChanged​(java.util.Collection<java.lang.String> collection)
        Specified by:
        beanConfigurationChanged in interface tigase.kernel.beans.config.ConfigurationChangedAware
      • createKeyPrefix

        protected java.lang.String createKeyPrefix​(java.lang.String slotId)
      • createKey

        protected java.lang.String createKey​(java.lang.String slotId,
                                             java.lang.String filename)