001 /**
002 * Copyright 2004-2012 The Kuali Foundation
003 *
004 * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
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 package org.kuali.hr.time.task.service;
017
018
019 import org.kuali.hr.time.task.Task;
020 import org.springframework.cache.annotation.CacheEvict;
021 import org.springframework.cache.annotation.Cacheable;
022
023 import java.sql.Date;
024 import java.util.List;
025
026 public interface TaskService {
027 /**
028 * Fetch Task of a particular date
029 * @param task
030 * @param asOfDate
031 * @return
032 */
033 @Cacheable(value= Task.CACHE_NAME, key="'task=' + #p0 + '|' + 'asOfDate=' + #p1")
034 public Task getTask(Long task, Date asOfDate);
035 /**
036 * Save a given Task
037 * @param task
038 */
039 @CacheEvict(value={Task.CACHE_NAME}, allEntries = true)
040 public void saveTask(Task task);
041 /**
042 * Save a List of Tasks
043 * @param tasks
044 */
045 @CacheEvict(value={Task.CACHE_NAME}, allEntries = true)
046 public void saveTasks(List<Task> tasks);
047
048 public Task getMaxTask();
049
050 List<Task> getTasks(String task, String description, String workArea, String workAreaDesc, Date fromEffdt, Date toEffdt);
051
052 /**
053 * get the count of Tasks by given task
054 * @param task
055 * @return int
056 */
057 public int getTaskCount(Long task);
058 }