PageRenderTime 304ms CodeModel.GetById 121ms app.highlight 3ms RepoModel.GetById 98ms app.codeStats 0ms

/src/main/java/com/google/ie/business/dao/TagDao.java

http://thoughtsite.googlecode.com/
Java | 81 lines | 13 code | 11 blank | 57 comment | 0 complexity | 393acb11c741a03cabfd1671f69bc2ca 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.dao;
17
18import com.google.ie.business.domain.Tag;
19import com.google.ie.dto.RetrievalInfo;
20
21import java.util.Collection;
22import java.util.List;
23
24/**
25 * A data access object specification for Tag entity.
26 * 
27 * @author Sachneet
28 */
29public interface TagDao extends BaseDao {
30    /**
31     * Saves the tag associated with given idea into the data store.
32     * 
33     * @param tag Tag to be saved.
34     * @return Saved tag object or null if save operation failed.
35     */
36    Tag saveTag(Tag tag);
37
38    /**
39     * Retrieves all the tag objects from the data store.
40     * 
41     * @return list of {@link Tag} objects retrieved from the datastore
42     */
43    List<Tag> getAllTags();
44
45    /**
46     * Retrieves the tag object from data store by title.
47     * 
48     * @param title Title of the tag.
49     * @return Returns the tag object.
50     */
51    Tag getTagByTitle(String title);
52
53    /**
54     * Retrieves all the tag objects from the data store corresponding to the
55     * keys supplied.
56     * 
57     * @param keys collection having Tag's keys.
58     * @return Returns the list of Tags corresponding to the keys.
59     */
60    List<Tag> getTagsByKeys(Collection<String> keys);
61
62    /**
63     * Retrieves the tags starting with a specific string from the datastore.
64     * 
65     * @param retrievalInfo the {@link RetrievalInfo} object containing the
66     *        query parameters
67     * @return list of fetched tags
68     */
69    List<Tag> getTagsWithSpecificStartString(String startString, RetrievalInfo retrievalInfo);
70
71    /**
72     * Retrieves the tags for the tag cloud.The tags are sorted alphabetically.
73     * 
74     * @param retrievalInfo the {@link RetrievalInfo} object containing the
75     *        query parameters
76     * @return list of fetched tags.
77     */
78    List<Tag> getTagsForTagCloud(RetrievalInfo retrievalInfo);
79
80}
81