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

http://thoughtsite.googlecode.com/ · Java · 136 lines · 21 code · 17 blank · 98 comment · 0 complexity · f42eec41058f943ac897faddb8aff594 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.AdminRequest;
  17. import com.google.ie.business.domain.Idea;
  18. import com.google.ie.business.domain.IdeaComment;
  19. import com.google.ie.business.domain.Project;
  20. import com.google.ie.business.domain.User;
  21. import com.google.ie.dto.RetrievalInfo;
  22. import java.util.List;
  23. /**
  24. * A service specification for the Admin entity.
  25. *
  26. * @author Surabhi
  27. *
  28. */
  29. public interface AdminService {
  30. /**
  31. * Soft deletion of an idea into data store. <br>
  32. * Changing the status of idea to 'Deleted' from 'Published'
  33. *
  34. * @param ideaKey key of the idea to be deleted
  35. * @param user admin {@link User} object
  36. * @param adminReason reason for deletion
  37. */
  38. void deleteIdea(String ideaKey, User user, String adminReason);
  39. /**
  40. * Soft deletion of an project into data store. <br>
  41. * Changing the status of project to 'Deleted'.
  42. *
  43. * @param projectKey key of the project to be deleted
  44. * @param user admin {@link User} object
  45. * @param adminReason reason for deletion
  46. */
  47. void deleteProject(String projectKey, User user, String adminReason);
  48. /**
  49. * Approve all requests provided in the list.
  50. *
  51. * @param requestObjectList The list of {@link AdminRequest} object
  52. * @param user The {@link User} object
  53. */
  54. void approveRequests(List<AdminRequest> requestObjectList, User user);
  55. /**
  56. * Deny all admin request provided in the list
  57. *
  58. * @param requestObjectList The list of {@link AdminRequest} object
  59. * @param user The {@link User} object
  60. */
  61. void denyRequests(List<AdminRequest> requestObjectList, User user);
  62. /**
  63. * Get admin requests based on the given type.
  64. *
  65. * @param retrievalInfo The {@link RetrievalInfo } object
  66. * @param requestType Type of request Objectionable,Duplicate or ALL
  67. *
  68. * @return List containing the {@link AdminRequest} entities
  69. */
  70. List<AdminRequest> getAdminRequests(RetrievalInfo retrievalInfo, String requestType);
  71. /**
  72. * Approve a request to administer.
  73. *
  74. * @param adminRequest The {@link AdminRequest} object
  75. * @param user The {@link User} object
  76. */
  77. void approveAdminRequest(AdminRequest adminRequest, User user);
  78. /**
  79. * Deny admin request provided in the list
  80. *
  81. * @param adminRequest he {@link AdminRequest} object
  82. * @param user The {@link User} object
  83. */
  84. void denyAdminRequest(AdminRequest adminRequest, User user);
  85. /**
  86. * Ban user from accessing the site.
  87. *
  88. * @param user The {@link User} to be banned
  89. * @param adminUserkey The key of the admin user
  90. * @param adminReason The reason for deletion
  91. */
  92. User blacklistUser(User user, String adminUserkey, String adminReason);
  93. /**
  94. * Activate the user for accessing the site
  95. *
  96. * @param user The {@link User} to activate for the site.
  97. * @param userKey The key for admin user who is activating the user.
  98. * @param string The reason to activate.
  99. *
  100. * @return the activated {@link User}
  101. */
  102. User activateUser(User user, String adminUserkey, String adminReason);
  103. /**
  104. * Retrieves {@link Idea} having the comment with the given key.
  105. *
  106. * @param key Key of the {@link IdeaComment}.
  107. * @return an object of the {@link Idea} which is having comment with the
  108. * given key.
  109. */
  110. Idea getIdeaByCommentKey(String key);
  111. /**
  112. * Retrieves {@link Project} having the comment with the given key.
  113. *
  114. * @param commentKey Key of the project comment.
  115. * @return An object of the {@link Project} which is having comment with the
  116. * given key.
  117. */
  118. Project getProjectByCommentKey(String commentKey);
  119. }