View Javadoc
1   package net.sumaris.core.service.administration;
2   
3   /*-
4    * #%L
5    * SUMARiS:: Core
6    * %%
7    * Copyright (C) 2018 SUMARiS Consortium
8    * %%
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU General Public License as
11   * published by the Free Software Foundation, either version 3 of the
12   * License, or (at your option) any later version.
13   * 
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Public License for more details.
18   * 
19   * You should have received a copy of the GNU General Public
20   * License along with this program.  If not, see
21   * <http://www.gnu.org/licenses/gpl-3.0.html>.
22   * #L%
23   */
24  
25  
26  import net.sumaris.core.dao.technical.SortDirection;
27  import net.sumaris.core.model.referential.UserProfile;
28  import net.sumaris.core.model.referential.UserProfileEnum;
29  import net.sumaris.core.vo.administration.user.PersonVO;
30  import net.sumaris.core.vo.data.ImageAttachmentVO;
31  import net.sumaris.core.vo.filter.PersonFilterVO;
32  import net.sumaris.core.vo.referential.ReferentialVO;
33  import org.springframework.transaction.annotation.Isolation;
34  import org.springframework.transaction.annotation.Transactional;
35  
36  import java.util.List;
37  
38  /**
39   * @author BLA
40   * 
41   *    Service in charge of importing csv file into DB
42   * 
43   */
44  @Transactional(isolation = Isolation.READ_COMMITTED)
45  public interface PersonService {
46  
47  	@Transactional(readOnly = true)
48  	List<PersonVO> findByFilter(PersonFilterVO filter, int offset, int size, String sortAttribute, SortDirection sortDirection);
49  
50  	@Transactional(readOnly = true)
51  	Long countByFilter(PersonFilterVO filter);
52  
53  	@Transactional(readOnly = true)
54  	PersonVO get(int userId);
55  
56  	@Transactional(readOnly = true)
57  	PersonVO getByPubkey(String pubkey);
58  
59  	@Transactional(readOnly = true)
60  	boolean isExistsByEmailHash(String hash);
61  
62  	@Transactional(readOnly = true)
63  	ImageAttachmentVO getAvatarByPubkey(String pubkey);
64  
65  	@Transactional(readOnly = true)
66  	List<String> getEmailsByProfiles(UserProfileEnum... userProfiles);
67  
68  	List<PersonVO> save(List<PersonVO> persons);
69  
70  	PersonVO save(PersonVO person);
71  
72  	void delete(int id);
73  
74  	void delete(List<Integer> ids);
75  }