Package ch.grengine.source
Class DefaultSourceFactory.Builder
java.lang.Object
ch.grengine.source.DefaultSourceFactory.Builder
- Enclosing class:
- DefaultSourceFactory
Builder for
SourceFactory instances.- Since:
- 1.0
- Author:
- Alain Stalder, Made in Switzerland.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longdefault latency for tracking file last modified (1000ms = 1 second).static final longdefault latency for tracking URL content (60000ms = one minute). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()builds an instance ofDefaultSourceFactory.longgets latency for tracking file last modified of file sources.longgets latency for tracking URL content.booleangets whether to track (cache) file source last modified, default is not to track.booleangets whether to track (cache) text source IDs, default is not to track.booleangets whether to track URL content.setFileLastModifiedTrackingLatencyMs(long fileLastModifiedTrackingLatencyMs) sets latency for tracking file last modified of file sources, defaults isDEFAULT_FILE_LAST_MODIFIED_TRACKING_LATENCY_MS.setTrackFileSourceLastModified(boolean trackFileSourceLastModified) sets whether to track (cache) file source last modified, default is not to track.setTrackTextSourceIds(boolean trackTextSourceIds) sets whether to track (cache) text source IDs, default is not to track.setTrackUrlContent(boolean trackUrlContent) sets whether to track URL content, default is not to track, i.e. to consider URL content static.setUrlTrackingLatencyMs(long urlTrackingLatencyMs) sets latency for tracking URL content, defaults isDEFAULT_URL_TRACKING_LATENCY_MS.
-
Field Details
-
DEFAULT_URL_TRACKING_LATENCY_MS
public static final long DEFAULT_URL_TRACKING_LATENCY_MSdefault 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_MSdefault 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
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 isDEFAULT_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
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
sets latency for tracking URL content, defaults isDEFAULT_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
builds an instance ofDefaultSourceFactory.- Returns:
- instance
- Since:
- 1.0
-