PageRenderTime 42ms CodeModel.GetById 20ms app.highlight 1ms RepoModel.GetById 19ms app.codeStats 0ms

/src/main/java/com/google/ie/business/service/IdeaCategoryService.java

http://thoughtsite.googlecode.com/
Java | 58 lines | 8 code | 7 blank | 43 comment | 0 complexity | 16200b74d800b6b73df6a03dcf532eec MD5 | raw file
 1/* Copyright 2010 Google Inc.
 2 * 
 3 * Licensed under the Apache License, Version 2.0 (the "License");
 4 * you may not use this file except in compliance with the License.
 5 * You may obtain a copy of the License at
 6 * 
 7 *      http://www.apache.org/licenses/LICENSE-2.0
 8 * 
 9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS.
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License
14 */
15
16package com.google.ie.business.service;
17
18import com.google.ie.business.domain.IdeaCategory;
19
20import java.util.List;
21
22/**
23 * A service specification for the {@link IdeaCategory} entity
24 * 
25 * @author Sachneet
26 * 
27 */
28public interface IdeaCategoryService {
29    /**
30     * Saves a new category into the datastore
31     * 
32     * @param category the {@link IdeaCategory} object to be saved
33     * @return the {@link IdeaCategory} object saved to the datastore
34     */
35    IdeaCategory addIdeaCategory(IdeaCategory category);
36
37    /**
38     * 
39     * Returns a List of all {@link IdeaCategory} objects.First checks the cache
40     * for the data and if not available with cache, gets the data from the
41     * datastore.
42     * 
43     * @return a list of all {@link IdeaCategory} objects.
44     */
45    List<IdeaCategory> getAllIdeaCategories();
46
47    /**
48     * Fetches the category with name equal to categoryName param.
49     * First checks the cache.If the category is not available in cache then
50     * checks in the datastore.
51     * 
52     * @param categoryName Name of category.
53     * @return the {@link IdeaCategory} object that has the category name equal
54     *         to categoryName param.If no such object exists then null.
55     */
56    IdeaCategory getCategoryByName(String categoryName);
57}
58