\r\n

51Degrees Pipeline Java  4.4

51Degrees Pipeline for Java

fiftyone.pipeline.engines.services.DataUpdateServiceDefault Class Reference

Detailed Description

Default singleton implementation of the DataUpdateService.

See also
Specification

Inheritance diagram for fiftyone.pipeline.engines.services.DataUpdateServiceDefault:

[legend]

Collaboration diagram for fiftyone.pipeline.engines.services.DataUpdateServiceDefault:

[legend]

Public Member Functions

 DataUpdateServiceDefault ()
Constructor with default for everything.
 DataUpdateServiceDefault (Logger logger, HttpClient httpClient)
Construct a new instance of DataUpdateService. More...
 DataUpdateServiceDefault (Logger logger, HttpClient httpClient, FileWrapperFactory fileWrapperFactory, FutureFactory futureFactory)
Construct a new instance of DataUpdateService. More...
void  onUpdateComplete (OnUpdateComplete onUpdateComplete)
Add an event handler fired when a call to checkForUpdate(OnPremiseAspectEngine) is completed. More...
AutoUpdateStatus  checkForUpdate (OnPremiseAspectEngine<? extends AspectData, ? extends AspectPropertyMetaData > engine)
Check for an available download of a new data file, or a local data file newer than the one currently in use. More...
AutoUpdateStatus  checkForUpdate (OnPremiseAspectEngine<? extends AspectData, ? extends AspectPropertyMetaData > engine, String identifier)
Check for an available download of a new data file, or a local data file newer than the one currently in use. More...
AutoUpdateStatus  updateFromMemory (AspectEngineDataFile dataFile, byte[] data)
Update the Engine with the byte array provided. More...
void  registerDataFile (final AspectEngineDataFile dataFile)
Register an engine to be automatically kept up to data. More...
void  unregisterDataFile (AspectEngineDataFile dataFile)
Un-register a data file which was registered with the registerDataFile(AspectEngineDataFile) method. More...
void  close ()

Constructor & Destructor Documentation

◆ DataUpdateServiceDefault() [1/2]

fiftyone.pipeline.engines.services.DataUpdateServiceDefault.DataUpdateServiceDefault ( Logger   logger,
HttpClient   httpClient  
)

Construct a new instance of DataUpdateService.

Parameters
logger - the logger to use for logging
httpClient - the HTTP client used to download new data files

◆ DataUpdateServiceDefault() [2/2]

fiftyone.pipeline.engines.services.DataUpdateServiceDefault.DataUpdateServiceDefault ( Logger   logger,
HttpClient   httpClient,
FileWrapperFactory   fileWrapperFactory,
FutureFactory   futureFactory  
)

Construct a new instance of DataUpdateService.

Parameters
logger - the logger to use for logging
httpClient - the HTTP client used to download new data files
fileWrapperFactory - the factory to create the file wrappers used to access files
futureFactory - the future factory used to create update threads. NOTE: This factory will be closed when the Data Update Service gets closed so it is recommended to not share this factory, as scheduled tasks from other objects might be shutdown unexpectedly.

Member Function Documentation

◆ checkForUpdate() [1/2]

AutoUpdateStatus fiftyone.pipeline.engines.services.DataUpdateServiceDefault.checkForUpdate ( OnPremiseAspectEngine<? extends AspectData, ? extends AspectPropertyMetaData >   engine )

Check for an available download of a new data file, or a local data file newer than the one currently in use.

If either is the case, then the engine is updated with the new data. The engine does not need to be registered with the service for this method to be used.

Parameters
engine - AspectEngine to try updating
Returns
AutoUpdateStatus#AUTO_UPDATE_SUCCESS if the data file was successfully updated

Implements fiftyone.pipeline.engines.services.DataUpdateService.

◆ checkForUpdate() [2/2]

AutoUpdateStatus fiftyone.pipeline.engines.services.DataUpdateServiceDefault.checkForUpdate ( OnPremiseAspectEngine<? extends AspectData, ? extends AspectPropertyMetaData >   engine,
String   dataFileIdentifier  
)

Check for an available download of a new data file, or a local data file newer than the one currently in use.

If either is the case, then the engine is updated with the new data. The engine does not need to be registered with the service for this method to be used.

Parameters
engine - AspectEngine to try updating
dataFileIdentifier - the identifier of the data file to check for. If the engine has only one data file then this parameter is ignored
Returns
AutoUpdateStatus#AUTO_UPDATE_SUCCESS if the data file was successfully updated

Implements fiftyone.pipeline.engines.services.DataUpdateService.

◆ registerDataFile()

void fiftyone.pipeline.engines.services.DataUpdateServiceDefault.registerDataFile ( final AspectEngineDataFile   dataFile )

Register an engine to be automatically kept up to data.

Tasks will be scheduled for downloading and updating when new data files are expected. A regular task is also run to update an engine if the local data file is newer than the one in use.

Parameters
dataFile - data file to register

Implements fiftyone.pipeline.engines.services.DataUpdateService.

◆ updateFromMemory()

AutoUpdateStatus fiftyone.pipeline.engines.services.DataUpdateServiceDefault.updateFromMemory ( AspectEngineDataFile   engine,
byte []   data  
)

Update the Engine with the byte array provided.

If the Engine is is using data on disk, then the file is replaced with the new data.

Parameters
engine - AspectEngine to try updating
data - new data file in memory
Returns
AutoUpdateStatus#AUTO_UPDATE_SUCCESS if the data file was successfully updated

Implements fiftyone.pipeline.engines.services.DataUpdateService.