Class ResourceAccessComponent
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.datasource.AbstractMyBatisDAO
-
- org.ametys.web.cache.monitoring.process.access.ResourceAccessComponent
-
- All Implemented Interfaces:
LogEnabled
,PluginAware
,Component
,Configurable
,Contextualizable
,Serviceable
public class ResourceAccessComponent extends AbstractMyBatisDAO
The RessourceAccessMonitor collects the resources that have been requested, and export them into a database.
-
-
Field Summary
Fields Modifier and Type Field Description protected ListMultimap<String,ResourceAccess>
_pendingRecords
List of pendingResourceAccess
waiting to be exported to the database.static String
ROLE
Avalon ROLE.-
Fields inherited from class org.ametys.core.datasource.AbstractMyBatisDAO
_manager
-
-
Constructor Summary
Constructors Constructor Description ResourceAccessComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private int
_fillDatabase(ListMultimap<String,ResourceAccess> resourcesAccess)
private int
_fillDatabase(org.apache.ibatis.session.SqlSession sqlSession, List<ResourceAccess> resourcesAccess)
void
addAccessRecord(ResourceAccess ra)
Add a newResourceAccess
to the monitored resources.void
exportPendings()
Call this method to transfer pendings resource access from memory to database This is normally called by a scheduler-
Methods inherited from class org.ametys.core.datasource.AbstractMyBatisDAO
_configureDatasource, _getDataSourceId, _getMyBatisConfiguration, configure, contextualize, getSession, getSession, reload, service, setPluginInfo
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_pendingRecords
protected ListMultimap<String,ResourceAccess> _pendingRecords
List of pendingResourceAccess
waiting to be exported to the database.
-
-
Constructor Detail
-
ResourceAccessComponent
public ResourceAccessComponent()
-
-
Method Detail
-
addAccessRecord
public void addAccessRecord(ResourceAccess ra)
Add a newResourceAccess
to the monitored resources.- Parameters:
ra
- The resource access object.
-
exportPendings
public void exportPendings()
Call this method to transfer pendings resource access from memory to database This is normally called by a scheduler
-
_fillDatabase
private int _fillDatabase(ListMultimap<String,ResourceAccess> resourcesAccess)
-
_fillDatabase
private int _fillDatabase(org.apache.ibatis.session.SqlSession sqlSession, List<ResourceAccess> resourcesAccess)
-
-