public abstract class StoreServiceAppImpl extends MetadataServiceAppImpl implements StoreServiceApp, ServiceThread.Target
Modifier and Type | Field and Description |
---|---|
static String |
BACK_END_LIMIT_PROPERTY
Specifies the maximum number of point values that may be requested from
the backend.
|
static ClassDef |
DEFAULT_NOTIFIER_CLASS
Default notifier.
|
static ClassDef |
DEFAULT_POLATOR
Default inter/extra-polator.
|
static ClassDef |
DEFAULT_REPLICATOR
Default replicator.
|
static int |
DEFAULT_RESPONSE_LIMIT
Default response limit.
|
static String |
DEFAULT_SERVER_PROPERTIES
Default server properties.
|
static String |
DEFAULT_STORE_DATA_DIR
Default store data directory path.
|
static ClassDef |
DEFAULT_UPDATES_LISTENER
Default updates listener.
|
static String |
NOTICES_FILTERED_PROPERTY
When enabled, the store will send notices only for points acting as
trigger for an other value.
|
static String |
NOTIFIER_CLASS_PROPERTY
Specifies an alternative to the SOM Notifier.
|
static String |
POLATOR_CLASS_PROPERTY
Specifies an alternative to the linear inter/extra-polator.
|
static String |
PULL_DISABLED_PROPERTY
Pull disabled property.
|
static String |
REPLICATOR_CLASS_PROPERTY
Specifies an alternative to the SOM replicator.
|
static String |
RESPONSE_LIMIT_PROPERTY
Specifies the maximum number of point values that may be grouped in a
single response.
|
static String |
STORE_DATA_DIR_PROPERTY
Specifies the store data directory path.
|
static String |
STORE_NAME_PROPERTY
This property is provided to a store, usually in its 'service' element,
to identify in the metadata the 'Store' entity that it is instantiating.
|
static String |
UPDATES_LISTENER_CLASS_PROPERTY
This property may be used to specify a queued updates listener.
|
static String |
UPDATES_LISTENER_PROPERTIES
Updates listener properties.
|
SERVICE_APP_PROPERTIES
Constructor and Description |
---|
StoreServiceAppImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addNotice(PointValue notice)
Adds a notice.
|
void |
addNoticeListener(NoticeListener noticeListener)
Adds a notice listener.
|
boolean |
areNoticesFiltered()
Asks if the notices are filtered.
|
protected void |
doPendingActions()
Does pending actions.
|
Optional<Archiver> |
getArchiver()
Gets the archiver.
|
int |
getBackEndLimit()
Gets the back-end limit.
|
protected String |
getDefaultStoreName()
Gets the default store name.
|
Optional<String> |
getEntityName()
Gets the entity name.
|
Collection<Point> |
getNoticesFilter()
Gets the notices filter.
|
Polator |
getPolator(Point point)
Gets the inter/extra-polator for a point.
|
Replicator |
getReplicator()
Gets the replicator.
|
int |
getResponseLimit()
Gets the response limit.
|
String |
getServerName()
Gets the server name.
|
KeyedGroups |
getServerProperties()
Gets the server properties.
|
File |
getStoreDataDir()
Gets the store data directory.
|
Optional<StoreEntity> |
getStoreEntity()
Gets the store entity.
|
StoreStats |
getStoreStats()
Gets the store statistics.
|
boolean |
isNullRemoves()
Asks if a null value removes that value.
|
boolean |
isPullDisabled()
Asks if pull requests support are disabled.
|
static Collection<Point> |
makeNoticesFilter(Metadata metadata)
Makes a notices filter.
|
boolean |
onNewMetadata(Metadata metadata)
Called on new metadata.
|
boolean |
onSignal(Signal signal)
Called when a signal has been received.
|
void |
rebind(UUID oldUUID,
UUID newUUID)
Rebinds a UUID.
|
protected boolean |
refreshMetadata()
Refreshes the metadata.
|
protected void |
refreshNoticesFilter()
Refreshes the notices filter.
|
protected boolean |
registerServer(Optional<String> serverPath,
StoreServer server)
Registers the server.
|
protected boolean |
registerServer(StoreServer server)
Registers the server.
|
void |
removeNoticeListener(NoticeListener noticeListener)
Removes a notice listener.
|
void |
run()
Runs.
|
void |
sendNotices()
Sends the notices.
|
protected boolean |
setUp()
Sets up this store service.
|
boolean |
setUp(MetadataService service)
Sets up the application.
|
protected boolean |
setUp(String serverPropertiesName)
Sets up using the specified server properties.
|
protected boolean |
setUpArchiver()
Sets up the archiver.
|
protected boolean |
setUpNotifier()
Sets up the notifier.
|
void |
start()
Starts the application.
|
void |
stop()
Stops the application.
|
protected StoreMetadataFilter |
storeMetadataFilter(String storeName,
Collection<String> partnerNames)
Returns a store metadata filter.
|
void |
tearDown()
Tears down the application.
|
protected void |
unregisterServer()
Unregisters the store server.
|
getMetadata, getService, loadMetadata, setUp
createStats, fail, getConfig, getConfigProperties, getDataDir, getJoinTimeout, getProperties, getSourceUUID, getThisLogger, getTimer, onAlert, onEvent, onServiceNotAvailableException, onServicesNotReady, onServicesReady
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getServer
createStats, onAlert, onEvent, onServicesNotReady, onServicesReady, setUp
public static final String BACK_END_LIMIT_PROPERTY
public static final ClassDef DEFAULT_NOTIFIER_CLASS
public static final ClassDef DEFAULT_POLATOR
public static final ClassDef DEFAULT_REPLICATOR
public static final int DEFAULT_RESPONSE_LIMIT
public static final String DEFAULT_SERVER_PROPERTIES
public static final String DEFAULT_STORE_DATA_DIR
public static final ClassDef DEFAULT_UPDATES_LISTENER
public static final String NOTICES_FILTERED_PROPERTY
public static final String NOTIFIER_CLASS_PROPERTY
public static final String POLATOR_CLASS_PROPERTY
public static final String PULL_DISABLED_PROPERTY
public static final String REPLICATOR_CLASS_PROPERTY
public static final String RESPONSE_LIMIT_PROPERTY
public static final String STORE_DATA_DIR_PROPERTY
public static final String STORE_NAME_PROPERTY
public static final String UPDATES_LISTENER_CLASS_PROPERTY
public static final String UPDATES_LISTENER_PROPERTIES
public static Collection<Point> makeNoticesFilter(Metadata metadata)
metadata
- The metadata.public void addNotice(@Nonnull PointValue notice) throws InterruptedException
notice
- A point value.InterruptedException
- When the service is stopped.public final void addNoticeListener(NoticeListener noticeListener)
noticeListener
- The notice listener.public boolean areNoticesFiltered()
Allows an implementation override.
@Nonnull @CheckReturnValue public Optional<Archiver> getArchiver()
public final int getBackEndLimit()
public final Optional<String> getEntityName()
getEntityName
in interface MetadataServiceApp
getEntityName
in class MetadataServiceAppImpl
public final Collection<Point> getNoticesFilter()
@Nonnull @CheckReturnValue public final Polator getPolator(@Nonnull Point point)
point
- The point.@Nonnull @CheckReturnValue public final Replicator getReplicator()
public int getResponseLimit()
public final String getServerName()
getServerName
in interface StoreServiceApp
@Nonnull @CheckReturnValue public KeyedGroups getServerProperties()
@Nonnull @CheckReturnValue public File getStoreDataDir()
public Optional<StoreEntity> getStoreEntity()
getStoreEntity
in interface StoreServiceApp
@Nonnull @CheckReturnValue public final StoreStats getStoreStats()
@CheckReturnValue public final boolean isNullRemoves()
@CheckReturnValue public final boolean isPullDisabled()
public boolean onNewMetadata(Metadata metadata)
Overidden as needed.
Called by the framework and by overriding classes at the end of the override.
onNewMetadata
in interface MetadataServiceApp
onNewMetadata
in class MetadataServiceAppImpl
metadata
- The new metadata.public boolean onSignal(Signal signal)
Caution: this is called while synchronized on the service.
onSignal
in interface ServiceApp
onSignal
in class ServiceAppImpl
signal
- The signal.public final void rebind(@Nonnull UUID oldUUID, @Nonnull UUID newUUID)
oldUUID
- The old UUID.newUUID
- The UUID.public final void removeNoticeListener(@Nonnull NoticeListener noticeListener)
noticeListener
- The notice listener.public void run() throws InterruptedException
Similar to same in Runnable but may throw exceptions.
run
in interface ServiceThread.Target
InterruptedException
public void sendNotices() throws InterruptedException
InterruptedException
- When the service is stopped.public boolean setUp(MetadataService service)
Overidden as needed.
Called by the framework and by overriding classes at the beginning of the override.
setUp
in interface MetadataServiceApp
setUp
in class MetadataServiceAppImpl
service
- The service holding this application.public void start()
Overidden as needed by the application.
Called by the framework.
Should return only when the application is started.
start
in interface ServiceApp
start
in class ServiceAppImpl
public void stop()
Overidden as needed by the application.
Called by the framework.
stop
in interface ServiceApp
stop
in class ServiceAppImpl
public void tearDown()
Overidden as needed by the application.
Called by the framework and by overriding classes at the end of the override.
tearDown
in interface ServiceApp
tearDown
in class ServiceAppImpl
protected void doPendingActions() throws InterruptedException, ServiceNotAvailableException
Caution: this is called while synchronized.
InterruptedException
- When the service is stopped.ServiceNotAvailableException
- When the service is not available.@Nonnull @CheckReturnValue protected String getDefaultStoreName()
@CheckReturnValue protected boolean refreshMetadata() throws InterruptedException, ServiceNotAvailableException
InterruptedException
- When the service is stopped.ServiceNotAvailableException
- When the service is not available.protected final void refreshNoticesFilter()
@CheckReturnValue protected final boolean registerServer(@Nonnull StoreServer server)
server
- The server.@CheckReturnValue protected final boolean registerServer(@Nonnull Optional<String> serverPath, @Nonnull StoreServer server)
serverPath
- The optional server path.server
- The server.@CheckReturnValue protected boolean setUp()
@CheckReturnValue protected final boolean setUp(String serverPropertiesName)
serverPropertiesName
- The server properties name.@CheckReturnValue protected final boolean setUpArchiver()
@CheckReturnValue protected final boolean setUpNotifier()
@Nullable @CheckReturnValue protected StoreMetadataFilter storeMetadataFilter(String storeName, Collection<String> partnerNames)
storeName
- The store's name.partnerNames
- The name of the store partners (optional).protected final void unregisterServer()
Copyright © 2003-2019 Serge Brisson. All Rights Reserved.