3 * Copyright (C) 2015 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.store
.operations
;
12 import org
.eclipse
.core
.runtime
.IAdaptable
;
13 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
15 import eu
.etaxonomy
.cdm
.api
.application
.CdmApplicationState
;
16 import eu
.etaxonomy
.cdm
.api
.application
.CdmChangeEvent
.Action
;
17 import eu
.etaxonomy
.cdm
.api
.service
.ITestService
;
18 import eu
.etaxonomy
.cdm
.api
.service
.UpdateResult
;
19 import eu
.etaxonomy
.cdm
.api
.service
.dto
.CdmEntityIdentifier
;
20 import eu
.etaxonomy
.taxeditor
.operation
.RemotingCdmUpdateOperation
;
27 public class RemotingTestUpdateOperation
extends RemotingCdmUpdateOperation
{
29 private static String LABEL
= "Test Operation";
31 private UpdateResult result
;
32 private Exception exception
;
33 private CdmEntityIdentifier cei
;
42 public RemotingTestUpdateOperation(UpdateResult result
,
45 super(LABEL
, Action
.Update
, source
, async
);
49 public RemotingTestUpdateOperation(Exception exception
,
52 super(LABEL
, Action
.Update
, source
, async
);
53 this.exception
= exception
;
56 public RemotingTestUpdateOperation(CdmEntityIdentifier cei
,
59 super(LABEL
, Action
.Update
, source
, async
);
64 * @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
67 protected UpdateResult
doUpdateExecute(IProgressMonitor monitor
, IAdaptable info
) throws Exception
{
68 ITestService testService
= CdmApplicationState
.getTestService();
70 return testService
.returnResult(result
);
71 } else if(exception
!= null) {
72 return testService
.throwException(exception
);
73 } else if(cei
!= null) {
74 return testService
.addChild(cei
);