Class FileSystemStorage
- java.lang.Object
-
- com.jalios.jcms.analytics.storage.AbstractStorageHandler
-
- com.jalios.jcms.analytics.storage.impl.FileSystemStorage
-
public class FileSystemStorage extends AbstractStorageHandler
-
-
Constructor Summary
Constructors Constructor Description FileSystemStorage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractEventDataProvider
getEventDataProvider(StatisticContext context)
Build anAbstractEventDataProvider
to provide data for analysisjava.io.File
getEventDirectory()
Retrieve event data directoryjava.time.Instant
getOlderAnalyticsDataDate()
Retrieve the older date from the analytics filevoid
init(java.lang.String propertyPrefix, JProperties subProperties)
Create aEventData
storage (in a directory of the current file system)boolean
isAnalysisProvider()
indicate if theAbstractStorageHandler
is the eventData provider for analysis or not.void
writeEvent(EventData data)
Write anEventData
in the file-
Methods inherited from class com.jalios.jcms.analytics.storage.AbstractStorageHandler
getName, isEnabled, setEnabled, setName
-
-
-
-
Method Detail
-
init
public void init(java.lang.String propertyPrefix, JProperties subProperties)
Create aEventData
storage (in a directory of the current file system)- Specified by:
init
in classAbstractStorageHandler
- Parameters:
propertyPrefix
- used to configure the handlersubProperties
- theMap
with the handler's properties
-
writeEvent
public void writeEvent(EventData data) throws StorageException
Write anEventData
in the file- Specified by:
writeEvent
in classAbstractStorageHandler
- Parameters:
data
- theEventData
- Throws:
StorageException
- Exception thrown when eventData is save as JSON data
-
getOlderAnalyticsDataDate
public java.time.Instant getOlderAnalyticsDataDate()
Retrieve the older date from the analytics file- Specified by:
getOlderAnalyticsDataDate
in classAbstractStorageHandler
- Returns:
- the older date if any, Long.MAX_VALUE otherwise
-
isAnalysisProvider
public boolean isAnalysisProvider()
Description copied from class:AbstractStorageHandler
indicate if theAbstractStorageHandler
is the eventData provider for analysis or not. Note only oneAbstractStorageHandler
should be enabled for analysis at runtime- Specified by:
isAnalysisProvider
in classAbstractStorageHandler
- Returns:
- true if the
AbstractStorageHandler
is enabled for provided analysis data, false otherwise
-
getEventDataProvider
public AbstractEventDataProvider getEventDataProvider(StatisticContext context) throws StorageException
Description copied from class:AbstractStorageHandler
Build anAbstractEventDataProvider
to provide data for analysis- Specified by:
getEventDataProvider
in classAbstractStorageHandler
- Parameters:
context
- theStatisticContext
used to create theEventData
provider- Returns:
- the
AbstractEventDataProvider
- Throws:
StorageException
- if theEventData
cannot be created
-
getEventDirectory
public java.io.File getEventDirectory()
Retrieve event data directory- Returns:
- the File
-
-