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