public final class RMIStore extends AbstractStore implements SessionProxy.Listener
This class provides a client side access to an RMI Store.
Proxied.AbstractQUERIES_BATCH_LIMIT_PROPERTY, RESPONSE_LIMIT_PROPERTYARCHIVE_TIME_PARAM, BIND_POINTS_PARAM, BINDING_PARAM, CONFIRM_PARAM, CONFIRM_RETRIES_PARAM, CONFIRM_RETRY_DELAY_PARAM, DEFAULT_STORE_NAME, LIFE_TIME_PARAM, NAME_PARAM, NULL_REMOVES_PARAM, PASSWORD_PARAM, QUEUE_PARAM, RESPECT_VERSION_PARAM, SECURITY_PARAM, USER_PARAM| Constructor and Description |
|---|
RMIStore() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
bindPoints(Set<Point> points)
Binds points to their UUID.
|
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.
|
protected void |
doAddQuery(StoreValuesQuery query)
Does add a store query for point values.
|
Optional<Exception[]> |
getExceptions()
Gets the exceptions.
|
Optional<StoreValues[]> |
getSubscribedValues()
Gets the values from the subscribed call.
|
void |
impersonate(Optional<String> user)
Impersonates an other user.
|
Iterable<PointValue> |
iterate(StoreValuesQuery query)
Iterates on the point values returned for a store query.
|
Optional<StoreValues> |
nextValues()
Returns the next store values to our store queries.
|
boolean |
onSessionConnected(SessionProxy sessionProxy)
Called when the session is connected.
|
void |
onSessionDisconnected(SessionProxy sessionProxy)
Called when the session is disconnected.
|
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.
|
protected void |
reset()
Resets.
|
StoreValues |
select(StoreValuesQuery query)
Selects the store values for a store query.
|
boolean |
sendUpdates(Collection<PointValue> updates)
Sends updates.
|
boolean |
setUp(Metadata metadata,
ProxyEntity proxyEntity)
Sets up the instance for action.
|
boolean |
subscribe(UUID[] points)
Subscribes to point values store update events.
|
protected String |
supportedValueTypeCodes()
Returns a string of supported value type codes.
|
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 |
supportsSubscribe()
Asks if this store supports subscribe.
|
boolean |
unsubscribe(UUID[] points)
Unsubscribes from points values events.
|
accessException, addQuery, addUpdate, bind, bindPoints, compareTo, getConfirmRetries, getConfirmRetryDelay, getQueriesBatchLimit, getResponseLimit, getThisLogger, getUpdateCount, getUpdates, getUUID, isNullRemoves, sendUpdates, setConfirmRetries, setQueriesBatchLimit, setResponseLimit, subscribe, supportedValueTypes, supportsPurge, tearDowngetMetadata, getName, getParams, getProxyEntitypublic boolean canConfirm()
canConfirm in interface StorecanConfirm in class AbstractStorepublic void close()
May be called redundantly.
close in interface Storeclose in class AbstractStorepublic boolean confirm(PointValue pointValue, boolean confirmValue) throws InterruptedException, StoreAccessException
confirm in interface Storeconfirm in class AbstractStorepointValue - The point value.confirmValue - When true, PointValue.sameValueAs(org.rvpf.base.value.PointValue) should be
called.InterruptedException - When interrupted.StoreAccessException - On store access problem.public void connect()
throws StoreAccessException
connect in interface StoreStoreAccessException - On store access problem.public 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.
deliver in interface Storedeliver in class AbstractStorelimit - 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.Store.supportsDeliver()public Optional<Exception[]> getExceptions()
getExceptions in interface Storepublic Optional<StoreValues[]> getSubscribedValues()
getSubscribedValues in interface StoregetSubscribedValues in class AbstractStorepublic void impersonate(Optional<String> user)
throws StoreAccessException
Ends the current impersonation, if any, and begins a new one if the user argument is not empty.
impersonate in interface Storeimpersonate in class AbstractStoreuser - The other user (empty string for anonymous, empty to cancel).StoreAccessException - On store access problem.public Iterable<PointValue> iterate(StoreValuesQuery query)
The iteration can extend beyond the store query limit.
Note: the returned iterable and its iterator are not thread safe.
iterate in interface Storeiterate in class AbstractStorequery - The store query.public Optional<StoreValues> nextValues() throws InterruptedException, StoreAccessException
Any pending query is first sent.
nextValues in interface StoreInterruptedException - When the service is stopped.StoreAccessException - On store access problem.public boolean onSessionConnected(SessionProxy sessionProxy)
onSessionConnected in interface SessionProxy.ListenersessionProxy - The session proxy.public void onSessionDisconnected(SessionProxy sessionProxy)
onSessionDisconnected in interface SessionProxy.ListenersessionProxy - The session proxy.public boolean probe()
throws StoreAccessException
probe in interface StoreStoreAccessException - On store access problem.public StoreValues pull(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.
pull in interface Storepull in class AbstractStorequery - 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.Store.select(StoreValuesQuery),
Store.deliver(int, long),
Store.supportsPull()public int purge(UUID[] pointUUIDs, TimeInterval timeInterval) throws StoreAccessException
purge in interface Storepurge in class AbstractStorepointUUIDs - The UUID of the points to purge.timeInterval - A time interval.StoreAccessException - On store access problem.Store.supportsPurge()public StoreValues select(StoreValuesQuery query) throws InterruptedException, StoreAccessException
The processing of the query must not interfere with the batch operation mode.
select in interface Storequery - The store query.InterruptedException - When the service is stopped.StoreAccessException - On store access problem.public boolean sendUpdates(Collection<PointValue> updates) throws StoreAccessException
sendUpdates in interface Storeupdates - The updates to send.StoreAccessException - On store access problem.public boolean setUp(Metadata metadata, ProxyEntity proxyEntity)
setUp in interface ProxiedsetUp in class AbstractStoremetadata - The metadata available to the current process.proxyEntity - The proxy entity refering to the proxied.public boolean subscribe(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'.
subscribe in interface Storesubscribe in class AbstractStorepoints - The points.StoreAccessException - On store access problem.Store.deliver(int, long),
Store.pull(StoreValuesQuery, long),
Store.getSubscribedValues(),
Store.supportsSubscribe()public boolean supportsCount()
throws StoreAccessException
supportsCount in interface StoresupportsCount in class AbstractStoreStoreAccessException - On store access problem.public boolean supportsDelete()
throws StoreAccessException
supportsDelete in interface StoresupportsDelete in class AbstractStoreStoreAccessException - On store access problem.public boolean supportsDeliver()
throws StoreAccessException
supportsDeliver in interface StoresupportsDeliver in class AbstractStoreStoreAccessException - On store access problem.public boolean supportsPull()
throws StoreAccessException
supportsPull in interface StoresupportsPull in class AbstractStoreStoreAccessException - On store access problem.public boolean supportsSubscribe()
throws StoreAccessException
supportsSubscribe in interface StoresupportsSubscribe in class AbstractStoreStoreAccessException - On store access problem.public boolean unsubscribe(UUID[] points) throws StoreAccessException
unsubscribe in interface Storeunsubscribe in class AbstractStorepoints - The points.StoreAccessException - On store access problem.protected void bindPoints(Set<Point> points) throws InterruptedException, StoreAccessException
bindPoints in class AbstractStorepoints - The points.InterruptedException - When the service is stopped.StoreAccessException - On store access problem.protected void doAddQuery(StoreValuesQuery query)
This provides the subclass specific implementation.
doAddQuery in class AbstractStorequery - The store query.protected void reset()
reset in class AbstractStoreprotected String supportedValueTypeCodes()
throws StoreAccessException
supportedValueTypeCodes in class AbstractStoreStoreAccessException - On store access problem.Copyright © 2003-2019 Serge Brisson. All Rights Reserved.