2 * Copyright 2010 Electronic Business Systems Ltd.
4 * This file is part of GSS.
6 * GSS is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * GSS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GSS. If not, see <http://www.gnu.org/licenses/>.
19 package gr.ebs.gss.server.ejb;
21 import gr.ebs.gss.client.exceptions.InsufficientPermissionsException;
22 import gr.ebs.gss.client.exceptions.ObjectNotFoundException;
23 import gr.ebs.gss.server.domain.dto.FileBodyDTO;
24 import gr.ebs.gss.server.domain.dto.FileHeaderDTO;
25 import gr.ebs.gss.server.domain.dto.PermissionDTO;
26 import gr.ebs.gss.server.domain.dto.StatsDTO;
27 import gr.ebs.gss.server.domain.dto.SystemStatsDTO;
28 import gr.ebs.gss.server.domain.dto.UserClassDTO;
29 import gr.ebs.gss.server.domain.dto.UserDTO;
31 import java.util.Date;
32 import java.util.List;
35 import javax.ejb.Local;
43 public interface AdminAPI {
45 public List<UserDTO> searchUsers(String query) throws ObjectNotFoundException;
47 public StatsDTO getUserStatistics(Long userId) throws ObjectNotFoundException;
49 public UserDTO getUser(Long userId) throws ObjectNotFoundException;
51 public void toggleActiveUser(Long userId) throws ObjectNotFoundException;
53 public FileHeaderDTO getFile(String uri) throws ObjectNotFoundException;
55 public void setFilePermissions(String uri, Set<PermissionDTO> permissions) throws ObjectNotFoundException;
57 public SystemStatsDTO getSystemStatistics();
59 public List<UserDTO> getLastLoggedInUsers(Date lastLoginDate);
61 List<FileBodyDTO> getVersions(Long userId, Long fileId) throws ObjectNotFoundException, InsufficientPermissionsException;
63 UserDTO getUser(String username) throws ObjectNotFoundException;
65 FileHeaderDTO getFile(Long fileId) throws ObjectNotFoundException;
67 List<FileHeaderDTO> getFiles(String uri) throws ObjectNotFoundException, InsufficientPermissionsException;
69 List<UserDTO> getUsersWaitingActivation();
71 void changeUserClass(Long userId, Long userClassId) throws ObjectNotFoundException;
73 List<UserClassDTO> getUserClasses();
75 void saveOrUpdateUserClass(UserClassDTO dto) throws ObjectNotFoundException;
77 void removeUserClass(UserClassDTO dto) throws ObjectNotFoundException;
79 public List<FileHeaderDTO> searchFileByFilename(String fileName);
81 public void removeUser(Long userId) throws ObjectNotFoundException, InsufficientPermissionsException;