\r\n

51Degrees Pipeline Java  4.4

51Degrees Pipeline for Java

fiftyone.pipeline.engines.flowelements.SingleFileAspectEngineBuilderBase< TBuilder extends OnPremiseAspectEngineBuilderBase< TBuilder, TEngine, TEngine extends OnPremiseAspectEngine > Class Template Reference abstract

Detailed Description

Abstract base class that exposes the common options that all on-premise engine builders using a single data file should make use of.

Parameters
<TBuilder> - the specific builder type to use as the return type from the fluent builder methods
<TEngine> - the type of the engine that this builder will build

Inheritance diagram for fiftyone.pipeline.engines.flowelements.SingleFileAspectEngineBuilderBase< TBuilder extends OnPremiseAspectEngineBuilderBase< TBuilder, TEngine, TEngine extends OnPremiseAspectEngine >:

[legend]

Collaboration diagram for fiftyone.pipeline.engines.flowelements.SingleFileAspectEngineBuilderBase< TBuilder extends OnPremiseAspectEngineBuilderBase< TBuilder, TEngine, TEngine extends OnPremiseAspectEngine >:

[legend]

Public Member Functions

 SingleFileAspectEngineBuilderBase ()
Default constructor which uses the ILoggerFactory implementation returned by LoggerFactory#getILoggerFactory().
 SingleFileAspectEngineBuilderBase (ILoggerFactory loggerFactory)
Construct a new instance using the ILoggerFactory supplied. More...
 SingleFileAspectEngineBuilderBase (ILoggerFactory loggerFactory, DataUpdateService dataUpdateService)
Construct a new instance using the ILoggerFactory and DataUpdateService supplied. More...
TEngine  build ( @BuildArg("dataFile") String dataFile, @BuildArg("createTempDataCopy") boolean createTempDataCopy) throws Exception
Build an engine using the current options and the specified data file. More...
TEngine  build (byte[] data) throws Exception
Build an engine using the current options and the specified byte array. More...
TBuilder  setDataUpdateUrl (String url)
Configure the engine to use the specified URL when looking for an updated data file. More...
TBuilder  setDataUpdateUrlFormatter (DataUpdateUrlFormatter formatter)
Specify a DataUpdateUrlFormatter to be used by the DataUpdateService when building the complete URL to query for updated data. More...
TBuilder  setDataUpdateVerifyMd5 (boolean verify)
Set a value indicating if the DataUpdateService should expect the response from the data update URL to contain a 'content-md5' HTTP header that can be used to verify the integrity of the content. More...
TBuilder  setDataUpdateDecompress (boolean decompress)
Set a value indicating if the DataUpdateService should expect content from the configured data update URL to be compressed or not. More...
TBuilder  setAutoUpdate (boolean enabled)
Enable or disable automatic updates for this engine. More...
TBuilder  setDataFileSystemWatcher (boolean enabled)
The DataUpdateService has the ability to watch a data file on disk and automatically refresh the engine as soon as the file is updated. More...
TBuilder  setUpdatePollingInterval (int pollingIntervalSeconds)
Set the time between checks for a new data file made by the DataUpdateService in seconds. More...
TBuilder  setUpdatePollingIntervalSeconds (int pollingIntervalSeconds)
Set the time between checks for a new data file made by the DataUpdateService in seconds. More...
TBuilder  setUpdatePollingInterval (long pollingIntervalMillis)
Set the time between checks for a new data file made by the DataUpdateService in milliseconds. More...
TBuilder  setUpdatePollingIntervalMillis (long pollingIntervalMillis)
Set the time between checks for a new data file made by the DataUpdateService in milliseconds. More...
TBuilder  setUpdateRandomisationMax (long maximumDeviationMillis)
A random element can be added to the DataUpdateService polling interval. More...
TBuilder  setUpdateRandomisationMaxMillis (long maximumDeviationMillis)
A random element can be added to the DataUpdateService polling interval. More...
TBuilder  setVerifyIfModifiedSince (boolean enabled)
Set if DataUpdateService sends the If-Modified-Since header in the request for a new data file. More...
TBuilder  setDataUpdateLicenseKey (String key)
Set the license key to use when updating the Engine's data file. More...
TBuilder  setDataUpdateLicenseKeys (String[] keys)
Set the license keys to use when updating the Engine's data file. More...
TBuilder  setDataUpdateOnStartup (boolean enabled)
Configure the data file to update on startup or not. More...

Public Member Functions inherited from fiftyone.pipeline.engines.flowelements.OnPremiseAspectEngineBuilderBase< TBuilder, TEngine >

 OnPremiseAspectEngineBuilderBase ()
Default constructor which uses the ILoggerFactory implementation returned by LoggerFactory#getILoggerFactory().
 OnPremiseAspectEngineBuilderBase (ILoggerFactory loggerFactory)
Construct a new instance using the ILoggerFactory supplied. More...
 OnPremiseAspectEngineBuilderBase (ILoggerFactory loggerFactory, DataUpdateService dataUpdateService)
Construct a new instance using the ILoggerFactory and DataUpdateService supplied. More...
void  createAndVerifyTempDir (Path pathToCreate)
TBuilder  addDataFile (DataFileConfiguration configuration)
Add a data file for this engine to use. More...
TBuilder  setTempDirPath (String dirPath)
Set the temporary path to use when the engine needs to create temporary files. More...
abstract TBuilder  setPerformanceProfile (Constants.PerformanceProfiles profile)
Set the performance profile that the engine should use. More...

Protected Member Functions

TEngine  build () throws Exception
Build an engine using the configured options. More...

Protected Member Functions inherited from fiftyone.pipeline.engines.flowelements.OnPremiseAspectEngineBuilderBase< TBuilder, TEngine >

void  preCreateEngine ()
void  configureEngine (TEngine engine) throws Exception
AspectEngineDataFile  newAspectEngineDataFile ()
Create a new empty data file instance to be populated with the details of the data file to be used. More...

Constructor & Destructor Documentation

◆ SingleFileAspectEngineBuilderBase() [2/2]

fiftyone.pipeline.engines.flowelements.SingleFileAspectEngineBuilderBase< TBuilder extends OnPremiseAspectEngineBuilderBase< TBuilder, TEngine, TEngine extends OnPremiseAspectEngine >.SingleFileAspectEngineBuilderBase ( ILoggerFactory   loggerFactory,
DataUpdateService   dataUpdateService  
)

Construct a new instance using the ILoggerFactory and DataUpdateService supplied.

Parameters
loggerFactory - the logger factory to use
dataUpdateService - the DataUpdateService to use when automatic updates happen on the data file

Member Function Documentation

◆ build() [1/3]

TEngine fiftyone.pipeline.engines.flowelements.SingleFileAspectEngineBuilderBase< TBuilder extends OnPremiseAspectEngineBuilderBase< TBuilder, TEngine, TEngine extends OnPremiseAspectEngine >.build ( @BuildArg("dataFile") String   dataFile,
@BuildArg("createTempDataCopy") boolean   createTempDataCopy  
) throws Exception

Build an engine using the current options and the specified data file.

Also registers the data file with the data update service.

Parameters
dataFile - complete path to the data file to use when creating the engine
createTempDataCopy - if true, the engine will create a copy of the data file in a temporary location rather than using the file provided directly. If not loading all data into memory, this is required for automatic data updates to occur
Returns
new AspectEngine instance
Exceptions
Exception - if the engine could not be created

◆ build() [2/3]

TEngine fiftyone.pipeline.engines.flowelements.SingleFileAspectEngineBuilderBase< TBuilder extends OnPremiseAspectEngineBuilderBase< TBuilder, TEngine, TEngine extends OnPremiseAspectEngine >.build ( byte []   data ) throws Exception

Build an engine using the current options and the specified byte array.

Also registers the data file with the data update service.

Parameters
data - a byte[] containing an in-memory representation of a data file
Returns
new AspectEngine instance
Exceptions
Exception - if the engine could not be created

◆ setAutoUpdate()

TBuilder fiftyone.pipeline.engines.flowelements.SingleFileAspectEngineBuilderBase< TBuilder extends OnPremiseAspectEngineBuilderBase< TBuilder, TEngine, TEngine extends OnPremiseAspectEngine >.setAutoUpdate ( boolean   enabled )

Enable or disable automatic updates for this engine.

Default true

Parameters
enabled - if true, the engine will update its data file with no manual intervention. If false, the engine will never update its data file unless the update method is called on DataUpdateService
Returns
this builder

◆ setDataFileSystemWatcher()

TBuilder fiftyone.pipeline.engines.flowelements.SingleFileAspectEngineBuilderBase< TBuilder extends OnPremiseAspectEngineBuilderBase< TBuilder, TEngine, TEngine extends OnPremiseAspectEngine >.setDataFileSystemWatcher ( boolean   enabled )

The DataUpdateService has the ability to watch a data file on disk and automatically refresh the engine as soon as the file is updated.

This setting enables/disables that feature.

The setAutoUpdate(boolean) feature must also be enabled in order for the file system watcher to work.

If the engine is built from a byte[] then this setting does nothing.

Default is true

Parameters
enabled - the cache configuration to use
Returns
this builder

◆ setDataUpdateDecompress()

TBuilder fiftyone.pipeline.engines.flowelements.SingleFileAspectEngineBuilderBase< TBuilder extends OnPremiseAspectEngineBuilderBase< TBuilder, TEngine, TEngine extends OnPremiseAspectEngine >.setDataUpdateDecompress ( boolean   decompress )

Set a value indicating if the DataUpdateService should expect content from the configured data update URL to be compressed or not.

Default true

Parameters
decompress - true if the content from the data update URL needs to be decompressed. False otherwise
Returns
this builder

◆ setDataUpdateLicenseKey()

TBuilder fiftyone.pipeline.engines.flowelements.SingleFileAspectEngineBuilderBase< TBuilder extends OnPremiseAspectEngineBuilderBase< TBuilder, TEngine, TEngine extends OnPremiseAspectEngine >.setDataUpdateLicenseKey ( String   key )

Set the license key to use when updating the Engine's data file.

Default is no license key.

Parameters
key - the license key to use when checking for updates to the data file. A license key can be obtained from the 51Degrees website. If you have no license key then this parameter can be set to null, but doing so will disable automatic updates.
Returns
this builder

◆ setDataUpdateOnStartup()

TBuilder fiftyone.pipeline.engines.flowelements.SingleFileAspectEngineBuilderBase< TBuilder extends OnPremiseAspectEngineBuilderBase< TBuilder, TEngine, TEngine extends OnPremiseAspectEngine >.setDataUpdateOnStartup ( boolean   enabled )

Configure the data file to update on startup or not.

Default is false

Parameters
enabled - if true then when this file is registered with the data update service, it will immediately try to download the latest copy of the file. This action will block execution until the download is complete and the engine has loaded the new file.
Returns
this builder

◆ setDataUpdateVerifyMd5()

TBuilder fiftyone.pipeline.engines.flowelements.SingleFileAspectEngineBuilderBase< TBuilder extends OnPremiseAspectEngineBuilderBase< TBuilder, TEngine, TEngine extends OnPremiseAspectEngine >.setDataUpdateVerifyMd5 ( boolean   verify )

Set a value indicating if the DataUpdateService should expect the response from the data update URL to contain a 'content-md5' HTTP header that can be used to verify the integrity of the content.

Default true

Parameters
verify - true if the content should be verified with the Md5 hash. False otherwise
Returns
this builder

◆ setUpdatePollingInterval() [1/2]

TBuilder fiftyone.pipeline.engines.flowelements.SingleFileAspectEngineBuilderBase< TBuilder extends OnPremiseAspectEngineBuilderBase< TBuilder, TEngine, TEngine extends OnPremiseAspectEngine >.setUpdatePollingInterval ( int   pollingIntervalSeconds )

Set the time between checks for a new data file made by the DataUpdateService in seconds.

Deprecated:
use setUpdatePollingIntervalSeconds(int)
Parameters
pollingIntervalSeconds - the number of seconds between checks
Returns
this builder

◆ setUpdatePollingInterval() [2/2]

TBuilder fiftyone.pipeline.engines.flowelements.SingleFileAspectEngineBuilderBase< TBuilder extends OnPremiseAspectEngineBuilderBase< TBuilder, TEngine, TEngine extends OnPremiseAspectEngine >.setUpdatePollingInterval ( long   pollingIntervalMillis )

Set the time between checks for a new data file made by the DataUpdateService in milliseconds.

Deprecated:
use setUpdatePollingIntervalSeconds(int)
Parameters
pollingIntervalMillis - the time between checks
Returns
this builder

◆ setUpdatePollingIntervalSeconds()

TBuilder fiftyone.pipeline.engines.flowelements.SingleFileAspectEngineBuilderBase< TBuilder extends OnPremiseAspectEngineBuilderBase< TBuilder, TEngine, TEngine extends OnPremiseAspectEngine >.setUpdatePollingIntervalSeconds ( int   pollingIntervalSeconds )

Set the time between checks for a new data file made by the DataUpdateService in seconds.

Generally, the DataUpdateService will not check for a new data file until the 'expected update time' that is stored in the current data file. This interval is the time to wait between checks after that time if no update is initially found.

If automatic updates are disabled then this setting does nothing.

Default = 30 minutes.

Parameters
pollingIntervalSeconds - the number of seconds between checks
Returns
this builder

◆ setUpdateRandomisationMax()

TBuilder fiftyone.pipeline.engines.flowelements.SingleFileAspectEngineBuilderBase< TBuilder extends OnPremiseAspectEngineBuilderBase< TBuilder, TEngine, TEngine extends OnPremiseAspectEngine >.setUpdateRandomisationMax ( long   maximumDeviationMillis )

A random element can be added to the DataUpdateService polling interval.

This option sets the maximum length of this random addition in milliseconds.

Default = 10 minutes.

Deprecated:
use setUpdateRandomisationMaxMillis(long)
Parameters
maximumDeviationMillis - the maximum time added to the data update polling interval
Returns
this builder

◆ setUpdateRandomisationMaxMillis()

TBuilder fiftyone.pipeline.engines.flowelements.SingleFileAspectEngineBuilderBase< TBuilder extends OnPremiseAspectEngineBuilderBase< TBuilder, TEngine, TEngine extends OnPremiseAspectEngine >.setUpdateRandomisationMaxMillis ( long   maximumDeviationMillis )

A random element can be added to the DataUpdateService polling interval.

This option sets the maximum length of this random addition in milliseconds.

Default = 10 minutes.

Parameters
maximumDeviationMillis - the maximum time added to the data update polling interval
Returns
this builder
On This Page