| // Copyright 2012 Citrix Systems, Inc. Licensed under the |
| // Apache License, Version 2.0 (the "License"); you may not use this |
| // file except in compliance with the License. Citrix Systems, Inc. |
| // reserves all rights not expressly granted by the License. |
| // You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| // |
| // Automatically generated by addcopyright.py at 04/03/2012 |
| package com.cloud.projects; |
| |
| import java.util.List; |
| |
| import com.cloud.exception.ConcurrentOperationException; |
| import com.cloud.exception.ResourceAllocationException; |
| import com.cloud.exception.ResourceUnavailableException; |
| import com.cloud.projects.ProjectAccount.Role; |
| import com.cloud.user.Account; |
| |
| public interface ProjectService { |
| /** |
| * Creates a new project |
| * |
| * @param name |
| * - project name |
| * @param displayText |
| * - project display text |
| * @param accountName |
| * - account name of the project owner |
| * @param domainId |
| * - domainid of the project owner |
| * @return the project if created successfully, null otherwise |
| * @throws ResourceAllocationException |
| */ |
| Project createProject(String name, String displayText, String accountName, Long domainId) throws ResourceAllocationException; |
| |
| /** |
| * Deletes a project |
| * |
| * @param id |
| * - project id |
| * @return true if the project was deleted successfully, false otherwise |
| */ |
| boolean deleteProject(long id); |
| |
| /** |
| * Gets a project by id |
| * |
| * @param id |
| * - project id |
| * @return project object |
| */ |
| Project getProject(long id); |
| |
| List<? extends Project> listProjects(Long id, String name, String displayText, String state, String accountName, Long domainId, String keyword, Long startIndex, Long pageSize, boolean listAll, boolean isRecursive); |
| |
| ProjectAccount assignAccountToProject(Project project, long accountId, Role accountRole); |
| |
| Account getProjectOwner(long projectId); |
| |
| boolean unassignAccountFromProject(long projectId, long accountId); |
| |
| Project findByProjectAccountId(long projectAccountId); |
| |
| Project findByNameAndDomainId(String name, long domainId); |
| |
| Project updateProject(long id, String displayText, String newOwnerName) throws ResourceAllocationException; |
| |
| boolean addAccountToProject(long projectId, String accountName, String email); |
| |
| boolean deleteAccountFromProject(long projectId, String accountName); |
| |
| List<? extends ProjectAccount> listProjectAccounts(long projectId, String accountName, String role, Long startIndex, Long pageSizeVal); |
| |
| List<? extends ProjectInvitation> listProjectInvitations(Long id, Long projectId, String accountName, Long domainId, String state, boolean activeOnly, Long startIndex, Long pageSizeVal, boolean isRecursive, |
| boolean listAll); |
| |
| boolean updateInvitation(long projectId, String accountName, String token, boolean accept); |
| |
| Project activateProject(long projectId); |
| |
| Project suspendProject(long projectId) throws ConcurrentOperationException, ResourceUnavailableException; |
| |
| Project enableProject(long projectId); |
| |
| boolean deleteProjectInvitation(long invitationId); |
| } |