Interface Storage

  • All Superinterfaces:
    ContentProducer, Disposable

    public interface Storage
    extends ContentProducer, Disposable
    A storage provides a temporary area for data exchange between a client and the server. A client may upload data into a storage on the server. This data can then for example be retrieved to execute a ruleset.

    This interface is not intended to be implemented by clients.

    See Also:
    StorageManager.getStorage(String)
    • Method Detail

      • getProperties

        PropertySet getProperties()
        Returns the properties associated with the storage. Those properties are the ones set when calling the setContents() method.
        Returns:
        the properties associated with the storage.
        See Also:
        setContents(InputStream, Map)
      • setContents

        void setContents​(InputStream input,
                         Map<?,​?> options)
                  throws IOException,
                         UnsupportedOperationException
        Updates the underlying content of the storage.

        Properties are associated to the uploaded content. This can be header names as described in the HTTP protocol: "Content-Type"", "Content-Encoding"" and "Content-Disposition"".

        The options might also contain a "Content-Expiration"" property, which describes the number of seconds after which the storage is considered expired If this property is set, it applies to this storage only and overrides the general storage expiration options.

        This is an optional operation. The underlying storage content might not be modifiable, in which case an UnsupportedOperationException is thrown.

        Parameters:
        input - the input where to read bytes to transfer to the underlying storage.
        options - properties describing the uploaded content.
        Throws:
        IOException - if the content cannot be retrieved.
        UnsupportedOperationException - if the underlying content is not modifiable.
        See Also:
        Options.OPTION_STORAGE_EXPIRATION
      • setContents

        void setContents​(javax.mail.Part part)
                  throws IOException,
                         javax.mail.MessagingException,
                         UnsupportedOperationException
        Updates the underlying content of the storage.

        This is an optional operation. The underlying storage content might not be modifiable, in which case an UnsupportedOperationException is thrown.

        Parameters:
        part - the new content to upload in this storage.
        Throws:
        IOException - if the content cannot be retrieved.
        javax.mail.MessagingException - if the content cannot be retrieved.
        UnsupportedOperationException - if the underlying content is not modifiable.