public interface ApiJobStore
Modifier and Type | Method and Description |
---|---|
rx.Observable<JobRow> |
get(String id)
Returns a cold Observable that emits 0 or 1 messages: the desired JobRow, or nothing if there is no JobRow with
the specified id.
|
rx.Observable<JobRow> |
getAllRows()
A cold observable that emits a stream of JobRows until all JobRows have been retrieved from the store.
|
rx.Observable<JobRow> |
getFilteredRows(Set<JobRowFilter> jobRowFilters)
This method takes a Set of JobRowFilters, ANDS them by default, and returns a cold observable that emits a
stream of JobRows which satisfy the given filter.
|
rx.Observable<JobRow> |
save(JobRow metadata)
Returns a cold Observable that emits the JobRow that has been stored.
|
rx.Observable<JobRow> get(String id)
If an error is encountered while interacting with the metadata store, then the Observable's onError
is
called with the exception as payload.
id
- The ID of the job desiredrx.Observable<JobRow> save(JobRow metadata)
While the Observable should not emit a message until at least one subscriber has subscribed, it should store
the results immediately, without waiting for a subscriber.
If a row with the same ID already exists, then that row will be overwritten. Otherwise, a new ID-JobRow
mapping is added to the store. If an error is encountered while storing the data, the Observable instead invokes
the onError
methods on its subscribers with an ApiJobStoreException
metadata
- The Job metadata that needs to be storedrx.Observable<JobRow> getAllRows()
onError
is invoked, and the stream halts.rx.Observable<JobRow> getFilteredRows(Set<JobRowFilter> jobRowFilters) throws IllegalArgumentException
Any of the fields may be not filterable for every implementation of the ApiJobStore
as the efficiency of
filtering is dependent on the backing store. An IllegalArgumentException is thrown if filtering on any given
field is not supported.
jobRowFilters
- A Set of JobRowFilters where each JobRowFilter contains the JobField to be
filtered on, the filter operation and the values to be compared to.IllegalArgumentException
- if filtering on any field is not supportedCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.