/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. package com.google.ie.business.service;
  16. import com.google.ie.business.domain.IdeaCategory;
  17. import java.util.List;
  18. /**
  19. * A service specification for the {@link IdeaCategory} entity
  20. *
  21. * @author Sachneet
  22. *
  23. */
  24. public interface IdeaCategoryService {
  25. /**
  26. * Saves a new category into the datastore
  27. *
  28. * @param category the {@link IdeaCategory} object to be saved
  29. * @return the {@link IdeaCategory} object saved to the datastore
  30. */
  31. IdeaCategory addIdeaCategory(IdeaCategory category);
  32. /**
  33. *
  34. * Returns a List of all {@link IdeaCategory} objects.First checks the cache
  35. * for the data and if not available with cache, gets the data from the
  36. * datastore.
  37. *
  38. * @return a list of all {@link IdeaCategory} objects.
  39. */
  40. List<IdeaCategory> getAllIdeaCategories();
  41. /**
  42. * Fetches the category with name equal to categoryName param.
  43. * First checks the cache.If the category is not available in cache then
  44. * checks in the datastore.
  45. *
  46. * @param categoryName Name of category.
  47. * @return the {@link IdeaCategory} object that has the category name equal
  48. * to categoryName param.If no such object exists then null.
  49. */
  50. IdeaCategory getCategoryByName(String categoryName);
  51. }