Class AbstractStorageHandler
- java.lang.Object
-
- com.jalios.jcms.analytics.storage.AbstractStorageHandler
-
- Direct Known Subclasses:
FileSystemStorage
public abstract class AbstractStorageHandler extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description AbstractStorageHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract AbstractEventDataProvider
getEventDataProvider(StatisticContext context)
Build aAbstractEventDataProvider
to provide data for analysisjava.lang.String
getName()
abstract java.time.Instant
getOlderAnalyticsDataDate()
Retrieve the older date from the analytics fileabstract void
init(java.lang.String propertyPrefix, JProperties subProperties)
Init aEventData
storageabstract boolean
isAnalysisProvider()
indicate if theAbstractStorageHandler
is the eventData provider for analysis or not.boolean
isEnabled()
void
setEnabled(boolean enabled)
void
setName(java.lang.String name)
void
shutdown()
shutdown aAbstractEventDataProvider
instanceabstract void
writeEvent(EventData data)
Write aEventData
in the storage
-
-
-
Method Detail
-
init
public abstract void init(java.lang.String propertyPrefix, JProperties subProperties)
Init aEventData
storage- Parameters:
propertyPrefix
- used to configure the handlersubProperties
- theJProperties
with the handler's properties
-
writeEvent
public abstract void writeEvent(EventData data) throws StorageException
Write aEventData
in the storage- Parameters:
data
- theEventData
to write- Throws:
StorageException
- exception throw by the storage subsystem
-
getOlderAnalyticsDataDate
public abstract java.time.Instant getOlderAnalyticsDataDate()
Retrieve the older date from the analytics file- Returns:
- the older date if any, null otherwise
-
isAnalysisProvider
public abstract boolean isAnalysisProvider()
indicate if theAbstractStorageHandler
is the eventData provider for analysis or not. Note only oneAbstractStorageHandler
should be enabled for analysis at runtime- Returns:
- true if the
AbstractStorageHandler
is enabled for provided analysis data, false otherwise
-
getEventDataProvider
public abstract AbstractEventDataProvider getEventDataProvider(StatisticContext context) throws StorageException
Build aAbstractEventDataProvider
to provide data for analysis- Parameters:
context
- theStatisticContext
used to create theEventData
provider- Returns:
- the
AbstractEventDataProvider
- Throws:
StorageException
- if theEventData
cannot be created
-
shutdown
public void shutdown()
shutdown aAbstractEventDataProvider
instance
-
isEnabled
public boolean isEnabled()
-
setEnabled
public void setEnabled(boolean enabled)
-
getName
public java.lang.String getName()
-
setName
public void setName(java.lang.String name)
-
-