Project

General

Profile

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

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

    
15
import org.eclipse.core.runtime.IAdaptable;
16
import org.eclipse.core.runtime.IProgressMonitor;
17

    
18
import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
19
import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
20
import eu.etaxonomy.cdm.api.service.UpdateResult;
21
import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
22
import eu.etaxonomy.taxeditor.store.CdmStore;
23

    
24
/**
25
 * @author cmathew
26
 * @date 25 Jun 2015
27
 *
28
 */
29
public class RemotingPolytomousKeyDeleteOperation extends RemotingCdmUpdateOperation {
30

    
31
    private final static String LABEL = "Delete Polytomous Key operation";
32

    
33
    private final List<UUID> keysToDelete;
34
    /**
35
     * @param label
36
     * @param action
37
     * @param source
38
     * @param async
39
     */
40
    public RemotingPolytomousKeyDeleteOperation(Object source,
41
            boolean async,
42
            List<UUID> keysToDelete) {
43
        super(LABEL, Action.Delete, source, async);
44
        this.keysToDelete = keysToDelete;
45
    }
46

    
47
    /* (non-Javadoc)
48
     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
49
     */
50
    @Override
51
    protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
52
        return CdmStore.getService(IPolytomousKeyService.class).delete(keysToDelete);
53
    }
54

    
55
}
(3-3/4)