AIDC Toolkit / GS1 / RemoteGCPLengthCache
Abstract Class: RemoteGCPLengthCache ​
Defined in: src/gcp-length-cache.ts:14
GS1 Company Prefix length cache with remote source.
Extends ​
Properties ​
DEFAULT_BASE_URL ​
staticDEFAULT_BASE_URL:string="/data/"
Defined in: src/gcp-length-cache.ts:18
Default base URL pointing to AIDC Toolkit website data directory.
SOURCE_HEADER_FILE_NAME ​
staticSOURCE_HEADER_FILE_NAME:string="gcp-length-header.json"
Defined in: src/gcp-length-cache.ts:23
File containing header information (date/time and disclaimer).
SOURCE_DATA_FILE_NAME ​
staticSOURCE_DATA_FILE_NAME:string="gcp-length-data.bin"
Defined in: src/gcp-length-cache.ts:28
File containing tree data in binary form.
Constructors ​
Constructor ​
new RemoteGCPLengthCache(
baseURL):RemoteGCPLengthCache
Defined in: src/gcp-length-cache.ts:47
Constructor.
Parameters ​
baseURL ​
string = RemoteGCPLengthCache.DEFAULT_BASE_URL
Base URL. The URL must end with a slash, and must host the SOURCE_HEADER_FILE_NAME and SOURCE_DATA_FILE_NAME files.
Returns ​
RemoteGCPLengthCache
Overrides ​
Accessors ​
sourceDateTime ​
Get Signature ​
Defined in: src/gcp-length-cache.ts:86
Get the date/time at which the source was last updated. This should not be called unless the next check date/time has passed, as it may trigger an expensive remote retrieval.
Returns ​
Overrides ​
sourceData ​
Get Signature ​
get sourceData():
Promise<GCPLengthData>
Defined in: src/gcp-length-cache.ts:99
Get the source data. This should not be called unless the next check date/time has passed, as it may trigger an expensive remote retrieval.
Returns ​
Overrides ​
nextCheckDateTime ​
Get Signature ​
get
abstractnextCheckDateTime():Promisable<Date|undefined>
Defined in: node_modules/@aidc-toolkit/core/dist/cache.d.ts:16
Get the date/time at or after which the source should be checked for updates. If the value is undefined, this is the first usage.
Returns ​
Promisable<Date | undefined>
Inherited from ​
GCPLengthCache.nextCheckDateTime
cacheDateTime ​
Get Signature ​
get
abstractcacheDateTime():Promisable<Date|undefined>
Defined in: node_modules/@aidc-toolkit/core/dist/cache.d.ts:21
Get the date/time at which the cache was last updated. This may more accurately reflect the date/time at which the last source retrieved was updated. If the value is undefined, there is no data in the cache.
Returns ​
Promisable<Date | undefined>
Inherited from ​
cacheData ​
Get Signature ​
get
abstractcacheData():Promisable<TCache>
Defined in: node_modules/@aidc-toolkit/core/dist/cache.d.ts:25
Get the cache data. This should only ever be called if the cache date/time is defined.
Returns ​
Promisable<TCache>
Inherited from ​
Methods ​
update() ​
Call Signature ​
abstractupdate(nextCheckDateTime):Promisable<void>
Defined in: node_modules/@aidc-toolkit/core/dist/cache.d.ts:43
Update the cache with only the next check date/time. The cache date/time and cache data must not be modified. This is typically called when the cache is up to date with the source or source retrieval has failed.
Parameters ​
nextCheckDateTime ​
Next check date/time.
Returns ​
Promisable<void>
Inherited from ​
Call Signature ​
abstractupdate(nextCheckDateTime,cacheDateTime,cacheData):Promisable<void>
Defined in: node_modules/@aidc-toolkit/core/dist/cache.d.ts:56
Update all cache parameters. This is typically called when the cache is updated from the source.
Parameters ​
nextCheckDateTime ​
Next check date/time.
cacheDateTime ​
Cache date/time.
cacheData ​
Cache data.
Returns ​
Promisable<void>