Project

General

Profile

Revision aeff6228

IDaeff622855f124569d157da7e3b489e6821deeef
Parent 5d177a2e
Child cd704234

Added by Katja Luther about 5 years ago

delete transient services

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientAgentService.java
1
// $Id$
2
/**
3
* Copyright (C) 2013 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.editor.view.dataimport.transientServices;
11

  
12
import java.util.Collection;
13
import java.util.List;
14
import java.util.Map;
15
import java.util.Set;
16
import java.util.UUID;
17

  
18
import org.hibernate.LockOptions;
19
import org.hibernate.Session;
20
import org.hibernate.criterion.Criterion;
21
import org.hibernate.envers.query.criteria.AuditCriterion;
22

  
23
import eu.etaxonomy.cdm.api.service.DeleteResult;
24
import eu.etaxonomy.cdm.api.service.IAgentService;
25
import eu.etaxonomy.cdm.api.service.UpdateResult;
26
import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
27
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
28
import eu.etaxonomy.cdm.api.service.dto.IdentifiedEntityDTO;
29
import eu.etaxonomy.cdm.api.service.dto.MarkedEntityDTO;
30
import eu.etaxonomy.cdm.api.service.pager.Pager;
31
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
32
import eu.etaxonomy.cdm.model.agent.Address;
33
import eu.etaxonomy.cdm.model.agent.AgentBase;
34
import eu.etaxonomy.cdm.model.agent.Institution;
35
import eu.etaxonomy.cdm.model.agent.InstitutionalMembership;
36
import eu.etaxonomy.cdm.model.agent.Person;
37
import eu.etaxonomy.cdm.model.agent.Team;
38
import eu.etaxonomy.cdm.model.common.Annotation;
39
import eu.etaxonomy.cdm.model.common.DefinedTerm;
40
import eu.etaxonomy.cdm.model.common.ISourceable;
41
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
42
import eu.etaxonomy.cdm.model.common.LSID;
43
import eu.etaxonomy.cdm.model.common.Marker;
44
import eu.etaxonomy.cdm.model.common.MarkerType;
45
import eu.etaxonomy.cdm.model.media.Rights;
46
import eu.etaxonomy.cdm.model.view.AuditEvent;
47
import eu.etaxonomy.cdm.model.view.AuditEventRecord;
48
import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
49
import eu.etaxonomy.cdm.persistence.dto.MergeResult;
50
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
51
import eu.etaxonomy.cdm.persistence.query.Grouping;
52
import eu.etaxonomy.cdm.persistence.query.MatchMode;
53
import eu.etaxonomy.cdm.persistence.query.OrderHint;
54
import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
55
import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
56
import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy;
57
import eu.etaxonomy.cdm.strategy.merge.MergeException;
58

  
59
/**
60
 * @author pplitzner
61
 * @date 27.09.2013
62
 *
63
 */
64
public class TransientAgentService implements IAgentService {
65

  
66
    private final IAgentService defaultService;
67

  
68
    /**
69
     * @param defaultAgentService
70
     */
71
    public TransientAgentService(IAgentService defaultAgentService) {
72
        this.defaultService = defaultAgentService;
73
    }
74

  
75
    /**
76
     * @param t
77
     * @param pageSize
78
     * @param pageNumber
79
     * @param sort
80
     * @param propertyPaths
81
     * @return
82
     * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(eu.etaxonomy.cdm.model.common.VersionableEntity, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
83
     */
84
    @Override
85
    public Pager<AuditEventRecord<AgentBase>> pageAuditEvents(AgentBase t, Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths) {
86
        return defaultService.pageAuditEvents(t, pageSize, pageNumber, sort, propertyPaths);
87
    }
88

  
89
    /**
90
     * @param annotatedObj
91
     * @param status
92
     * @param pageSize
93
     * @param pageNumber
94
     * @param orderHints
95
     * @param propertyPaths
96
     * @return
97
     * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getAnnotations(eu.etaxonomy.cdm.model.common.AnnotatableEntity, eu.etaxonomy.cdm.model.common.MarkerType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
98
     */
99
    @Override
100
    public Pager<Annotation> getAnnotations(AgentBase annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
101
        return defaultService.getAnnotations(annotatedObj, status, pageSize, pageNumber, orderHints, propertyPaths);
102
    }
103

  
104
    /**
105
     * @param code
106
     * @return
107
     * @see eu.etaxonomy.cdm.api.service.IAgentService#searchInstitutionByCode(java.lang.String)
108
     */
109
    @Override
110
    public List<Institution> searchInstitutionByCode(String code) {
111
        return defaultService.searchInstitutionByCode(code);
112
    }
113

  
114
    /**
115
     * @param person
116
     * @param pageSize
117
     * @param pageNumber
118
     * @return
119
     * @see eu.etaxonomy.cdm.api.service.IAgentService#getInstitutionalMemberships(eu.etaxonomy.cdm.model.agent.Person, java.lang.Integer, java.lang.Integer)
120
     */
121
    @Override
122
    public Pager<InstitutionalMembership> getInstitutionalMemberships(Person person, Integer pageSize, Integer pageNumber) {
123
        return defaultService.getInstitutionalMemberships(person, pageSize, pageNumber);
124
    }
125

  
126
    /**
127
     *
128
     * @see eu.etaxonomy.cdm.api.service.IService#clear()
129
     */
130
    @Override
131
    public void clear() {
132
        defaultService.clear();
133
    }
134

  
135
    /**
136
     * @param t
137
     * @param lockMode
138
     * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
139
     */
140
    @Override
141
    public void lock(AgentBase t, LockOptions lockOptions) {
142
        defaultService.lock(t, lockOptions);
143
    }
144

  
145
    /**
146
     * @param t
147
     * @param lockMode
148
     * @param propertyPaths
149
     * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
150
     */
151
    @Override
152
    public void refresh(AgentBase t, LockOptions lockOptions, List<String> propertyPaths) {
153
        defaultService.refresh(t, lockOptions, propertyPaths);
154
    }
155

  
156
    /**
157
     * @param team
158
     * @param pageSize
159
     * @param pageNumber
160
     * @return
161
     * @see eu.etaxonomy.cdm.api.service.IAgentService#getMembers(eu.etaxonomy.cdm.model.agent.Team, java.lang.Integer, java.lang.Integer)
162
     */
163
    @Override
164
    public Pager<Person> getMembers(Team team, Integer pageSize, Integer pageNumber) {
165
        return defaultService.getMembers(team, pageSize, pageNumber);
166
    }
167

  
168
    /**
169
     *
170
     * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache()
171
     */
172
    @Override
173
    public void updateTitleCache() {
174
        defaultService.updateTitleCache();
175
    }
176

  
177
    /**
178
     * @param t
179
     * @return
180
     * @see eu.etaxonomy.cdm.api.service.IVersionableService#getNextAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
181
     */
182
    @Override
183
    public AuditEventRecord<AgentBase> getNextAuditEvent(AgentBase t) {
184
        return defaultService.getNextAuditEvent(t);
185
    }
186

  
187
    /**
188
     * @param annotatableEntity
189
     * @param technical
190
     * @param pageSize
191
     * @param pageNumber
192
     * @param orderHints
193
     * @param propertyPaths
194
     * @return
195
     * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getMarkers(eu.etaxonomy.cdm.model.common.AnnotatableEntity, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
196
     */
197
    @Override
198
    public Pager<Marker> getMarkers(AgentBase annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
199
        return defaultService.getMarkers(annotatableEntity, technical, pageSize, pageNumber, orderHints, propertyPaths);
200
    }
201

  
202
    /**
203
     * @param clazz
204
     * @param stepSize
205
     * @param cacheStrategy
206
     * @param monitor
207
     * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Class, java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy, eu.etaxonomy.cdm.common.monitor.IProgressMonitor)
208
     */
209
    @Override
210
    public void updateTitleCache(Class<? extends AgentBase> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<AgentBase> cacheStrategy, IProgressMonitor monitor) {
211
        defaultService.updateTitleCache(clazz, stepSize, cacheStrategy, monitor);
212
    }
213

  
214
    /**
215
     * @param agent
216
     * @param pageSize
217
     * @param pageNumber
218
     * @return
219
     * @see eu.etaxonomy.cdm.api.service.IAgentService#getAddresses(eu.etaxonomy.cdm.model.agent.AgentBase, java.lang.Integer, java.lang.Integer)
220
     */
221
    @Override
222
    public Pager<Address> getAddresses(AgentBase agent, Integer pageSize, Integer pageNumber) {
223
        return defaultService.getAddresses(agent, pageSize, pageNumber);
224
    }
225

  
226
    /**
227
     * @param t
228
     * @return
229
     * @see eu.etaxonomy.cdm.api.service.IVersionableService#getPreviousAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
230
     */
231
    @Override
232
    public AuditEventRecord<AgentBase> getPreviousAuditEvent(AgentBase t) {
233
        return defaultService.getPreviousAuditEvent(t);
234
    }
235

  
236
    /**
237
     * @param clazz
238
     * @return
239
     * @see eu.etaxonomy.cdm.api.service.IService#count(java.lang.Class)
240
     */
241
    @Override
242
    public int count(Class<? extends AgentBase> clazz) {
243
        return defaultService.count(clazz);
244
    }
245

  
246
    /**
247
     * @param clazz
248
     * @param queryString
249
     * @param pageSize
250
     * @param pageNumber
251
     * @param orderHints
252
     * @param propertyPaths
253
     * @return
254
     * @see eu.etaxonomy.cdm.api.service.IAgentService#search(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
255
     */
256
    @Override
257
    public Pager<AgentBase> search(Class<? extends AgentBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
258
        return defaultService.search(clazz, queryString, pageSize, pageNumber, orderHints, propertyPaths);
259
    }
260

  
261
    /**
262
     * @param clazz
263
     * @param from
264
     * @param to
265
     * @param criteria
266
     * @param pageSize
267
     * @param pageValue
268
     * @param sort
269
     * @param propertyPaths
270
     * @return
271
     * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(java.lang.Class, eu.etaxonomy.cdm.model.view.AuditEvent, eu.etaxonomy.cdm.model.view.AuditEvent, java.util.List, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
272
     */
273
    @Override
274
    public Pager<AuditEventRecord<AgentBase>> pageAuditEvents(Class<? extends AgentBase> clazz, AuditEvent from, AuditEvent to, List<AuditCriterion> criteria, Integer pageSize, Integer pageValue, AuditEventSort sort, List<String> propertyPaths) {
275
        return defaultService.pageAuditEvents(clazz, from, to, criteria, pageSize, pageValue, sort, propertyPaths);
276
    }
277

  
278
    /**
279
     * @param lsid
280
     * @return
281
     * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#find(eu.etaxonomy.cdm.model.common.LSID)
282
     */
283
    @Override
284
    public AgentBase find(LSID lsid) {
285
        return defaultService.find(lsid);
286
    }
287

  
288
    /**
289
     * @param persistentObject
290
     * @return
291
     * @see eu.etaxonomy.cdm.api.service.IService#delete(eu.etaxonomy.cdm.model.common.ICdmBase)
292
     */
293
    @Override
294
    public DeleteResult delete(AgentBase persistentObject) {
295
        return defaultService.delete(persistentObject);
296
    }
297

  
298
    /**
299
     * @param clazz
300
     * @param technical
301
     * @param pageSize
302
     * @param pageNumber
303
     * @param propertyPaths
304
     * @return
305
     * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#groupMarkers(java.lang.Class, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List)
306
     */
307
    @Override
308
    public List<Object[]> groupMarkers(Class<? extends AgentBase> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
309
        return defaultService.groupMarkers(clazz, technical, pageSize, pageNumber, propertyPaths);
310
    }
311

  
312
    /**
313
     * @param uuid
314
     * @return
315
     * @see eu.etaxonomy.cdm.api.service.IService#exists(java.util.UUID)
316
     */
317
    @Override
318
    public boolean exists(UUID uuid) {
319
        return defaultService.exists(uuid);
320
    }
321

  
322
    /**
323
     * @param x
324
     * @param y
325
     * @return
326
     * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#replace(eu.etaxonomy.cdm.model.common.IdentifiableEntity, eu.etaxonomy.cdm.model.common.IdentifiableEntity)
327
     */
328
    @Override
329
    public AgentBase replace(AgentBase x, AgentBase y) {
330
        return defaultService.replace(x, y);
331
    }
332

  
333
    /**
334
     * @param uuidSet
335
     * @return
336
     * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.Set)
337
     */
338
    @Override
339
    public List<AgentBase> find(Set<UUID> uuidSet) {
340
        return defaultService.find(uuidSet);
341
    }
342

  
343
    /**
344
     * @param t
345
     * @param pageSize
346
     * @param pageNumber
347
     * @param propertyPaths
348
     * @return
349
     * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSources(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
350
     */
351
    @Override
352
    public Pager<IdentifiableSource> getSources(AgentBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
353
        return defaultService.getSources(t, pageSize, pageNumber, propertyPaths);
354
    }
355

  
356
    /**
357
     * @param uuid
358
     * @return
359
     * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.UUID)
360
     */
361
    @Override
362
    public AgentBase find(UUID uuid) {
363
        return defaultService.find(uuid);
364
    }
365

  
366
    /**
367
     * @return
368
     * @see eu.etaxonomy.cdm.api.service.IAgentService#getPersonUuidAndTitleCache()
369
     */
370
    @Override
371
    public List<UuidAndTitleCache<Person>> getPersonUuidAndTitleCache() {
372
        return defaultService.getPersonUuidAndTitleCache();
373
    }
374

  
375
    /**
376
     * @return
377
     * @see eu.etaxonomy.cdm.api.service.IAgentService#getTeamUuidAndTitleCache()
378
     */
379
    @Override
380
    public List<UuidAndTitleCache<Team>> getTeamUuidAndTitleCache() {
381
        return defaultService.getTeamUuidAndTitleCache();
382
    }
383

  
384
    /**
385
     * @param id
386
     * @return
387
     * @see eu.etaxonomy.cdm.api.service.IService#find(int)
388
     */
389
    @Override
390
    public AgentBase find(int id) {
391
        return defaultService.find(id);
392
    }
393

  
394
    /**
395
     * @param t
396
     * @param pageSize
397
     * @param pageNumber
398
     * @param propertyPaths
399
     * @return
400
     * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getRights(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
401
     */
402
    @Override
403
    public Pager<Rights> getRights(AgentBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
404
        return defaultService.getRights(t, pageSize, pageNumber, propertyPaths);
405
    }
406

  
407
    /**
408
     * @param clazz
409
     * @param technical
410
     * @return
411
     * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#countMarkers(java.lang.Class, java.lang.Boolean)
412
     */
413
    @Override
414
    public int countMarkers(Class<? extends AgentBase> clazz, Boolean technical) {
415
        return defaultService.countMarkers(clazz, technical);
416
    }
417

  
418
    /**
419
     * @return
420
     * @see eu.etaxonomy.cdm.api.service.IAgentService#getTeamUuidAndNomenclaturalTitle()
421
     */
422
    @Override
423
    public List<UuidAndTitleCache<Team>> getTeamUuidAndNomenclaturalTitle() {
424
        return defaultService.getTeamUuidAndNomenclaturalTitle();
425
    }
426

  
427
    /**
428
     * @param idSet
429
     * @return
430
     * @see eu.etaxonomy.cdm.api.service.IService#findById(java.util.Set)
431
     */
432
    @Override
433
    public List<AgentBase> findById(Set<Integer> idSet) {
434
        return defaultService.findById(idSet);
435
    }
436

  
437
    /**
438
     * @return
439
     * @see eu.etaxonomy.cdm.api.service.IAgentService#getInstitutionUuidAndTitleCache()
440
     */
441
    @Override
442
    public List<UuidAndTitleCache<Institution>> getInstitutionUuidAndTitleCache() {
443
        return defaultService.getInstitutionUuidAndTitleCache();
444
    }
445

  
446
    /**
447
     * @param clazz
448
     * @param idInSource
449
     * @param idNamespace
450
     * @return
451
     * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSourcedObjectByIdInSource(java.lang.Class, java.lang.String, java.lang.String)
452
     */
453
    @Override
454
    public ISourceable getSourcedObjectByIdInSource(Class clazz, String idInSource, String idNamespace) {
455
        return defaultService.getSourcedObjectByIdInSource(clazz, idInSource, idNamespace);
456
    }
457

  
458
    /**
459
     * @return
460
     * @see eu.etaxonomy.cdm.api.service.IService#getSession()
461
     */
462
    @Override
463
    public Session getSession() {
464
        return defaultService.getSession();
465
    }
466

  
467

  
468
    /**
469
     * @param clazz
470
     * @param limit
471
     * @param start
472
     * @param groups
473
     * @param propertyPaths
474
     * @return
475
     * @see eu.etaxonomy.cdm.api.service.IService#group(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
476
     */
477
    @Override
478
    public List<Object[]> group(Class<? extends AgentBase> clazz, Integer limit, Integer start, List<Grouping> groups, List<String> propertyPaths) {
479
        return defaultService.group(clazz, limit, start, groups, propertyPaths);
480
    }
481

  
482
    /**
483
     * @param clazz
484
     * @param queryString
485
     * @param matchmode
486
     * @param criteria
487
     * @param pageSize
488
     * @param pageNumber
489
     * @param orderHints
490
     * @param propertyPaths
491
     * @return
492
     * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
493
     */
494
    @Override
495
    public Pager<AgentBase> findByTitle(Class<? extends AgentBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
496
        return defaultService.findByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
497
    }
498

  
499
    /**
500
     * @param type
501
     * @param limit
502
     * @param start
503
     * @param orderHints
504
     * @param propertyPaths
505
     * @return
506
     * @see eu.etaxonomy.cdm.api.service.IService#list(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
507
     */
508
    @Override
509
    public <S extends AgentBase> List<S> list(Class<S> type, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
510
        return defaultService.list(type, limit, start, orderHints, propertyPaths);
511
    }
512

  
513
    /**
514
     * @param configurator
515
     * @return
516
     * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
517
     */
518
    @Override
519
    public Pager<AgentBase> findByTitle(IIdentifiableEntityServiceConfigurator<AgentBase> configurator) {
520
        return defaultService.findByTitle(configurator);
521
    }
522

  
523
    /**
524
     * @param clazz
525
     * @param queryString
526
     * @param matchmode
527
     * @param criteria
528
     * @return
529
     * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List)
530
     */
531
    @Override
532
    public Integer countByTitle(Class<? extends AgentBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria) {
533
        return defaultService.countByTitle(clazz, queryString, matchmode, criteria);
534
    }
535

  
536
    /**
537
     * @param uuid
538
     * @return
539
     * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID)
540
     */
541
    @Override
542
    public AgentBase load(UUID uuid) {
543
        return defaultService.load(uuid);
544
    }
545

  
546
    /**
547
     * @param uuid
548
     * @param propertyPaths
549
     * @return
550
     * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID, java.util.List)
551
     */
552
    @Override
553
    public AgentBase load(UUID uuid, List<String> propertyPaths) {
554
        return defaultService.load(uuid, propertyPaths);
555
    }
556

  
557
    /**
558
     * @param configurator
559
     * @return
560
     * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
561
     */
562
    @Override
563
    public Integer countByTitle(IIdentifiableEntityServiceConfigurator<AgentBase> configurator) {
564
        return defaultService.countByTitle(configurator);
565
    }
566

  
567
    /**
568
     * @param transientObject
569
     * @return
570
     * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase)
571
     */
572
    @Override
573
    public AgentBase merge(AgentBase transientObject) {
574
        return defaultService.merge(transientObject);
575
    }
576

  
577
    /**
578
     * @param clazz
579
     * @param queryString
580
     * @param matchmode
581
     * @param criteria
582
     * @param pageSize
583
     * @param pageNumber
584
     * @param orderHints
585
     * @param propertyPaths
586
     * @return
587
     * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
588
     */
589
    @Override
590
    public List<AgentBase> listByTitle(Class<? extends AgentBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
591
        return defaultService.listByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
592
    }
593

  
594
    /**
595
     * @param type
596
     * @param pageSize
597
     * @param pageNumber
598
     * @param orderHints
599
     * @param propertyPaths
600
     * @return
601
     * @see eu.etaxonomy.cdm.api.service.IService#page(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
602
     */
603
    @Override
604
    public <S extends AgentBase>  Pager<S> page(Class<S> type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
605
        return defaultService.page(type, pageSize, pageNumber, orderHints, propertyPaths);
606
    }
607

  
608
    /**
609
     * @param persistentObject
610
     * @return
611
     * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase)
612
     */
613
    @Override
614
    public UUID refresh(AgentBase persistentObject) {
615
        return defaultService.refresh(persistentObject);
616
    }
617

  
618
    /**
619
     * @param clazz
620
     * @param queryString
621
     * @param matchmode
622
     * @param criteria
623
     * @param pageSize
624
     * @param pageNumber
625
     * @param orderHints
626
     * @param propertyPaths
627
     * @return
628
     * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByReferenceTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
629
     */
630
    @Override
631
    public List<AgentBase> listByReferenceTitle(Class<? extends AgentBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
632
        return defaultService.listByReferenceTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
633
    }
634

  
635
    /**
636
     * @param tableName
637
     * @param limit
638
     * @param start
639
     * @return
640
     * @see eu.etaxonomy.cdm.api.service.IService#rows(java.lang.String, int, int)
641
     */
642
    @Override
643
    public List<AgentBase> rows(String tableName, int limit, int start) {
644
        return defaultService.rows(tableName, limit, start);
645
    }
646

  
647
    /**
648
     * @param newInstances
649
     * @return
650
     * @see eu.etaxonomy.cdm.api.service.IService#save(java.util.Collection)
651
     */
652
    @Override
653
    public Map<UUID, AgentBase> save(Collection<AgentBase> newInstances) {
654
        return null;
655
    }
656

  
657
    /**
658
     * @param newInstance
659
     * @return
660
     * @see eu.etaxonomy.cdm.api.service.IService#save(eu.etaxonomy.cdm.model.common.ICdmBase)
661
     */
662
    @Override
663
    public AgentBase save(AgentBase newInstance) {
664
        return null;
665
    }
666

  
667
    /**
668
     * @param transientObject
669
     * @return
670
     * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(eu.etaxonomy.cdm.model.common.ICdmBase)
671
     */
672
    @Override
673
    public UUID saveOrUpdate(AgentBase transientObject) {
674
        return null;
675
    }
676

  
677
    /**
678
     * @param transientObjects
679
     * @return
680
     * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(java.util.Collection)
681
     */
682
    @Override
683
    public Map<UUID, AgentBase> saveOrUpdate(Collection<AgentBase> transientObjects) {
684
        return null;
685
    }
686

  
687
    /**
688
     * @param transientObject
689
     * @return
690
     * @see eu.etaxonomy.cdm.api.service.IService#update(eu.etaxonomy.cdm.model.common.ICdmBase)
691
     */
692
    @Override
693
    public UUID update(AgentBase transientObject) {
694
        return defaultService.update(transientObject);
695
    }
696

  
697
    /**
698
     * @param example
699
     * @param includeProperties
700
     * @param limit
701
     * @param start
702
     * @param orderHints
703
     * @param propertyPaths
704
     * @return
705
     * @see eu.etaxonomy.cdm.api.service.IService#list(eu.etaxonomy.cdm.model.common.ICdmBase, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
706
     */
707
    @Override
708
    public List<AgentBase> list(AgentBase example, Set<String> includeProperties, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
709
        return defaultService.list(example, includeProperties, limit, start, orderHints, propertyPaths);
710
    }
711

  
712
    /**
713
     * @param clazz
714
     * @param matchStrategy
715
     * @param mergeStrategy
716
     * @return
717
     * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#deduplicate(java.lang.Class, eu.etaxonomy.cdm.strategy.match.IMatchStrategy, eu.etaxonomy.cdm.strategy.merge.IMergeStrategy)
718
     */
719
    @Override
720
    public int deduplicate(Class<? extends AgentBase> clazz, IMatchStrategy matchStrategy, IMergeStrategy mergeStrategy) {
721
        return defaultService.deduplicate(clazz, matchStrategy, mergeStrategy);
722
    }
723

  
724
    /**
725
     * @param clazz
726
     * @param queryString
727
     * @param pageSize
728
     * @param pageNumber
729
     * @param orderHints
730
     * @param matchMode
731
     * @return
732
     * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findTitleCache(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, eu.etaxonomy.cdm.persistence.query.MatchMode)
733
     */
734
    @Override
735
    public Pager<AgentBase> findTitleCache(Class<? extends AgentBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, MatchMode matchMode) {
736
        return defaultService.findTitleCache(clazz, queryString, pageSize, pageNumber, orderHints, matchMode);
737
    }
738

  
739
	@Override
740
	public DeleteResult isDeletable(AgentBase object,
741
			DeleteConfiguratorBase config) {
742
		// TODO Auto-generated method stub
743
		return null;
744
	}
745

  
746
	@Override
747
	public AgentBase findWithoutFlush(UUID uuid) {
748
		return defaultService.findWithoutFlush(uuid);
749
	};
750

  
751
	@Override
752
	public <S extends AgentBase>  Pager<IdentifiedEntityDTO<S>> findByIdentifier(Class<S> clazz, String identifier, DefinedTerm identifierType, MatchMode matchmode, boolean includeEntity, Integer pageSize, Integer pageNumber, List<String> propertyPaths){
753
		return defaultService.findByIdentifier(clazz, identifier, identifierType, matchmode, includeEntity, pageSize, pageNumber, propertyPaths);
754
	}
755

  
756
	@Override
757
	public UpdateResult convertPerson2Team(Person arg0) throws MergeException,
758
			IllegalArgumentException {
759
		return defaultService.convertPerson2Team(arg0);
760
	}
761

  
762
	@Override
763
	public UpdateResult convertTeam2Person(Team arg0) throws MergeException,
764
			IllegalArgumentException {
765
		return defaultService.convertTeam2Person(arg0);
766
	}
767

  
768

  
769
	@Override
770
	public DeleteResult delete(UUID arg0) {
771
		return defaultService.delete(arg0);
772
	}
773

  
774
    /* (non-Javadoc)
775
     * @see eu.etaxonomy.cdm.api.service.IService#delete(java.util.Collection)
776
     */
777
    @Override
778
    public DeleteResult delete(Collection<UUID> arg0) {
779
        return defaultService.delete(arg0);
780
    }
781

  
782
    /* (non-Javadoc)
783
     * @see eu.etaxonomy.cdm.api.service.IService#merge(java.util.List)
784
     */
785
    @Override
786
    public List<AgentBase> merge(List<AgentBase> arg0) {
787
       return defaultService.merge(arg0);
788
    }
789

  
790
    /* (non-Javadoc)
791
     * @see eu.etaxonomy.cdm.api.service.IService#merge(java.util.List, boolean)
792
     */
793
    @Override
794
    public List<MergeResult<AgentBase>> merge(List<AgentBase> arg0, boolean arg1) {
795
        return defaultService.merge(arg0, arg1);
796
    }
797

  
798
    /* (non-Javadoc)
799
     * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase, boolean)
800
     */
801
    @Override
802
    public MergeResult<AgentBase> merge(AgentBase arg0, boolean arg1) {
803
       return defaultService.merge(arg0, arg1);
804
    }
805

  
806
    /* (non-Javadoc)
807
     * @see eu.etaxonomy.cdm.api.service.IService#loadWithUpdate(java.util.UUID)
808
     */
809
    @Override
810
    public AgentBase loadWithUpdate(UUID arg0) {
811
        return defaultService.loadWithUpdate(arg0);
812
    }
813

  
814
    /* (non-Javadoc)
815
     * @see eu.etaxonomy.cdm.api.service.IAgentService#convertPerson2Team(java.util.UUID)
816
     */
817
    @Override
818
    public UpdateResult convertPerson2Team(UUID arg0) throws MergeException, IllegalArgumentException {
819
        return defaultService.convertPerson2Team(arg0);
820
    }
821

  
822
    /* (non-Javadoc)
823
     * @see eu.etaxonomy.cdm.api.service.IAgentService#convertTeam2Person(java.util.UUID)
824
     */
825
    @Override
826
    public UpdateResult convertTeam2Person(UUID arg0) throws MergeException {
827
        return defaultService.convertTeam2Person(arg0);
828
    }
829

  
830
    /**
831
     * {@inheritDoc}
832
     */
833
    @Override
834
    public List<AgentBase> load(List<UUID> arg0, List<String> arg1) {
835
        return defaultService.load(arg0, arg1);
836
    }
837

  
838
	@Override
839
	public List<UuidAndTitleCache<AgentBase>> getUuidAndTitleCache(
840
			Integer limit, String pattern) {
841
		return defaultService.getUuidAndTitleCache(limit, pattern);
842
	}
843

  
844
	@Override
845
	public List<UuidAndTitleCache<AgentBase>> getUuidAndAbbrevTitleCache(
846
			Integer limit, String pattern, Class clazz) {
847
		 return defaultService.getUuidAndAbbrevTitleCache(limit, pattern, clazz);
848
	}
849

  
850
	@Override
851
	public List<AgentBase> loadByIds(List<Integer> idSet, List<String> propertyPaths) {
852
		
853
		return defaultService.loadByIds(idSet, propertyPaths);
854
	}
855

  
856
	@Override
857
	public <S extends AgentBase> Pager<MarkedEntityDTO<S>> findByMarker(
858
			Class<S> arg0, MarkerType arg1, Boolean arg2, boolean arg3,
859
			Integer arg4, Integer arg5, List<String> arg6) {
860
		// TODO Auto-generated method stub
861
		return null;
862
	}
863

  
864
	@Override
865
	public <S extends AgentBase> List<UuidAndTitleCache<S>> getUuidAndTitleCache(
866
			Class<S> arg0, Integer arg1, String arg2) {
867
		// TODO Auto-generated method stub
868
		return null;
869
	}
870

  
871
	@Override
872
	public String getTitleCache(UUID arg0, boolean arg1) {
873
		// TODO Auto-generated method stub
874
		return null;
875
	}
876

  
877

  
878
}
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientCdmRepository.java
1
// $Id$
2
/**
3
* Copyright (C) 2013 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.editor.view.dataimport.transientServices;
11

  
12
import java.util.Collection;
13

  
14
import org.springframework.security.authentication.ProviderManager;
15
import org.springframework.transaction.PlatformTransactionManager;
16
import org.springframework.transaction.TransactionStatus;
17

  
18
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
19
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
20
import eu.etaxonomy.cdm.api.service.IAgentService;
21
import eu.etaxonomy.cdm.api.service.IAnnotationService;
22
import eu.etaxonomy.cdm.api.service.IClassificationService;
23
import eu.etaxonomy.cdm.api.service.ICollectionService;
24
import eu.etaxonomy.cdm.api.service.ICommonService;
25
import eu.etaxonomy.cdm.api.service.IDatabaseService;
26
import eu.etaxonomy.cdm.api.service.IDescriptionService;
27
import eu.etaxonomy.cdm.api.service.IEntityConstraintViolationService;
28
import eu.etaxonomy.cdm.api.service.IEntityValidationService;
29
import eu.etaxonomy.cdm.api.service.IEventBaseService;
30
import eu.etaxonomy.cdm.api.service.IFeatureNodeService;
31
import eu.etaxonomy.cdm.api.service.IFeatureTreeService;
32
import eu.etaxonomy.cdm.api.service.IGrantedAuthorityService;
33
import eu.etaxonomy.cdm.api.service.IGroupService;
34
import eu.etaxonomy.cdm.api.service.IIdentificationKeyService;
35
import eu.etaxonomy.cdm.api.service.ILocationService;
36
import eu.etaxonomy.cdm.api.service.IMediaService;
37
import eu.etaxonomy.cdm.api.service.IMetadataService;
38
import eu.etaxonomy.cdm.api.service.INameService;
39
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
40
import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService;
41
import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
42
import eu.etaxonomy.cdm.api.service.IPreferenceService;
43
import eu.etaxonomy.cdm.api.service.IProgressMonitorService;
44
import eu.etaxonomy.cdm.api.service.IReferenceService;
45
import eu.etaxonomy.cdm.api.service.IService;
46
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
47
import eu.etaxonomy.cdm.api.service.ITaxonService;
48
import eu.etaxonomy.cdm.api.service.ITermService;
49
import eu.etaxonomy.cdm.api.service.IUserService;
50
import eu.etaxonomy.cdm.api.service.IVocabularyService;
51
import eu.etaxonomy.cdm.api.service.IWorkingSetService;
52
import eu.etaxonomy.cdm.api.service.molecular.IAmplificationService;
53
import eu.etaxonomy.cdm.api.service.molecular.IPrimerService;
54
import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
55
import eu.etaxonomy.cdm.model.common.CdmBase;
56
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
57
import eu.etaxonomy.cdm.persistence.hibernate.permission.ICdmPermissionEvaluator;
58

  
59
/**
60
 * @author pplitzner
61
 * @date 26.09.2013
62
 *
63
 */
64
public class TransientCdmRepository implements ICdmApplicationConfiguration {
65

  
66
    private final ICdmApplicationConfiguration defaultApplicationConfiguration;
67
    private TransientOccurenceService occurenceService;
68

  
69
    public Collection<SpecimenOrObservationBase<?>> getUnits(){
70
        return occurenceService.getUnits();
71
    }
72

  
73
    /**
74
     * @param defaultApplicationConfiguration
75
     */
76
    public TransientCdmRepository(ICdmApplicationConfiguration defaultApplicationConfiguration) {
77
        this.defaultApplicationConfiguration = defaultApplicationConfiguration;
78
        this.occurenceService = (TransientOccurenceService) getOccurrenceService();
79
    }
80

  
81
    /**
82
     * @return
83
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#NewConversation()
84
     */
85
    @Override
86
    public ConversationHolder NewConversation() {
87
        return defaultApplicationConfiguration.NewConversation();
88
    }
89

  
90
    /**
91
     * @param arg0
92
     * @param arg1
93
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#authenticate(java.lang.String, java.lang.String)
94
     */
95
    @Override
96
    public void authenticate(String arg0, String arg1) {
97
        defaultApplicationConfiguration.authenticate(arg0, arg1);
98
    }
99

  
100
    /**
101
     * @param arg0
102
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#commitTransaction(org.springframework.transaction.TransactionStatus)
103
     */
104
    @Override
105
    public void commitTransaction(TransactionStatus arg0) {
106
        defaultApplicationConfiguration.commitTransaction(arg0);
107
    }
108

  
109
    /**
110
     * @return
111
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getAgentService()
112
     */
113
    @Override
114
    public IAgentService getAgentService() {
115
        return new TransientAgentService(defaultApplicationConfiguration.getAgentService());
116
    }
117

  
118
    /**
119
     * @return
120
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getAuthenticationManager()
121
     */
122
    @Override
123
    public ProviderManager getAuthenticationManager() {
124
        return defaultApplicationConfiguration.getAuthenticationManager();
125
    }
126

  
127
    /**
128
     * @param arg0
129
     * @return
130
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getBean(java.lang.String)
131
     */
132
    @Override
133
    public Object getBean(String arg0) {
134
        return defaultApplicationConfiguration.getBean(arg0);
135
    }
136

  
137
    /**
138
     * @return
139
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getClassificationService()
140
     */
141
    @Override
142
    public IClassificationService getClassificationService() {
143
        return new TransientClassificationService(defaultApplicationConfiguration.getClassificationService());
144
    }
145

  
146
    /**
147
     * @return
148
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getCollectionService()
149
     */
150
    @Override
151
    public ICollectionService getCollectionService() {
152
        return new TransientCollectionService(defaultApplicationConfiguration.getCollectionService());
153
    }
154

  
155
    /**
156
     * @return
157
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getCommonService()
158
     */
159
    @Override
160
    public ICommonService getCommonService() {
161
        return defaultApplicationConfiguration.getCommonService();
162
//        return new TransientCommonService(defaultApplicationConfiguration.getCommonService());
163
    }
164

  
165
    /**
166
     * @return
167
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getDatabaseService()
168
     */
169
    @Override
170
    public IDatabaseService getDatabaseService() {
171
        return defaultApplicationConfiguration.getDatabaseService();
172
//        return new TransientDatabaseService(defaultApplicationConfiguration.getDatabaseService());
173
    }
174

  
175
    /**
176
     * @return
177
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getDescriptionService()
178
     */
179
    @Override
180
    public IDescriptionService getDescriptionService() {
181
        return new TransientDescriptionService(defaultApplicationConfiguration.getDescriptionService());
182
    }
183

  
184
    /**
185
     * @return
186
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getFeatureNodeService()
187
     */
188
    @Override
189
    public IFeatureNodeService getFeatureNodeService() {
190
        return defaultApplicationConfiguration.getFeatureNodeService();
191
//        return new TransientFeatureNodeService(defaultApplicationConfiguration.getFeatureNodeService());
192
    }
193

  
194
    /**
195
     * @return
196
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getFeatureTreeService()
197
     */
198
    @Override
199
    public IFeatureTreeService getFeatureTreeService() {
200
        return defaultApplicationConfiguration.getFeatureTreeService();
201
//        return new TransientFeatureTreeService(defaultApplicationConfiguration.getFeatureTreeService());
202
    }
203

  
204
    /**
205
     * @return
206
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getGrantedAuthorityService()
207
     */
208
    @Override
209
    public IGrantedAuthorityService getGrantedAuthorityService() {
210
        return defaultApplicationConfiguration.getGrantedAuthorityService();
211
//        return new TransientGrantedAuthorityService(defaultApplicationConfiguration.getGrantedAuthorityService());
212
    }
213

  
214
    /**
215
     * @return
216
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getGroupService()
217
     */
218
    @Override
219
    public IGroupService getGroupService() {
220
        return defaultApplicationConfiguration.getGroupService();
221
//        return new TransientGroupService(defaultApplicationConfiguration.getGroupService());
222
    }
223

  
224
    /**
225
     * @return
226
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getIdentificationKeyService()
227
     */
228
    @Override
229
    public IIdentificationKeyService getIdentificationKeyService() {
230
        return defaultApplicationConfiguration.getIdentificationKeyService();
231
//        return new TransientIdentificationService(defaultApplicationConfiguration.getIdentificationKeyService());
232
    }
233

  
234
    /**
235
     * @return
236
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getLocationService()
237
     */
238
    @Override
239
    public ILocationService getLocationService() {
240
        return defaultApplicationConfiguration.getLocationService();
241
//        return new TransientLocationService(defaultApplicationConfiguration.getLocationService());
242
    }
243

  
244
    /**
245
     * @return
246
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getMainService()
247
     */
248
    @Override
249
    public IService<CdmBase> getMainService() {
250
        return defaultApplicationConfiguration.getMainService();
251
//        return new TransientMainService(defaultApplicationConfiguration.getMainService());
252
    }
253

  
254
    /**
255
     * @return
256
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getMediaService()
257
     */
258
    @Override
259
    public IMediaService getMediaService() {
260
        return defaultApplicationConfiguration.getMediaService();
261
//        return new TransientMediaService(defaultApplicationConfiguration.getMediaService());
262
    }
263

  
264
    /**
265
     * @return
266
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getNameService()
267
     */
268
    @Override
269
    public INameService getNameService() {
270
        return new TransientNameService(defaultApplicationConfiguration.getNameService());
271
    }
272

  
273
    /**
274
     * @return
275
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getOccurrenceService()
276
     */
277
    @Override
278
    public IOccurrenceService getOccurrenceService() {
279
        if(occurenceService==null){
280
            occurenceService = new TransientOccurenceService(defaultApplicationConfiguration.getOccurrenceService());
281
        }
282
        return occurenceService;
283
    }
284

  
285
    /**
286
     * @return
287
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getPermissionEvaluator()
288
     */
289
    @Override
290
    public ICdmPermissionEvaluator getPermissionEvaluator() {
291
        return defaultApplicationConfiguration.getPermissionEvaluator();
292
    }
293

  
294
    /**
295
     * @return
296
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getPolytomousKeyNodeService()
297
     */
298
    @Override
299
    public IPolytomousKeyNodeService getPolytomousKeyNodeService() {
300
        return defaultApplicationConfiguration.getPolytomousKeyNodeService();
301
//        return new TransientPolytomousKeyNodeService(defaultApplicationConfiguration.getPolytomousKeyNodeService());
302
    }
303

  
304
    /**
305
     * @return
306
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getPolytomousKeyService()
307
     */
308
    @Override
309
    public IPolytomousKeyService getPolytomousKeyService() {
310
        return defaultApplicationConfiguration.getPolytomousKeyService();
311
//        return new TransientPolytomousKeyService(defaultApplicationConfiguration.getPolytomousKeyService());
312
    }
313

  
314
    /**
315
     * @return
316
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getReferenceService()
317
     */
318
    @Override
319
    public IReferenceService getReferenceService() {
320
        return new TransientReferenceService(defaultApplicationConfiguration.getReferenceService());
321
    }
322

  
323
    /**
324
     * @return
325
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTaxonNodeService()
326
     */
327
    @Override
328
    public ITaxonNodeService getTaxonNodeService() {
329
        return defaultApplicationConfiguration.getTaxonNodeService();
330
//        return new TransientTaxonNodeService(defaultApplicationConfiguration.getTaxonNodeService());
331
    }
332

  
333
    /**
334
     * @return
335
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTaxonService()
336
     */
337
    @Override
338
    public ITaxonService getTaxonService() {
339
        return new TransientTaxonService(defaultApplicationConfiguration.getTaxonService());
340
    }
341

  
342
    /**
343
     * @return
344
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTermService()
345
     */
346
    @Override
347
    public ITermService getTermService() {
348
        return new TransientTermService(defaultApplicationConfiguration.getTermService());
349
    }
350

  
351
    /**
352
     * @return
353
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTransactionManager()
354
     */
355
    @Override
356
    public PlatformTransactionManager getTransactionManager() {
357
        return defaultApplicationConfiguration.getTransactionManager();
358
    }
359

  
360
    @Override
361
    public IUserService getUserService() {
362
        return defaultApplicationConfiguration.getUserService();
363
//        return new TransientUserService(defaultApplicationConfiguration.getUserService());
364
    }
365

  
366
    /**
367
     * @return
368
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getVocabularyService()
369
     */
370
    @Override
371
    public IVocabularyService getVocabularyService() {
372
        return defaultApplicationConfiguration.getVocabularyService();
373
//        return new TransientVocabularyService(defaultApplicationConfiguration.getVocabularyService());
374
    }
375

  
376
    @Override
377
    public IWorkingSetService getWorkingSetService() {
378
        return defaultApplicationConfiguration.getWorkingSetService();
379
//        return new TransientWorkingSetService(defaultApplicationConfiguration.getWorkingSetService());
380
    }
381

  
382
    @Override
383
    public TransactionStatus startTransaction() {
384
        return defaultApplicationConfiguration.startTransaction();
385
    }
386

  
387

  
388
    @Override
389
    public TransactionStatus startTransaction(Boolean arg0) {
390
        return defaultApplicationConfiguration.startTransaction(arg0);
391
    }
392

  
393
    @Override
394
    public IPrimerService getPrimerService() {
395
        return defaultApplicationConfiguration.getPrimerService();
396
    }
397

  
398
    @Override
399
    public IAmplificationService getAmplificationService() {
400
        return defaultApplicationConfiguration.getAmplificationService();
401
    }
402

  
403
    @Override
404
    public ISequenceService getSequenceService() {
405
        return defaultApplicationConfiguration.getSequenceService();
406
    }
407

  
408
    @Override
409
    public IEventBaseService getEventBaseService() {
410
        return defaultApplicationConfiguration.getEventBaseService();
411
    }
412

  
413
	@Override
414
	public IEntityConstraintViolationService getEntityConstraintViolationService() {
415
		return defaultApplicationConfiguration.getEntityConstraintViolationService();
416
	}
417

  
418
	@Override
419
	public IEntityValidationService getEntityValidationService() {
420
		return defaultApplicationConfiguration.getEntityValidationService();
421
	}
422

  
423
    /* (non-Javadoc)
424
     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getAnnotationService()
425
     */
426
    @Override
427
    public IAnnotationService getAnnotationService() {
428
        return defaultApplicationConfiguration.getAnnotationService();
429
    }
430

  
431
    /**
432
     * {@inheritDoc}
433
     */
434
    @Override
435
    public IProgressMonitorService getProgressMonitorService() {
436
        return defaultApplicationConfiguration.getProgressMonitorService();
437
    }
438

  
439
    /**
440
     * {@inheritDoc}
441
     */
442
    @Override
443
    public IMetadataService getMetadataService() {
444
        return defaultApplicationConfiguration.getMetadataService();
445
    }
446

  
447
	@Override
448
	public IPreferenceService getPreferenceService() {
449
		
450
		return defaultApplicationConfiguration.getPreferenceService();
451
	}
452
}
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientClassificationService.java
1
// $Id$
2
/**
3
* Copyright (C) 2013 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.editor.view.dataimport.transientServices;
11

  
12
import java.util.Collection;
13
import java.util.List;
14
import java.util.Map;
15
import java.util.Set;
16
import java.util.UUID;
17

  
18
import org.hibernate.LockOptions;
19
import org.hibernate.Session;
20
import org.hibernate.criterion.Criterion;
21
import org.hibernate.envers.query.criteria.AuditCriterion;
22

  
23
import eu.etaxonomy.cdm.api.service.DeleteResult;
24
import eu.etaxonomy.cdm.api.service.IClassificationService;
25
import eu.etaxonomy.cdm.api.service.NodeSortMode;
26
import eu.etaxonomy.cdm.api.service.UpdateResult;
27
import eu.etaxonomy.cdm.api.service.config.CreateHierarchyForClassificationConfigurator;
28
import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
29
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
30
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
31
import eu.etaxonomy.cdm.api.service.dto.GroupedTaxonDTO;
32
import eu.etaxonomy.cdm.api.service.dto.IdentifiedEntityDTO;
33
import eu.etaxonomy.cdm.api.service.dto.MarkedEntityDTO;
34
import eu.etaxonomy.cdm.api.service.dto.TaxonInContextDTO;
35
import eu.etaxonomy.cdm.api.service.pager.Pager;
36
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
37
import eu.etaxonomy.cdm.model.common.Annotation;
38
import eu.etaxonomy.cdm.model.common.DefinedTerm;
39
import eu.etaxonomy.cdm.model.common.ISourceable;
40
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
41
import eu.etaxonomy.cdm.model.common.LSID;
42
import eu.etaxonomy.cdm.model.common.Marker;
43
import eu.etaxonomy.cdm.model.common.MarkerType;
44
import eu.etaxonomy.cdm.model.media.MediaRepresentation;
45
import eu.etaxonomy.cdm.model.media.Rights;
46
import eu.etaxonomy.cdm.model.name.Rank;
47
import eu.etaxonomy.cdm.model.taxon.Classification;
48
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
49
import eu.etaxonomy.cdm.model.taxon.Taxon;
50
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
51
import eu.etaxonomy.cdm.model.view.AuditEvent;
52
import eu.etaxonomy.cdm.model.view.AuditEventRecord;
53
import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
54
import eu.etaxonomy.cdm.persistence.dto.ClassificationLookupDTO;
55
import eu.etaxonomy.cdm.persistence.dto.MergeResult;
56
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
57
import eu.etaxonomy.cdm.persistence.query.Grouping;
58
import eu.etaxonomy.cdm.persistence.query.MatchMode;
59
import eu.etaxonomy.cdm.persistence.query.OrderHint;
60
import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
61
import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
62
import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy;
63

  
64
/**
65
 * @author pplitzner
66
 * @date 27.09.2013
67
 *
68
 */
69
public class TransientClassificationService implements IClassificationService {
70

  
71
    private final IClassificationService defaultService;
72

  
73
    /**
74
     * @param defaultClassificationService
75
     */
76
    public TransientClassificationService(IClassificationService defaultClassificationService) {
77
        this.defaultService = defaultClassificationService;
78
    }
79

  
80
    /**
81
     * @param t
82
     * @param pageSize
83
     * @param pageNumber
84
     * @param sort
85
     * @param propertyPaths
86
     * @return
87
     * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(eu.etaxonomy.cdm.model.common.VersionableEntity, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
88
     */
89
    @Override
90
    public Pager<AuditEventRecord<Classification>> pageAuditEvents(Classification t, Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths) {
91
        return defaultService.pageAuditEvents(t, pageSize, pageNumber, sort, propertyPaths);
92
    }
93

  
94
    /**
95
     * @param annotatedObj
96
     * @param status
97
     * @param pageSize
98
     * @param pageNumber
99
     * @param orderHints
100
     * @param propertyPaths
101
     * @return
102
     * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getAnnotations(eu.etaxonomy.cdm.model.common.AnnotatableEntity, eu.etaxonomy.cdm.model.common.MarkerType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
103
     */
104
    @Override
105
    public Pager<Annotation> getAnnotations(Classification annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
106
        return defaultService.getAnnotations(annotatedObj, status, pageSize, pageNumber, orderHints, propertyPaths);
107
    }
108

  
109
    /**
110
     * @param uuid
111
     * @return
112
     * @see eu.etaxonomy.cdm.api.service.IClassificationService#getTaxonNodeByUuid(java.util.UUID)
113
     */
114
    @Override
115
    public TaxonNode getTaxonNodeByUuid(UUID uuid) {
116
        return defaultService.getTaxonNodeByUuid(uuid);
117
    }
118

  
119
    /**
120
     * @param uuid
121
     * @return
122
     * @see eu.etaxonomy.cdm.api.service.IClassificationService#getTreeNodeByUuid(java.util.UUID)
123
     */
124
    @Override
125
    public ITaxonTreeNode getTreeNodeByUuid(UUID uuid) {
126
        return defaultService.getTreeNodeByUuid(uuid);
127
    }
128

  
129
    /**
130
     *
131
     * @see eu.etaxonomy.cdm.api.service.IService#clear()
132
     */
133
    @Override
134
    public void clear() {
135
        defaultService.clear();
136
    }
137

  
138
    /**
139
     * @param limit
140
     * @param start
141
     * @param orderHints
142
     * @param propertyPaths
143
     * @return
144
     * @see eu.etaxonomy.cdm.api.service.IClassificationService#listClassifications(java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
145
     */
146
    @Override
147
    public List<Classification> listClassifications(Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)