Interface ResourceHandler

    • Method Detail

      • setup

        Source setup​(String source,
                     Map objectModel,
                     Parameters par,
                     Map<String,​Object> additionalParameters)
              throws IOException,
                     ProcessingException
        Initialize the resource handler with a resource.
        Parameters:
        source - The source uri
        objectModel - The object model
        par - The parameters
        additionalParameters - Additional parameters that can be filled, and will be transmitted to getKey, getValidity and generateResource
        Returns:
        the resolved source
        Throws:
        IOException - If an error occurs
        ProcessingException - If an error occurs
      • isSupported

        boolean isSupported​(String src)
        Determines if the resource is supported by this handler
        Parameters:
        src - The uri of resource
        Returns:
        true if the resource is supported
      • getPriority

        int getPriority()
        Get the priority of this handler
        Returns:
        the priority. The bigger the highest priority
      • getMimeType

        String getMimeType​(Source source,
                           Parameters parameters)
        Return the mime type of the configured resource.
        Parameters:
        source - The source
        parameters - The parameters
        Returns:
        The mime type.
      • getKey

        Serializable getKey​(Source source,
                            Map objectModel,
                            Parameters parameters,
                            Map<String,​Object> additionalParameters)
        Get the unique key for this resource, for cache purpose.
        Parameters:
        source - The source
        objectModel - The object model
        parameters - The parameters
        additionalParameters - Additional parameters
        Returns:
        The cache key.
      • getValidity

        SourceValidity getValidity​(Source source,
                                   Map objectModel,
                                   Parameters parameters,
                                   Map<String,​Object> additionalParameters)
        Get the resource validity, for cache purpose.
        Parameters:
        source - The source
        objectModel - The object model
        parameters - The parameters
        additionalParameters - Additional parameters
        Returns:
        The resource validity.
      • getSize

        long getSize​(Source source,
                     Parameters parameters)
        Get the resource size, if available.
        Parameters:
        source - The source
        parameters - The parameters
        Returns:
        The resource size.
      • getLastModified

        long getLastModified​(Source source,
                             Parameters parameters)
        Get the resource last modified time
        Parameters:
        source - The source
        parameters - The parameters
        Returns:
        The last modified