Class DefaultSourceFactory.Builder

java.lang.Object
ch.grengine.source.DefaultSourceFactory.Builder
Enclosing class:
DefaultSourceFactory

public static class DefaultSourceFactory.Builder extends Object
Builder for SourceFactory instances.
Since:
1.0
Author:
Alain Stalder, Made in Switzerland.
  • Field Details

    • DEFAULT_URL_TRACKING_LATENCY_MS

      public static final long DEFAULT_URL_TRACKING_LATENCY_MS
      default latency for tracking URL content (60000ms = one minute).
      Since:
      1.0
      See Also:
    • DEFAULT_FILE_LAST_MODIFIED_TRACKING_LATENCY_MS

      public static final long DEFAULT_FILE_LAST_MODIFIED_TRACKING_LATENCY_MS
      default latency for tracking file last modified (1000ms = 1 second).
      Since:
      1.0.1
      See Also:
  • Constructor Details

    • Builder

      public Builder()
      constructor.
      Since:
      1.0
  • Method Details

    • setTrackTextSourceIds

      public DefaultSourceFactory.Builder setTrackTextSourceIds(boolean trackTextSourceIds)
      sets whether to track (cache) text source IDs, default is not to track.
      Parameters:
      trackTextSourceIds - whether to track (cache) text source IDs
      Returns:
      this, for chaining calls
      Throws:
      IllegalStateException - if the builder had already been used to create an instance
      Since:
      1.0.1
    • setTrackFileSourceLastModified

      public DefaultSourceFactory.Builder setTrackFileSourceLastModified(boolean trackFileSourceLastModified)
      sets whether to track (cache) file source last modified, default is not to track.
      Parameters:
      trackFileSourceLastModified - whether to track (cache) file source last modified
      Returns:
      this, for chaining calls
      Throws:
      IllegalStateException - if the builder had already been used to create an instance
      Since:
      1.0.1
    • setFileLastModifiedTrackingLatencyMs

      public DefaultSourceFactory.Builder setFileLastModifiedTrackingLatencyMs(long fileLastModifiedTrackingLatencyMs)
      sets latency for tracking file last modified of file sources, defaults is DEFAULT_FILE_LAST_MODIFIED_TRACKING_LATENCY_MS.

      Only has an effect if also set to track file source last modified.

      Parameters:
      fileLastModifiedTrackingLatencyMs - latency for tracking file last modified of file sources
      Returns:
      this, for chaining calls
      Throws:
      IllegalStateException - if the builder had already been used to create an instance
      Since:
      1.0.1
    • setTrackUrlContent

      public DefaultSourceFactory.Builder setTrackUrlContent(boolean trackUrlContent)
      sets whether to track URL content, default is not to track, i.e. to consider URL content static.
      Parameters:
      trackUrlContent - whether to track URL content
      Returns:
      this, for chaining calls
      Throws:
      IllegalStateException - if the builder had already been used to create an instance
      Since:
      1.0
    • setUrlTrackingLatencyMs

      public DefaultSourceFactory.Builder setUrlTrackingLatencyMs(long urlTrackingLatencyMs)
      sets latency for tracking URL content, defaults is DEFAULT_URL_TRACKING_LATENCY_MS.

      Only has an effect if also set to track URL content.

      Parameters:
      urlTrackingLatencyMs - latency for tracking URL content
      Returns:
      this, for chaining calls
      Throws:
      IllegalStateException - if the builder had already been used to create an instance
      Since:
      1.0
    • isTrackTextSourceIds

      public boolean isTrackTextSourceIds()
      gets whether to track (cache) text source IDs, default is not to track.
      Returns:
      whether to track (cache) text source IDs
      Since:
      1.0.1
    • isTrackFileSourceLastModified

      public boolean isTrackFileSourceLastModified()
      gets whether to track (cache) file source last modified, default is not to track.
      Returns:
      whether to track (cache) file source last modified
      Since:
      1.0.1
    • getFileLastModifiedTrackingLatencyMs

      public long getFileLastModifiedTrackingLatencyMs()
      gets latency for tracking file last modified of file sources.
      Returns:
      latency for tracking file last modified of file sources
      Since:
      1.0.1
    • isTrackUrlContent

      public boolean isTrackUrlContent()
      gets whether to track URL content.
      Returns:
      whether to track URL content
      Since:
      1.0
    • getUrlTrackingLatencyMs

      public long getUrlTrackingLatencyMs()
      gets latency for tracking URL content.
      Returns:
      latency for tracking URL content
      Since:
      1.0
    • build

      public DefaultSourceFactory build()
      builds an instance of DefaultSourceFactory.
      Returns:
      instance
      Since:
      1.0