1
|
/**
|
2
|
* Copyright (C) 2015 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.taxeditor.navigation.key.polytomous.operation;
|
10
|
|
11
|
import java.util.List;
|
12
|
import java.util.UUID;
|
13
|
|
14
|
import org.eclipse.core.runtime.IAdaptable;
|
15
|
import org.eclipse.core.runtime.IProgressMonitor;
|
16
|
|
17
|
import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
|
18
|
import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
|
19
|
import eu.etaxonomy.cdm.api.service.UpdateResult;
|
20
|
import eu.etaxonomy.cdm.model.description.PolytomousKey;
|
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 RemotingDeletePolytomousKeyOperation 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 RemotingDeletePolytomousKeyOperation(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
|
entityType = PolytomousKey.class;
|
53
|
return CdmStore.getService(IPolytomousKeyService.class).delete(keysToDelete);
|
54
|
}
|
55
|
|
56
|
}
|