Class IpfFhirConfigurationProperties.StreamingUpload

java.lang.Object
org.openehealth.ipf.boot.fhir.IpfFhirConfigurationProperties.StreamingUpload
Enclosing class:
IpfFhirConfigurationProperties

public static class IpfFhirConfigurationProperties.StreamingUpload extends Object
Configuration of the streaming upload split, i.e. this starter's half of the bridge to Base64SplittingFilter. The split itself knows nothing about Spring or about this starter; everything it needs is handed to it as StreamingUploadOptions.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Spring Security's default filter order plus a little, see filterOrder.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Only request bodies larger than this are split; smaller ones are passed through byte for byte, so that ordinary requests behave exactly as they do without this filter.
    int
    Order of the filter in the servlet filter chain.
    Types of the resources whose create interaction carries a document inline.
    long
    Maximum size of a single extracted document.
    int
    Extracted document content up to this size is kept in memory instead of being written to a temporary file.
    Directory for temporary document files.
    boolean
    Whether large document uploads shall be split before they reach the FHIR parser.
    void
    setEnabled(boolean enabled)
    Whether large document uploads shall be split before they reach the FHIR parser.
    void
    setEngageAboveBytes(int engageAboveBytes)
    Only request bodies larger than this are split; smaller ones are passed through byte for byte, so that ordinary requests behave exactly as they do without this filter.
    void
    setFilterOrder(int filterOrder)
    Order of the filter in the servlet filter chain.
    void
    setInlineDocumentResources(Set<String> inlineDocumentResources)
    Types of the resources whose create interaction carries a document inline.
    void
    setMaxDocumentSizeBytes(long maxDocumentSizeBytes)
    Maximum size of a single extracted document.
    void
    setMemoryThresholdBytes(int memoryThresholdBytes)
    Extracted document content up to this size is kept in memory instead of being written to a temporary file.
    void
    setTempDirectory(Path tempDirectory)
    Directory for temporary document files.
     

    Methods inherited from class Object

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

    • DEFAULT_FILTER_ORDER

      public static final int DEFAULT_FILTER_ORDER
      Spring Security's default filter order plus a little, see filterOrder.
      See Also:
  • Constructor Details

    • StreamingUpload

      public StreamingUpload()
  • Method Details

    • toOptions

      public StreamingUploadOptions toOptions()
      Returns:
      these settings as the split's own, framework-independent options
    • isEnabled

      public boolean isEnabled()
      Whether large document uploads shall be split before they reach the FHIR parser.
    • setEnabled

      public void setEnabled(boolean enabled)
      Whether large document uploads shall be split before they reach the FHIR parser.
    • getEngageAboveBytes

      public int getEngageAboveBytes()
      Only request bodies larger than this are split; smaller ones are passed through byte for byte, so that ordinary requests behave exactly as they do without this filter.

      This is measured on the whole request body, i.e. metadata plus the base64 of all documents in it.

    • setEngageAboveBytes

      public void setEngageAboveBytes(int engageAboveBytes)
      Only request bodies larger than this are split; smaller ones are passed through byte for byte, so that ordinary requests behave exactly as they do without this filter.

      This is measured on the whole request body, i.e. metadata plus the base64 of all documents in it.

    • getMemoryThresholdBytes

      public int getMemoryThresholdBytes()
      Extracted document content up to this size is kept in memory instead of being written to a temporary file.

      This is measured on a single decoded document and is therefore deliberately independent of engageAboveBytes; it is quite normal for it to be the larger of the two. Splitting the body is what avoids the expensive part - the base64 text and the decoded array that the FHIR parser would otherwise materialize - whereas a temporary file is only needed to also avoid a large contiguous heap allocation. Small documents therefore stay in memory and cause no disk I/O at all.

    • setMemoryThresholdBytes

      public void setMemoryThresholdBytes(int memoryThresholdBytes)
      Extracted document content up to this size is kept in memory instead of being written to a temporary file.

      This is measured on a single decoded document and is therefore deliberately independent of engageAboveBytes; it is quite normal for it to be the larger of the two. Splitting the body is what avoids the expensive part - the base64 text and the decoded array that the FHIR parser would otherwise materialize - whereas a temporary file is only needed to also avoid a large contiguous heap allocation. Small documents therefore stay in memory and cause no disk I/O at all.

    • getMaxDocumentSizeBytes

      public long getMaxDocumentSizeBytes()
      Maximum size of a single extracted document. Bounds how much temporary disk space one request can use.
    • setMaxDocumentSizeBytes

      public void setMaxDocumentSizeBytes(long maxDocumentSizeBytes)
      Maximum size of a single extracted document. Bounds how much temporary disk space one request can use.
    • getTempDirectory

      public Path getTempDirectory()
      Directory for temporary document files. Defaults to the JVM temporary directory.
    • setTempDirectory

      public void setTempDirectory(Path tempDirectory)
      Directory for temporary document files. Defaults to the JVM temporary directory.
    • getInlineDocumentResources

      public Set<String> getInlineDocumentResources()
      Types of the resources whose create interaction carries a document inline. Defaults to what MHD needs, i.e. the ITI-105 create of a DocumentReference; a POST to the FHIR base itself, such as the ITI-65 transaction bundle, is always considered regardless of this setting.
    • setInlineDocumentResources

      public void setInlineDocumentResources(Set<String> inlineDocumentResources)
      Types of the resources whose create interaction carries a document inline. Defaults to what MHD needs, i.e. the ITI-105 create of a DocumentReference; a POST to the FHIR base itself, such as the ITI-65 transaction bundle, is always considered regardless of this setting.
    • getFilterOrder

      public int getFilterOrder()
      Order of the filter in the servlet filter chain. The default places it directly after the Spring Security filter chain, whose own default order is -100: unauthenticated requests must never be spooled to disk, and any request logging registered further down then sees the slimmed-down body rather than buffering the full upload a second time. The value is spelled out rather than derived from Spring Boot's SecurityProperties.DEFAULT_FILTER_ORDER, which this starter does not depend on.
    • setFilterOrder

      public void setFilterOrder(int filterOrder)
      Order of the filter in the servlet filter chain. The default places it directly after the Spring Security filter chain, whose own default order is -100: unauthenticated requests must never be spooled to disk, and any request logging registered further down then sees the slimmed-down body rather than buffering the full upload a second time. The value is spelled out rather than derived from Spring Boot's SecurityProperties.DEFAULT_FILTER_ORDER, which this starter does not depend on.