public interface Store extends Comparable<Store>
This interface is the client's view of the point values storage system. It is used to query and update values.
Modifier and Type | Field and Description |
---|---|
static String |
ARCHIVE_TIME_PARAM
Time limit for keeping point values in the store.
|
static String |
BIND_POINTS_PARAM
Requests the dynamic binding of the points to their UUID.
|
static String |
BINDING_PARAM
Specifies the RMI URI for the server binding.
|
static String |
CONFIRM_PARAM
Asks that Notices be confirmed by a request to this Store.
|
static String |
CONFIRM_RETRIES_PARAM
Maximum number of confirm retries.
|
static String |
CONFIRM_RETRY_DELAY_PARAM
Confirm retry delay.
|
static String |
DEFAULT_STORE_NAME
Default store name.
|
static String |
LIFE_TIME_PARAM
Time limit for keeping point values in the store.
|
static String |
NAME_PARAM
Specifies the name for the RMI registry.
|
static String |
NULL_REMOVES_PARAM
Specifies if a null value should cause a removal from a store.
|
static String |
PASSWORD_PARAM
Specifies the password for authentication to the server.
|
static String |
QUEUE_PARAM
Specifies the name of a queue properties group.
|
static String |
RESPECT_VERSION_PARAM
The archiver must respect the point version.
|
static String |
SECURITY_PARAM
Specifies the security properties for connection to the server.
|
static String |
USER_PARAM
Specifies the user for identification to the server.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addQuery(StoreValuesQuery query)
Adds a store query for point values.
|
void |
addUpdate(PointValue pointValue)
Added an update for a point value.
|
void |
bind(Point point)
Requests the binding of a point.
|
boolean |
canConfirm()
Asks if this store can confirm point values.
|
void |
close()
Closes the store.
|
boolean |
confirm(PointValue pointValue,
boolean confirmValue)
Confirms a point value.
|
void |
connect()
Connects.
|
StoreValues |
deliver(int limit,
long timeout)
Delivers subscribed point values from store update events.
|
Optional<Exception[]> |
getExceptions()
Gets the exceptions.
|
String |
getName()
Gets the store entity name.
|
Params |
getParams()
Gets this store's parameters.
|
int |
getQueriesBatchLimit()
Gets the queries batch limit.
|
int |
getResponseLimit()
Gets the response limit.
|
Optional<StoreValues[]> |
getSubscribedValues()
Gets the values from the subscribed call.
|
int |
getUpdateCount()
Gets the update count.
|
Collection<PointValue> |
getUpdates()
Gets the updates not yet sent.
|
UUID |
getUUID()
Gest the store entity UUID.
|
void |
impersonate(Optional<String> user)
Impersonates an other user.
|
boolean |
isNullRemoves()
Asks if a null value removes that value.
|
Iterable<PointValue> |
iterate(StoreValuesQuery storeQuery)
Iterates on the point values returned for a store query.
|
Optional<StoreValues> |
nextValues()
Returns the next store values to our store queries.
|
boolean |
probe()
Probes the state of the store session.
|
StoreValues |
pull(StoreValuesQuery query,
long timeout)
Pulls points values.
|
int |
purge(UUID[] pointUUIDs,
TimeInterval timeInterval)
Purges point values.
|
StoreValues |
select(StoreValuesQuery query)
Selects the store values for a store query.
|
boolean |
sendUpdates()
Sends the pending updates.
|
boolean |
sendUpdates(Collection<PointValue> updates)
Sends updates.
|
boolean |
subscribe(Collection<UUID> points)
Subscribes to point values store update events.
|
boolean |
subscribe(UUID[] points)
Subscribes to point values store update events.
|
EnumSet<Externalizer.ValueType> |
supportedValueTypes()
Gets the value types supported by this store.
|
boolean |
supportsCount()
Asks if this store supports count.
|
boolean |
supportsDelete()
Asks if this store supports delete.
|
boolean |
supportsDeliver()
Asks if this store supports deliver.
|
boolean |
supportsPull()
Asks if this store supports pull queries.
|
boolean |
supportsPurge()
Asks if this store supports purge.
|
boolean |
supportsSubscribe()
Asks if this store supports subscribe.
|
boolean |
unsubscribe(UUID[] points)
Unsubscribes from points values events.
|
static final String ARCHIVE_TIME_PARAM
static final String BINDING_PARAM
static final String BIND_POINTS_PARAM
static final String CONFIRM_PARAM
static final String CONFIRM_RETRIES_PARAM
static final String CONFIRM_RETRY_DELAY_PARAM
static final String DEFAULT_STORE_NAME
static final String LIFE_TIME_PARAM
static final String NAME_PARAM
static final String NULL_REMOVES_PARAM
static final String PASSWORD_PARAM
static final String QUEUE_PARAM
static final String RESPECT_VERSION_PARAM
static final String SECURITY_PARAM
static final String USER_PARAM
@CheckReturnValue boolean addQuery(@Nonnull StoreValuesQuery query)
The queries will be sent on the next call to nextValues()
.
query
- The store query.void addUpdate(@Nonnull PointValue pointValue)
The updates will be sent on the next call to sendUpdates()
.
pointValue
- The point value.supportsDelete()
void bind(@Nonnull Point point)
This allows communications with stores on different metadata domains. The client and server will try to map the possibly different UUID using the point's 'Tag' parameter (the point's name will be used when this parameter is absent).
point
- The point.@CheckReturnValue boolean canConfirm()
void close()
May be called redundantly.
@CheckReturnValue boolean confirm(@Nonnull PointValue pointValue, boolean confirmValue) throws InterruptedException, StoreAccessException
pointValue
- The point value.confirmValue
- When true, PointValue.sameValueAs(org.rvpf.base.value.PointValue)
should be
called.InterruptedException
- When interrupted.StoreAccessException
- On store access problem.void connect() throws StoreAccessException
StoreAccessException
- On store access problem.@Nonnull @CheckReturnValue StoreValues deliver(int limit, long timeout) throws InterruptedException, StoreAccessException
A 'deliver' request is an alternative to a 'pull' request. Starting values are taken as the return of the 'subscribe' request; the follow up is then made with 'deliver' request.
limit
- A limit for the number of values.timeout
- A time limit in millis to wait for the first message
(negative for infinite).InterruptedException
- When the service is stopped.StoreAccessException
- On store access problem.supportsDeliver()
@Nonnull @CheckReturnValue Optional<Exception[]> getExceptions()
@Nonnull @CheckReturnValue String getName()
@Nonnull @CheckReturnValue Params getParams()
@CheckReturnValue int getQueriesBatchLimit()
@CheckReturnValue int getResponseLimit()
@Nonnull @CheckReturnValue Optional<StoreValues[]> getSubscribedValues()
@Nonnull @CheckReturnValue UUID getUUID()
@CheckReturnValue int getUpdateCount()
@Nonnull @CheckReturnValue Collection<PointValue> getUpdates()
void impersonate(@Nonnull Optional<String> user) throws StoreAccessException
Ends the current impersonation, if any, and begins a new one if the user argument is not empty.
user
- The other user (empty string for anonymous, empty to cancel).StoreAccessException
- On store access problem.@CheckReturnValue boolean isNullRemoves()
@Nonnull @CheckReturnValue Iterable<PointValue> iterate(@Nonnull StoreValuesQuery storeQuery)
The iteration can extend beyond the store query limit.
Note: the returned iterable and its iterator are not thread safe.
storeQuery
- The store query.@Nonnull @CheckReturnValue Optional<StoreValues> nextValues() throws InterruptedException, StoreAccessException
Any pending query is first sent.
InterruptedException
- When the service is stopped.StoreAccessException
- On store access problem.@CheckReturnValue boolean probe() throws StoreAccessException
StoreAccessException
- On store access problem.@Nonnull @CheckReturnValue StoreValues pull(@Nonnull StoreValuesQuery query, long timeout) throws InterruptedException, StoreAccessException
This differs from a 'select' call by insisting for a 'pull' query and allowing a wait for a non empty response. Also, if there are subscribed points, the returned values will be restricted to those points.
A 'pull' query gets point values based on the time of their last update ('version') instead of the time associated with the value ('stamp').
Note: the filtering for subscribed point values may represent a significant overhead; when appropriate, 'deliver' could provide better performance.
query
- The store query (must be a 'pull' query).timeout
- A time limit in millis to wait for the first value
(negative for infinite).InterruptedException
- When the service is stopped.StoreAccessException
- On store access problem.select(StoreValuesQuery)
,
deliver(int, long)
,
supportsPull()
@CheckReturnValue int purge(@Nonnull UUID[] pointUUIDs, @Nonnull TimeInterval timeInterval) throws StoreAccessException
pointUUIDs
- The UUID of the points to purge.timeInterval
- A time interval.StoreAccessException
- On store access problem.supportsPurge()
@Nonnull @CheckReturnValue StoreValues select(@Nonnull StoreValuesQuery query) throws InterruptedException, StoreAccessException
The processing of the query must not interfere with the batch operation mode.
query
- The store query.InterruptedException
- When the service is stopped.StoreAccessException
- On store access problem.@CheckReturnValue boolean sendUpdates() throws StoreAccessException
StoreAccessException
- On store access problem.@CheckReturnValue boolean sendUpdates(@Nonnull Collection<PointValue> updates) throws StoreAccessException
updates
- The updates to send.StoreAccessException
- On store access problem.@CheckReturnValue boolean subscribe(@Nonnull Collection<UUID> points) throws StoreAccessException
This calls collects the last value for each point at the time of the subscription. These values will be available with a call to 'getSubscribedValues'.
points
- The points.StoreAccessException
- On store access problem.deliver(int, long)
,
pull(StoreValuesQuery, long)
,
getSubscribedValues()
,
supportsSubscribe()
@CheckReturnValue boolean subscribe(@Nonnull UUID[] points) throws StoreAccessException
This calls collects the last value for each point at the time of the subscription. These values will be available with a call to 'getSubscribedValues'.
points
- The points.StoreAccessException
- On store access problem.deliver(int, long)
,
pull(StoreValuesQuery, long)
,
getSubscribedValues()
,
supportsSubscribe()
@Nonnull @CheckReturnValue EnumSet<Externalizer.ValueType> supportedValueTypes() throws StoreAccessException
StoreAccessException
- On store access problem.@CheckReturnValue boolean supportsCount() throws StoreAccessException
StoreAccessException
- On store access problem.@CheckReturnValue boolean supportsDelete() throws StoreAccessException
StoreAccessException
- On store access problem.@CheckReturnValue boolean supportsDeliver() throws StoreAccessException
StoreAccessException
- On store access problem.@CheckReturnValue boolean supportsPull() throws StoreAccessException
StoreAccessException
- On store access problem.@CheckReturnValue boolean supportsPurge() throws StoreAccessException
StoreAccessException
- On store access problem.@CheckReturnValue boolean supportsSubscribe() throws StoreAccessException
StoreAccessException
- On store access problem.@CheckReturnValue boolean unsubscribe(@Nonnull UUID[] points) throws StoreAccessException
points
- The points.StoreAccessException
- On store access problem.Copyright © 2003-2019 Serge Brisson. All Rights Reserved.