2 * Copyright (C) 2015 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.taxeditor
.session
.mock
;
11 import java
.util
.Collection
;
12 import java
.util
.List
;
13 import java
.util
.UUID
;
15 import eu
.etaxonomy
.cdm
.api
.service
.IService
;
16 import eu
.etaxonomy
.cdm
.api
.service
.UpdateResult
;
17 import eu
.etaxonomy
.cdm
.cache
.EntityCacherDebugResult
;
18 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
19 import eu
.etaxonomy
.cdm
.persistence
.dto
.MergeResult
;
20 import eu
.etaxonomy
.taxeditor
.session
.ICdmEntitySession
;
21 import eu
.etaxonomy
.taxeditor
.session
.ICdmEntitySessionEnabled
;
22 import net
.sf
.ehcache
.statistics
.LiveCacheStatistics
;
28 public class MockCdmEntitySession
implements ICdmEntitySession
{
31 public <O
extends Object
> O
load(O obj
, boolean update
) {
36 public <T
extends CdmBase
> T
load(T cdmBase
, boolean update
) {
41 public <T
extends CdmBase
> Collection
<T
> load(Collection
<T
> cdmBaseList
, boolean update
) {
46 public void setEntitiesAsLatest() {
50 public void dispose() {
58 public <T
extends CdmBase
> EntityCacherDebugResult
debug(T cdmBase
) {
59 return new EntityCacherDebugResult();
64 public <T
extends CdmBase
> T
remoteLoad(IService
<T
> service
, UUID uuid
) {
65 return service
.load(uuid
);
69 public <T
extends CdmBase
> T
remoteLoad(IService
<T
> service
, UUID uuid
, List
<String
> propertyPaths
) {
70 return service
.load(uuid
, propertyPaths
);
74 public <T
extends CdmBase
> UUID
remoteSave(IService
<T
> service
, T cdmBase
) {
75 return service
.save(cdmBase
).getUuid();
79 public <T
extends CdmBase
> T
remoteUpdate(IService
<T
> service
, T cdmBase
) {
84 public ICdmEntitySessionEnabled
getOwner() {
89 public LiveCacheStatistics
getCacheStatistics() {
94 public boolean isActive() {
99 public <T
extends CdmBase
> List
<T
> getRootEntities() {
104 public <T
extends CdmBase
> EntityCacherDebugResult
debug(Collection
<T
> cdmBase
, boolean includeIgnored
) {
109 public <T
extends CdmBase
> EntityCacherDebugResult
debug(boolean includeIgnored
) {
114 public <T
extends CdmBase
> void update() {
118 public UpdateResult
load(UpdateResult updateResult
, boolean update
) {
123 public List
<String
> getPropertyPaths(Object obj
) {
128 public void addNewCdmEntity(CdmBase newEntity
) {
132 public <T
extends CdmBase
> MergeResult
<T
> load(MergeResult
<T
> mergeResult
, boolean update
) {