@ThreadSafe public final class StoreSessionProxy extends SessionProxy implements StoreSession
Simplifies the access to a store session.
| Modifier and Type | Class and Description |
|---|---|
static class |
StoreSessionProxy.Builder
Builder.
|
class |
StoreSessionProxy.ValuesIterator
Values iterator.
|
SessionProxy.Listener, SessionProxy.SessionConnectVetoExceptionSession.ConnectionMode| Modifier and Type | Method and Description |
|---|---|
protected Session |
createSession()
Creates a session.
|
StoreValues |
deliver(int limit,
long timeout)
Delivers point value events.
|
Optional<Exception> |
getException()
Get the exception.
|
Optional<Exception[]> |
getExceptions()
Gets the exceptions.
|
Optional<List<PointBinding>> |
getPointBindings(Collection<PointBinding.Request> bindingRequests)
Gets point binding informations on selected points.
|
Optional<PointBinding[]> |
getPointBindings(PointBinding.Request bindingRequest)
Gets point binding informations on selected points.
|
PointBinding[] |
getPointBindings(PointBinding.Request[] bindingRequests)
Gets point binding informations on selected points.
|
Optional<StoreValues> |
getResponse()
Gets the response.
|
Optional<StoreValues[]> |
getResponses()
Gets the responses.
|
Optional<State.Group> |
getStateGroup(Optional<String> name)
Gets a state group by its name.
|
State.Group[] |
getStateGroups()
Gets the state groups.
|
void |
impersonate(String user)
Impersonates an other user.
|
void |
interrupt()
Interrupts the current delivery.
|
Iterable<PointValue> |
iterate(StoreValuesQuery storeQuery,
Optional<Points> points)
Iterates on the point values returned for a store query.
|
static StoreSessionProxy.Builder |
newBuilder()
Returns a new builder.
|
boolean |
probe()
Probes the state of a session.
|
StoreValues |
pull(StoreValuesQuery query,
long timeout)
Pulls points values.
|
int |
purge(UUID[] pointUUIDs,
TimeInterval timeInterval)
Purges point values.
|
int |
purge(UUID pointUUID,
TimeInterval timeInterval)
Purges point values.
|
State |
resolve(State state)
Resolves a global state.
|
State |
resolve(State state,
Point point)
Resolves a state for a point.
|
State |
resolve(State state,
UUID pointUUID)
Resolves a state for a point.
|
List<StoreValues> |
select(Collection<StoreValuesQuery> queries)
Selects point values.
|
Optional<StoreValues> |
select(StoreValuesQuery storeQuery)
Selects point values.
|
StoreValues[] |
select(StoreValuesQuery[] queries)
Selects point values.
|
List<StoreValues> |
subscribe(Collection<UUID> pointUUIDs)
Subscribes to point values events.
|
Optional<StoreValues> |
subscribe(UUID pointUUID)
Subscribes to a point values events.
|
StoreValues[] |
subscribe(UUID[] pointUUIDs)
Subscribes to point values events.
|
boolean |
subscribeAndCheck(Collection<UUID> pointUUIDs,
Logger logger)
Subscribes to point values events and check the responses.
|
boolean |
subscribeAndCheck(UUID[] pointUUIDs,
Logger logger)
Subscribes to point values events and check the responses.
|
boolean |
subscribeAndCheck(UUID pointUUID,
Logger logger)
Subscribes to point value events and check the response.
|
String |
supportedValueTypeCodes()
Returns a string of supported value type codes.
|
EnumSet<Externalizer.ValueType> |
supportedValueTypes()
Returns the set of supported value types.
|
boolean |
supportsCount()
Asks if the server supports count.
|
boolean |
supportsDelete()
Asks if the server supports delete.
|
boolean |
supportsDeliver()
Asks if the server supports deliver.
|
boolean |
supportsPull()
Asks if the server supports pull.
|
boolean |
supportsPurge()
Asks if the server supports purge.
|
boolean |
supportsSubscribe()
Asks if the server supports subscribe.
|
List<Exception> |
unsubscribe(Collection<UUID> pointUUIDs)
Unsubscribes from point values events.
|
Exception |
unsubscribe(UUID pointUUID)
Usubscribes from a point values events.
|
Exception[] |
unsubscribe(UUID[] pointUUIDs)
Unsubscribes from point values events.
|
boolean |
unsubscribeAndCheck(Collection<UUID> pointUUIDs,
Logger logger)
Subscribes to point values events and check the responses.
|
boolean |
unsubscribeAndCheck(UUID[] pointUUIDs,
Logger logger)
Subscribes to point values events and check the responses.
|
boolean |
unsubscribeAndCheck(UUID pointUUID,
Logger logger)
Subscribes to point value events and check the response.
|
List<Exception> |
update(Collection<PointValue> pointValues)
Updates point values.
|
Optional<Exception> |
update(PointValue pointValue)
Updates a point value.
|
Exception[] |
update(PointValue[] pointValues)
Updates point values.
|
boolean |
updateAndCheck(Collection<PointValue> pointValues,
Logger logger)
Updates point values and check the responses.
|
boolean |
updateAndCheck(PointValue[] pointValues,
Logger logger)
Updates point values and check the responses.
|
boolean |
updateAndCheck(PointValue pointValue,
Logger logger)
Updates a point value and check the response.
|
connect, disconnect, getClientName, getConnectionMode, getContext, getContextUUID, getFactory, getServerName, getServerURI, getSession, getThisLogger, hasLoginInfo, isConnected, isPrivate, isRemote, lockConnect, lockConnectInterruptibly, login, logout, sessionException, sessionMode, tearDown, unlockConnectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConnectionMode, login, logout@Nonnull @CheckReturnValue public static StoreSessionProxy.Builder newBuilder()
public StoreValues deliver(int limit, long timeout) throws SessionException
deliver in interface StoreSessionlimit - A limit for the number of values.timeout - A time limit in millis to wait for the first message
(negative for infinite).SessionException - From session security check.Store.deliver(int, long)@Nonnull @CheckReturnValue public Optional<Exception> getException()
@Nonnull @CheckReturnValue public Optional<Exception[]> getExceptions()
@Nonnull @CheckReturnValue public Optional<List<PointBinding>> getPointBindings(@Nonnull Collection<PointBinding.Request> bindingRequests) throws SessionException
bindingRequests - Selection specifications.SessionException - From session security check.@Nonnull @CheckReturnValue public Optional<PointBinding[]> getPointBindings(@Nonnull PointBinding.Request bindingRequest) throws SessionException
bindingRequest - Selection specifications.SessionException - From session security check.public PointBinding[] getPointBindings(PointBinding.Request[] bindingRequests) throws SessionException
getPointBindings in interface StoreSessionbindingRequests - Selection specifications.SessionException - From session security check.@Nonnull @CheckReturnValue public Optional<StoreValues> getResponse()
@Nonnull @CheckReturnValue public Optional<StoreValues[]> getResponses()
@Nonnull @CheckReturnValue public Optional<State.Group> getStateGroup(@Nonnull Optional<String> name) throws SessionException
name - The group name (empty for anonymous).SessionException - From session security check.public State.Group[] getStateGroups() throws SessionException
getStateGroups in interface StoreSessionSessionException - From session security check.public void impersonate(String user)
throws SessionException
impersonate in interface StoreSessionuser - The other user (empty for anonymous, null to cancel).SessionException - From session security check.public void interrupt()
throws SessionException
interrupt in interface StoreSessionSessionException - From session security check.@Nonnull @CheckReturnValue public Iterable<PointValue> iterate(@Nonnull StoreValuesQuery storeQuery, @Nonnull Optional<Points> points)
The iteration can extend beyond the store query limit.
Note: the returned iterable and its iterator are not thread safe.
storeQuery - The store query.points - Points metadata.public boolean probe()
throws SessionException
probe in interface StoreSessionSessionException - On session problems.public StoreValues pull(StoreValuesQuery query, long timeout) throws SessionException
pull in interface StoreSessionquery - The store query.timeout - A time limit in millis to wait for the first value
(negative for infinite).SessionExceptionStore.pull(StoreValuesQuery, long)@CheckReturnValue
public int purge(@Nonnull
UUID pointUUID,
@Nonnull
TimeInterval timeInterval)
throws SessionException
pointUUID - The point to purge.timeInterval - A time interval.SessionException - On session exception.Store.purge(UUID[], TimeInterval)public int purge(UUID[] pointUUIDs, TimeInterval timeInterval) throws SessionException
purge in interface StoreSessionpointUUIDs - The UUID of the points to purge.timeInterval - A time interval.SessionException - From session security check.Store.purge(UUID[], TimeInterval)@Nullable @CheckReturnValue public State resolve(@Nonnull State state) throws SessionException
state - The state.SessionException - From session security check.@Nullable @CheckReturnValue public State resolve(@Nonnull State state, @Nullable Point point) throws SessionException
state - The state.point - The optional point.SessionException - From session security check.public State resolve(State state, UUID pointUUID) throws SessionException
resolve in interface StoreSessionstate - The state.pointUUID - The optional point UUID.SessionException - From session security check.@Nullable @CheckReturnValue public List<StoreValues> select(@Nonnull Collection<StoreValuesQuery> queries) throws SessionException
queries - The store queries.SessionException - On session exception.@Nonnull @CheckReturnValue public Optional<StoreValues> select(@Nonnull StoreValuesQuery storeQuery) throws SessionException
storeQuery - A store query.SessionException - From session security check.public StoreValues[] select(StoreValuesQuery[] queries) throws SessionException
select in interface StoreSessionqueries - An array of store queries.SessionException - On session exception.@Nullable @CheckReturnValue public List<StoreValues> subscribe(@Nonnull Collection<UUID> pointUUIDs) throws SessionException
pointUUIDs - The point UUIDs.SessionException - From session security check.@Nonnull @CheckReturnValue public Optional<StoreValues> subscribe(@Nullable UUID pointUUID) throws SessionException
pointUUID - The point UUID.SessionException - From session security check.public StoreValues[] subscribe(UUID[] pointUUIDs) throws SessionException
subscribe in interface StoreSessionpointUUIDs - The point UUIDs.SessionException - From session security check.@CheckReturnValue
public boolean subscribeAndCheck(@Nonnull
Collection<UUID> pointUUIDs,
@Nonnull
Logger logger)
throws SessionException
pointUUIDs - The point UUIDs.logger - A logger.SessionException - From session security check.@CheckReturnValue
public boolean subscribeAndCheck(@Nonnull
UUID pointUUID,
@Nonnull
Logger logger)
throws SessionException
pointUUID - The point UUID.logger - A logger.SessionException - On session exception.@CheckReturnValue
public boolean subscribeAndCheck(@Nonnull
UUID[] pointUUIDs,
@Nonnull
Logger logger)
throws SessionException
pointUUIDs - The point UUIDs.logger - A logger.SessionException - From session security check.public String supportedValueTypeCodes()
throws SessionException
supportedValueTypeCodes in interface StoreSessionSessionException@Nonnull @CheckReturnValue public EnumSet<Externalizer.ValueType> supportedValueTypes() throws SessionException
SessionException - From session security check.public boolean supportsCount()
throws SessionException
supportsCount in interface StoreSessionSessionException - From session security check.public boolean supportsDelete()
throws SessionException
supportsDelete in interface StoreSessionSessionException - From session security check.public boolean supportsDeliver()
throws SessionException
supportsDeliver in interface StoreSessionSessionException - From session security check.public boolean supportsPull()
throws SessionException
supportsPull in interface StoreSessionSessionException - From session security check.public boolean supportsPurge()
throws SessionException
supportsPurge in interface StoreSessionSessionException - From session security check.public boolean supportsSubscribe()
throws SessionException
supportsSubscribe in interface StoreSessionSessionException - From session security check.@Nullable
@CheckReturnValue
public List<Exception> unsubscribe(@Nonnull
Collection<UUID> pointUUIDs)
throws SessionException
pointUUIDs - The point UUIDs.SessionException - From session security check.@Nullable
@CheckReturnValue
public Exception unsubscribe(@Nonnull
UUID pointUUID)
throws SessionException
pointUUID - The point.SessionException - From session security check.public Exception[] unsubscribe(UUID[] pointUUIDs) throws SessionException
unsubscribe in interface StoreSessionpointUUIDs - The point UUIDs.SessionException - From session security check.@CheckReturnValue
public boolean unsubscribeAndCheck(@Nonnull
Collection<UUID> pointUUIDs,
@Nonnull
Logger logger)
throws SessionException
pointUUIDs - The point UUIDs.logger - A logger.SessionException - From session security check.@CheckReturnValue
public boolean unsubscribeAndCheck(@Nonnull
UUID pointUUID,
@Nonnull
Logger logger)
throws SessionException
pointUUID - The point UUID.logger - A logger.SessionException - On session exception.@CheckReturnValue
public boolean unsubscribeAndCheck(@Nonnull
UUID[] pointUUIDs,
@Nonnull
Logger logger)
throws SessionException
pointUUIDs - The point UUIDs.logger - A logger.SessionException - From session security check.@Nullable
@CheckReturnValue
public List<Exception> update(@Nonnull
Collection<PointValue> pointValues)
throws SessionException
pointValues - The point values.SessionException - On session exception.@Nonnull
@CheckReturnValue
public Optional<Exception> update(@Nonnull
PointValue pointValue)
throws SessionException
pointValue - The point value.SessionException - On session exception.public Exception[] update(PointValue[] pointValues) throws SessionException
update in interface StoreSessionpointValues - The point values.SessionException@CheckReturnValue
public boolean updateAndCheck(@Nonnull
Collection<PointValue> pointValues,
@Nonnull
Logger logger)
throws SessionException
pointValues - The point values.logger - A logger.SessionException - On session exception.@CheckReturnValue public boolean updateAndCheck(PointValue pointValue, Logger logger) throws SessionException
pointValue - The point value.logger - A logger.SessionException - On session exception.@CheckReturnValue
public boolean updateAndCheck(@Nonnull
PointValue[] pointValues,
@Nonnull
Logger logger)
throws SessionException
pointValues - The point values.logger - A logger.SessionException - On session exception.protected Session createSession() throws RemoteException, SessionException
createSession in class SessionProxyRemoteException - From RMI.SessionException - When session creation fails.Copyright © 2003-2019 Serge Brisson. All Rights Reserved.