001/* 002 * Copyright 2013 Anyware Services 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.ametys.web.cache.monitoring.process.statistics; 018 019import java.util.List; 020 021import org.apache.ibatis.session.SqlSession; 022 023/** 024 * A factory of a resource statistic 025 */ 026public interface ResourceStatisticsFactory 027{ 028 /** 029 * Get the list of existing resource access 030 * @param sqlSession The sql session 031 * @return The non null list 032 */ 033 public List<ResourceStatistics> getResourceAccessToProcess(SqlSession sqlSession); 034 035 /** 036 * Mark the statistics of this kind as processed 037 * @param sqlSession The sql session 038 * @return The number of resources processed 039 */ 040 public int markResourcesAsProcessed(SqlSession sqlSession); 041 042 /** 043 * Purge the processed raw data related to this kind of statistics. 044 * @param sqlSession The sql session 045 * @return The number of purged rows. 046 */ 047 public int purgeRawData(SqlSession sqlSession); 048}