public abstract static class StoreServer.Abstract extends Object implements StoreServer
StoreServer.Abstract
Modifier and Type | Field and Description |
---|---|
static ElapsedTime |
DEFAULT_PULL_SLEEP
Default pull sleep.
|
static String |
DELETED_TRACES
Traces subdirectory for deleted values.
|
static String |
NAME_PROPERTY
Name property.
|
static String |
PULL_SLEEP_PROPERTY
Pull sleep property.
|
static String |
STATE_PROPERTY
State definition property.
|
static String |
STATES_PROPERTY
States reference property.
|
static String |
UPDATED_TRACES
Traces subdirectory for updated values.
|
Constructor and Description |
---|
Abstract() |
Modifier and Type | Method and Description |
---|---|
protected void |
activateServiceClassLoader()
Activates the service class loader.
|
void |
addBinding(PointBinding binding)
Adds a binding.
|
void |
addNotice(PointValue notice)
Adds a notice.
|
void |
addNoticeListener(NoticeListener noticeListener)
Adds a notice listener.
|
PointBinding[] |
bind(PointBinding.Request[] bindRequests)
Binds point names to their UUID.
|
protected boolean |
checkPurge(UUID[] pointUUIDs,
Optional<Identity> identity)
Checks if a purge on point values is allowed for the identity.
|
protected Optional<Exception> |
checkUpdate(PointValue pointValue,
Optional<Identity> identity)
Checks if an update on a point's values is allowed for the identity.
|
void |
disableSuspend()
Disables suspend.
|
void |
enableSuspend()
Enables suspend.
|
protected void |
enterUpdates()
Enters updates.
|
protected Optional<Archiver> |
getArchiver()
Gets the archiver.
|
int |
getBackEndLimit()
Gets the back-end limit.
|
Optional<PointBinding> |
getBinding(String name)
Gets a point binding by name.
|
protected Traces |
getDeletedTraces()
Gets the 'deleted' traces.
|
Metadata |
getMetadata()
Gets the metadata.
|
protected Polator |
getPolator(Point point)
Gets the polator for a point.
|
Replicator |
getReplicator()
Gets the replicator.
|
int |
getResponseLimit()
Gets the response limit.
|
Collection<State.Group> |
getStateGroups()
Gets the state groups.
|
StoreStats |
getStats()
Gets the store stats.
|
protected Logger |
getThisLogger()
Gets the logger.
|
protected Traces |
getUpdatedTraces()
Gets the 'updated' traces.
|
boolean |
isMemory()
Asks if this is a memory store.
|
protected boolean |
isStarted()
Asks if started.
|
protected boolean |
isStopped()
Asks if stopped.
|
protected void |
leaveUpdates()
Leaves updates.
|
protected void |
lock()
Locks.
|
boolean |
probe()
Probes the state of the server.
|
Optional<StoreValues> |
pull(StoreValuesQuery query,
long timeout,
StoreSessionImpl storeSession,
Optional<Identity> identity)
Pulls points values.
|
int |
purge(UUID[] pointUUIDs,
TimeInterval timeInterval,
Optional<Identity> identity)
Purges points values.
|
boolean |
removeBinding(PointBinding binding)
Removes a binding.
|
void |
removeNoticeListener(NoticeListener noticeListener)
Removes a notice listener.
|
protected void |
reportUpdates(long updated,
long deleted,
long ignored,
long time)
Reports updates.
|
protected Optional<State> |
resolveForPoint(State state,
Optional<Point> point)
Resolves a state for a point.
|
Optional<State> |
resolveForPointUUID(State state,
Optional<UUID> pointUUID)
Resolves a state for a point UUID.
|
protected Exception[] |
restoreUpdates(PointValue[] updates)
Restore point references and values for updates.
|
void |
resumeUpdates()
Resume updates.
|
void |
sendNotices()
Sends the notices.
|
boolean |
setUp(StoreServiceAppImpl storeAppImpl)
Sets up for processing.
|
protected boolean |
setUpPullSleep()
Sets up pull sleep.
|
void |
start()
Starts this server
|
void |
stop()
Stops this server
|
boolean |
supportsCount()
Asks if the server supports count.
|
boolean |
supportsDelete()
Asks if the server supports delete.
|
protected boolean |
supportsDeleteTracer()
Asks if the server supports the delete tracer.
|
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.
|
protected boolean |
supportsUpdateTracer()
Asks if the server supports the update tracer.
|
void |
suspendUpdates()
Suspends updates.
|
void |
tearDown()
Tears down what has been set up.
|
void |
unbind(PointBinding[] bindings)
Unbinds.
|
protected StoreValues |
unknownQueryPoint(StoreValuesQuery query)
Returns an appropriate response for an unknown query point.
|
protected void |
unlock()
Unlocks.
|
protected StoreValues |
unsupportedPullQuery()
Returns an appropriate response for unsupported pull query.
|
protected VersionedValue |
versionedValue(PointValue update)
Returns a versioned value for an update.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
newArchiver, select, supportedValueTypeCodes, update
public static final ElapsedTime DEFAULT_PULL_SLEEP
public static final String DELETED_TRACES
public static final String NAME_PROPERTY
public static final String PULL_SLEEP_PROPERTY
public static final String STATES_PROPERTY
public static final String STATE_PROPERTY
public static final String UPDATED_TRACES
public final void addBinding(@Nonnull PointBinding binding)
binding
- The binding.public final void addNotice(@Nonnull PointValue notice) throws InterruptedException
notice
- A point value.InterruptedException
- When the service is stopped.public final void addNoticeListener(NoticeListener noticeListener)
addNoticeListener
in interface StoreServer
noticeListener
- The notice listener.public PointBinding[] bind(PointBinding.Request[] bindRequests)
bind
in interface StoreServer
bindRequests
- The bind requests.public final void disableSuspend() throws InterruptedException
disableSuspend
in interface StoreServer
InterruptedException
- When interrupted.public final void enableSuspend()
enableSuspend
in interface StoreServer
@CheckReturnValue public final int getBackEndLimit()
@Nonnull @CheckReturnValue public final Optional<PointBinding> getBinding(String name)
name
- The name.public final Metadata getMetadata()
getMetadata
in interface StoreServer
@Nonnull @CheckReturnValue public final Replicator getReplicator()
public final int getResponseLimit()
getResponseLimit
in interface StoreServer
public final Collection<State.Group> getStateGroups()
getStateGroups
in interface StoreServer
public final StoreStats getStats()
getStats
in interface StoreServer
public boolean isMemory()
isMemory
in interface StoreServer
public boolean probe()
probe
in interface StoreServer
public Optional<StoreValues> pull(StoreValuesQuery query, long timeout, StoreSessionImpl storeSession, Optional<Identity> identity) throws SessionException
pull
in interface StoreServer
query
- The store query.timeout
- A time limit in millis to wait for the first value
(negative for infinite).storeSession
- The store session implementation.identity
- The optional requesting identity.SessionException
- On session exception.Store.pull(StoreValuesQuery, long)
public int purge(UUID[] pointUUIDs, TimeInterval timeInterval, Optional<Identity> identity) throws ServiceNotAvailableException
purge
in interface StoreServer
pointUUIDs
- The UUID of the points to purge.timeInterval
- A time interval.identity
- The optional requesting identity.ServiceNotAvailableException
- On service not available.public final boolean removeBinding(@Nonnull PointBinding binding)
binding
- The binding.public final void removeNoticeListener(NoticeListener noticeListener)
removeNoticeListener
in interface StoreServer
noticeListener
- The notice listener.public Optional<State> resolveForPointUUID(State state, Optional<UUID> pointUUID)
resolveForPointUUID
in interface StoreServer
state
- The state.pointUUID
- The optional point UUID.public final void resumeUpdates()
resumeUpdates
in interface StoreServer
public void sendNotices() throws InterruptedException
InterruptedException
- When the service is stopped.@CheckReturnValue public boolean setUp(@Nonnull StoreServiceAppImpl storeAppImpl)
storeAppImpl
- The store application.public void start()
start
in interface StoreServer
public void stop()
stop
in interface StoreServer
public boolean supportsCount()
supportsCount
in interface StoreServer
public boolean supportsDelete()
supportsDelete
in interface StoreServer
public boolean supportsDeliver()
supportsDeliver
in interface StoreServer
public boolean supportsPull()
supportsPull
in interface StoreServer
public boolean supportsPurge()
supportsPurge
in interface StoreServer
public boolean supportsSubscribe()
supportsSubscribe
in interface StoreServer
public final void suspendUpdates()
suspendUpdates
in interface StoreServer
public void tearDown()
public void unbind(PointBinding[] bindings)
unbind
in interface StoreServer
bindings
- The point bindings.protected void activateServiceClassLoader()
@CheckReturnValue protected final boolean checkPurge(@Nonnull UUID[] pointUUIDs, @Nonnull Optional<Identity> identity)
pointUUIDs
- The points UUIDs.identity
- The optional identity.@Nonnull @CheckReturnValue protected final Optional<Exception> checkUpdate(@Nonnull PointValue pointValue, @Nonnull Optional<Identity> identity)
pointValue
- A point value.identity
- The optional identity.protected final void enterUpdates()
@Nonnull @CheckReturnValue protected Optional<Archiver> getArchiver()
@Nonnull @CheckReturnValue protected final Traces getDeletedTraces()
@Nonnull @CheckReturnValue protected Polator getPolator(@Nonnull Point point)
point
- The point.@Nonnull @CheckReturnValue protected final Logger getThisLogger()
@Nonnull @CheckReturnValue protected final Traces getUpdatedTraces()
@CheckReturnValue protected final boolean isStarted()
@CheckReturnValue protected final boolean isStopped()
protected final void leaveUpdates()
protected final void lock()
protected final void reportUpdates(long updated, long deleted, long ignored, long time)
updated
- The number of point values updated.deleted
- The number of point values deleted.ignored
- The number of updates ignored.time
- The update time in nanoseconds.@Nonnull @CheckReturnValue protected Optional<State> resolveForPoint(@Nonnull State state, @Nonnull Optional<Point> point)
state
- The state.point
- The optional point.@Nonnull @CheckReturnValue protected final Exception[] restoreUpdates(@Nonnull PointValue[] updates)
updates
- The point values to restore.@CheckReturnValue protected boolean setUpPullSleep()
@CheckReturnValue protected boolean supportsDeleteTracer()
@CheckReturnValue protected boolean supportsUpdateTracer()
@Nonnull @CheckReturnValue protected final StoreValues unknownQueryPoint(@Nonnull StoreValuesQuery query)
query
- The query.protected final void unlock()
@Nonnull @CheckReturnValue protected final StoreValues unsupportedPullQuery()
@Nonnull @CheckReturnValue protected final VersionedValue versionedValue(@Nonnull PointValue update)
update
- The update.Copyright © 2003-2019 Serge Brisson. All Rights Reserved.