PageRenderTime 404ms CodeModel.GetById 181ms app.highlight 3ms RepoModel.GetById 218ms app.codeStats 0ms

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

http://thoughtsite.googlecode.com/
Java | 123 lines | 20 code | 15 blank | 88 comment | 0 complexity | 4a0b2891cd703786333c74be685381ac 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.appengine.api.datastore.Blob;
 19import com.google.ie.business.domain.Idea;
 20import com.google.ie.business.domain.Project;
 21import com.google.ie.business.domain.User;
 22import com.google.ie.dto.RetrievalInfo;
 23
 24import java.util.List;
 25import java.util.Set;
 26
 27/**
 28 * A service specification for the Project entity
 29 * 
 30 * @author Charanjeet singh
 31 */
 32public interface ProjectService {
 33
 34    /**
 35     * Creates and saves {@link Project} into data store.<br>
 36     * It creates a project from a published idea, when user submits details of
 37     * project.
 38     * 
 39     * @param project The {@link Project} entity.
 40     * @param user The creator of project.
 41     * @return The created {@link Project}.
 42     */
 43    Project createOrUpdateProject(Project project, User user);
 44
 45    /**
 46     * Returns {@link Project} on the basis for project key.
 47     * 
 48     * @param key key id of project entity.
 49     * @return {@link Project} with full details.
 50     */
 51    Project getProjectById(String key);
 52
 53    /**
 54     * Retrieves the list of projects by set of project keys.
 55     * 
 56     * @param projectKeys Set of project keys.
 57     * @param retrievalInfo request parameters encapsulated in
 58     *        {@link RetrievalInfo}.
 59     * @return List of {@link Project} entities.
 60     */
 61    List<Project> getProjects(Set<String> projectKeys, RetrievalInfo retrievalInfo);
 62
 63    /**
 64     * This method return Image on the basis for key.
 65     * 
 66     * @param key key id project entity.
 67     * @return object holding the bytes of image.
 68     */
 69    Blob getImageById(String key);
 70
 71    /**
 72     * Returns the paginated list of projects, sorted by their updation date.
 73     * 
 74     * @param retrievalInfo RetrievalInfo object representing the auxiliary
 75     *        request information to be passed.
 76     * @return list of projects.
 77     */
 78    List<Project> listProjects(RetrievalInfo retrievalInfo);
 79
 80    /**
 81     * Return the paginated list of projects created or joined by user,
 82     * sorted on their creation date.
 83     * 
 84     * @param user The {@link User} object.
 85     * @param retrievalInfo {@link RetrievalInfo} object representing the
 86     *        auxiliary information to be passed.
 87     * @return list of {@link Projects} created or joined by user.
 88     */
 89    List<Project> listProjects(User user, RetrievalInfo retrievalInfo);
 90
 91    /**
 92     * Returns the details of project.
 93     * 
 94     * @param project Project for which details are being fetched.
 95     * @return project details populated in {@link Project} object.
 96     */
 97    Project getDetails(Project project);
 98
 99    /**
100     * Retrieves the {@link Project} associated with an {@link Idea}.
101     * 
102     * @param key {@link Idea} key.
103     * @return List of {@link Projects}.
104     */
105    List<Project> getProjectsByIdeaKey(String ideaKey);
106
107    /**
108     * Retrieves the most recent projects.
109     * 
110     * @return list containing most recent {@link Project} objects
111     */
112    List<Project> getRecentProjects();
113
114    /**
115     * Update project in data store.
116     * 
117     * @param project {@link Project} to be updated in to data store.
118     * 
119     * @return the updated project.
120     */
121    Project updateProject(Project project);
122}
123