PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

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