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 AbstractEventDataProvidergetEventDataProvider(StatisticContext context)Build aAbstractEventDataProviderto provide data for analysisjava.lang.StringgetName()abstract java.time.InstantgetOlderAnalyticsDataDate()Retrieve the older date from the analytics fileabstract voidinit(java.lang.String propertyPrefix, JProperties subProperties)Init aEventDatastorageabstract booleanisAnalysisProvider()indicate if theAbstractStorageHandleris the eventData provider for analysis or not.booleanisEnabled()voidsetEnabled(boolean enabled)voidsetName(java.lang.String name)voidshutdown()shutdown aAbstractEventDataProviderinstanceabstract voidwriteEvent(EventData data)Write aEventDatain the storage
-
-
-
Method Detail
-
init
public abstract void init(java.lang.String propertyPrefix, JProperties subProperties)Init aEventDatastorage- Parameters:
propertyPrefix- used to configure the handlersubProperties- theJPropertieswith the handler's properties
-
writeEvent
public abstract void writeEvent(EventData data) throws StorageException
Write aEventDatain the storage- Parameters:
data- theEventDatato 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 theAbstractStorageHandleris the eventData provider for analysis or not. Note only oneAbstractStorageHandlershould be enabled for analysis at runtime- Returns:
- true if the
AbstractStorageHandleris enabled for provided analysis data, false otherwise
-
getEventDataProvider
public abstract AbstractEventDataProvider getEventDataProvider(StatisticContext context) throws StorageException
Build aAbstractEventDataProviderto provide data for analysis- Parameters:
context- theStatisticContextused to create theEventDataprovider- Returns:
- the
AbstractEventDataProvider - Throws:
StorageException- if theEventDatacannot be created
-
shutdown
public void shutdown()
shutdown aAbstractEventDataProviderinstance
-
isEnabled
public boolean isEnabled()
-
setEnabled
public void setEnabled(boolean enabled)
-
getName
public java.lang.String getName()
-
setName
public void setName(java.lang.String name)
-
-