Class LoadComponent

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    
    public final class LoadComponent
     implements AutoCloseable
                        

    Created by vincent on 17-7-15. Copyright @ 2013-2023 Platon AI. All rights reserved

    The load component is the core component of the Pulsar framework, it is responsible for loading pages from the local storage or fetching them from the Internet.

    • Method Detail

      • fetchState

         final CheckState fetchState(WebPage page, LoadOptions options)

        Retrieve the fetch state of a page, which determines whether the page should be fetched from the Internet.

        Parameters:
        page - The page to be fetched
        options - The load options
        Returns:

        The fetch state

      • load

         final WebPage load(URL url, LoadOptions options)

        Load a page specified by url with the given arguments.

        This method initially verifies the presence of the page in the local store. If the page exists and meets the specified requirements, it returns the local version. Otherwise, it fetches the page from the Internet.

        Other fetch conditions can be specified by load arguments:

        • expiration

        • page size requirement

        • fields requirement

        • other

        Parameters:
        url - The url of the page
        options - The load options
        Returns:

        The page

      • load

         final WebPage load(NormURL normURL)

        Load a page specified by normURL.

        This method initially verifies the presence of the page in the local store. If the page exists and meets the specified requirements, it returns the local version. Otherwise, it fetches the page from the Internet.

        Other fetch conditions can be specified by load arguments:

        • expiration

        • page size requirement

        • fields requirement

        • other

        Parameters:
        normURL - The normalized url of the page
        Returns:

        The page

      • loadDeferred

         final WebPage loadDeferred(NormURL normURL)

        Load a page specified by normURL.

        This method initially verifies the presence of the page in the local store. If the page exists and meets the specified requirements, it returns the local version. Otherwise, it fetches the page from the Internet.

        This method is a coroutine version of load.

        Other fetch conditions can be specified by load arguments:

        • expiration

        • page size requirement

        • fields requirement

        • other

        Parameters:
        normURL - The normalized url of the page
        Returns:

        The page