Class FileSystemStorage
java.lang.Object
com.jalios.jcms.analytics.storage.AbstractStorageHandler
com.jalios.jcms.analytics.storage.impl.FileSystemStorage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcompress(int beforeDays) getEventDataProvider(StatisticContext context) Build aAbstractEventDataProviderto provide data for analysisRetrieve event data directoryFile[]getFiles()Retrieve the older date from the analytics filevoidinit(String propertyPrefix, JProperties subProperties) Create aEventDatastorage (in a directory of the current file system)booleanindicate if theAbstractStorageHandleris the eventData provider for analysis or not.voidvoidshutdown()shutdown aAbstractEventDataProviderinstancevoidwriteEvent(EventData data) Write anEventDatain the fileMethods inherited from class com.jalios.jcms.analytics.storage.AbstractStorageHandler
getName, isEnabled, setEnabled, setName
-
Constructor Details
-
FileSystemStorage
public FileSystemStorage()
-
-
Method Details
-
init
Create aEventDatastorage (in a directory of the current file system)- Specified by:
initin classAbstractStorageHandler- Parameters:
propertyPrefix- used to configure the handlersubProperties- theMapwith the handler's properties
-
shutdown
public void shutdown()Description copied from class:AbstractStorageHandlershutdown aAbstractEventDataProviderinstance- Overrides:
shutdownin classAbstractStorageHandler
-
writeEvent
Write anEventDatain the file- Specified by:
writeEventin classAbstractStorageHandler- Parameters:
data- theEventData- Throws:
StorageException- Exception thrown when eventData is save as JSON data
-
getOlderAnalyticsDataDate
Retrieve the older date from the analytics file- Specified by:
getOlderAnalyticsDataDatein classAbstractStorageHandler- Returns:
- the older date if any, Long.MAX_VALUE otherwise
-
isAnalysisProvider
public boolean isAnalysisProvider()Description copied from class:AbstractStorageHandlerindicate if theAbstractStorageHandleris the eventData provider for analysis or not. Note only oneAbstractStorageHandlershould be enabled for analysis at runtime- Specified by:
isAnalysisProviderin classAbstractStorageHandler- Returns:
- true if the
AbstractStorageHandleris enabled for provided analysis data, false otherwise
-
getEventDataProvider
public AbstractEventDataProvider getEventDataProvider(StatisticContext context) throws StorageException Description copied from class:AbstractStorageHandlerBuild aAbstractEventDataProviderto provide data for analysis- Specified by:
getEventDataProviderin classAbstractStorageHandler- Parameters:
context- theStatisticContextused to create theEventDataprovider- Returns:
- the
AbstractEventDataProvider - Throws:
StorageException- if theEventDatacannot be created
-
getEventDirectory
Retrieve event data directory- Returns:
- the File
-
purge
- Overrides:
purgein classAbstractStorageHandler
-
compress
public void compress(int beforeDays) - Overrides:
compressin classAbstractStorageHandler
-
getFiles
-