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, waitnewArchiver, select, supportedValueTypeCodes, updatepublic 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 StoreServernoticeListener - The notice listener.public PointBinding[] bind(PointBinding.Request[] bindRequests)
bind in interface StoreServerbindRequests - The bind requests.public final void disableSuspend()
throws InterruptedException
disableSuspend in interface StoreServerInterruptedException - 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 StoreServerpublic final Collection<State.Group> getStateGroups()
getStateGroups in interface StoreServerpublic final StoreStats getStats()
getStats in interface StoreServerpublic boolean isMemory()
isMemory in interface StoreServerpublic boolean probe()
probe in interface StoreServerpublic Optional<StoreValues> pull(StoreValuesQuery query, long timeout, StoreSessionImpl storeSession, Optional<Identity> identity) throws SessionException
pull in interface StoreServerquery - 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 StoreServerpointUUIDs - 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 StoreServernoticeListener - The notice listener.public Optional<State> resolveForPointUUID(State state, Optional<UUID> pointUUID)
resolveForPointUUID in interface StoreServerstate - The state.pointUUID - The optional point UUID.public final void resumeUpdates()
resumeUpdates in interface StoreServerpublic 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 StoreServerpublic void stop()
stop in interface StoreServerpublic boolean supportsCount()
supportsCount in interface StoreServerpublic boolean supportsDelete()
supportsDelete in interface StoreServerpublic boolean supportsDeliver()
supportsDeliver in interface StoreServerpublic boolean supportsPull()
supportsPull in interface StoreServerpublic boolean supportsPurge()
supportsPurge in interface StoreServerpublic boolean supportsSubscribe()
supportsSubscribe in interface StoreServerpublic final void suspendUpdates()
suspendUpdates in interface StoreServerpublic void tearDown()
public void unbind(PointBinding[] bindings)
unbind in interface StoreServerbindings - 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.