Project

General

Profile

Download (2.95 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2019 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.cdm.service;
10

    
11
import java.util.List;
12
import java.util.UUID;
13

    
14
import org.springframework.transaction.annotation.Transactional;
15

    
16
import eu.etaxonomy.cdm.api.service.dto.RegistrationWorkingSet;
17
import eu.etaxonomy.cdm.api.service.exception.RegistrationValidationException;
18
import eu.etaxonomy.cdm.model.name.Registration;
19
import eu.etaxonomy.cdm.model.name.TaxonName;
20

    
21
/**
22
 * @author a.kohlbecker
23
 * @since Mar 26, 2019
24
 *
25
 */
26
public interface IRegistrationWorkflowService {
27

    
28
    /**
29
     * @param taxonName
30
     * @param relatedBlockingRegistrations
31
     *  The blocking registrations to be added to the new Registration
32
     */
33
    @Transactional
34
    Registration createRegistration(TaxonName taxonName, List<Registration> relatedBlockingRegistrations);
35

    
36
    @Transactional
37
    boolean createRegistrationforExistingName(RegistrationWorkingSet workingset, TaxonName typifiedName) throws RegistrationValidationException;
38

    
39
    @Transactional(readOnly=true)
40
    Registration reloadRegistration(Registration registration);
41

    
42
    /**
43
     * Creates a new registration for the name referenced by the {@code taxonNameUUID} parameter
44
     * if there isn't one already. This is done in preparation for adding this new registration as blocking registration to another registration.
45
     * A new Registration will be returned, otherwise the return value is <code>null</code>.
46
     *
47
     * Already existing registrations must not be duplicated.
48
     *
49
     * @param taxonNameUUID
50
     *
51
     * @return Returns the newly prepared blocking Registration or <code>null</code> if a new registration has not been created.
52
     */
53
    @Transactional
54
    Registration prepareBlockingRegistration(UUID nameUUID);
55

    
56
    /**
57
     * Creates a new registration for the name referenced by the {@code taxonNameUUID} parameter
58
     * if there isn't one already and adds this new registration as blocking registration to the passed
59
     * {@code registration}. A new Registration will be returned otherwise the return value is <code>null</code>.
60
     *
61
     * Already existing registrations must not be added as blocking registration.
62
     *
63
     * @param taxonNameUUID
64
     * @param registration
65
     *
66
     * @return Returns the newly created blocking Registration or <code>null</code> if a new registration has not been created.
67
     */
68
    @Transactional
69
    Registration addBlockingRegistration(UUID nameUUID, Registration registration);
70

    
71
    @Transactional
72
    void addTypeDesignation(UUID typeDesignationUuid, Registration registration);
73

    
74
    @Transactional(readOnly=true)
75
    boolean canCreateNameRegistrationFor(RegistrationWorkingSet workingset, TaxonName name);
76

    
77
    boolean checkWokingsetContainsProtologe(RegistrationWorkingSet workingset, TaxonName name);
78

    
79

    
80
}
(8-8/14)