#
Common Entities
The Common Entities plugin provides entities whose dependencies (if any) include only those upon which the Rosetta framework itself depends (e.g. Jackson).
#
Dependency Information
<dependency>
<groupId>com.k-int.rosetta</groupId>
<artifactId>rosetta-common-entities</artifactId>
<version>3.0.0</version>
</dependency>
#
Providers
#
jackson-streaming
Entity Kind: Provider
Type: jackson-streaming
Request Model: GenericSearchRequest
Result Model: object
The jackson-streaming
Provider retrieves records stored in JSON files on the local filesystem using the Jackson Streaming API,
which allows very large files to be processed with minimal memory footprint.
The JSON file used for a specific request may depend on the request parameters or may be a single static file.
Each JSON file MUST be a top-level array whose items are JSON objects (key-value maps) that are interpreted as the individual
results/records that this Provider provides.
Requests made against this Provider MUST conform to the GenericSearchRequest schema, where the individual request parameters are interpreted as follows:
queries[0]
: The first item in thequeries
array is used as the key to look up the JSON file path in thefiles
map in the properties.
If thefiles
map is not specified, or there is no mapping for the givenqueries[0]
value, then thefile
property will be used, if specified.
Otherwise, the Provider response will be empty.from
: The zero-based array offset in the JSON array from which results will be taken.size
: The maximum number of results to be returned for this request.
#
Properties
#
SkipTotalCount
#
Example
name: my-provider
type: jackson-streaming
properties:
file: /data/default_file.json
files:
objects: /data/objects.json
media: /data/media.json
skip_total_count: auto
offset_cache:
enabled: true
duration: 5m
max_files: 100
max_offsets: 100
cache_all_offsets: false
#
self
Entity Kind: Provider
Type: self
Request Model: DataServiceRequest
Result Model: object
The self
Provider retrieves results by executing a nested DataServiceRequest
against the same Rosetta instance
that is handling the current request. This can be used to wrap additional static transforms around a variable "base"
Rosetta Profile, for instance.
All results and custom metadata are transcribed into the Provider response from the DataServiceResponse
received after executing the DataServiceRequest
.
Note that only single result set (i.e. single provider) base Profiles are supported. If multiple result sets are detected, then only the first result set will be used and a warning will be logged.
#
Properties
#
Example
name: my-provider
type: self
properties:
profile: search