3 * Copyright (C) 2014 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
.service
;
12 import java
.util
.UUID
;
14 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
15 import eu
.etaxonomy
.taxeditor
.remoting
.cache
.ProxyUtils
.CollectionField
;
22 public interface ICachedCommonService
{
24 public CdmBase
find(Class
<?
extends CdmBase
> clazz
, int id
);
26 public void updatePersistentCollection(CollectionField colf
);
29 * Initializes a collection or map.
31 * @param ownerUuid uuid of owner cdm entity
32 * @param fieldName field name of collection or map
33 * @return initialised collection or map
35 public Object
initializeCollection(UUID ownerUuid
, String fieldName
);
38 * Checks if a collection or map is empty.
40 * @param ownerUuid uuid of owner cdm entity
41 * @param fieldName field name of collection or map
42 * @return true if the collection of map is empty, else false
44 public boolean isEmpty(UUID ownerUuid
, String fieldName
);
47 * Returns the size of requested collection or map.
49 * @param ownerUuid uuid of owner cdm entity
50 * @param fieldName field name of collection or map
51 * @return the size of the persistent collection
53 public int size(UUID ownerUuid
, String fieldName
);
56 * Checks whether an object is contained within a persistent collection.
58 * @param ownerUuid uuid of owner cdm entity
59 * @param fieldName field name of collection or map
60 * @param element the element to check for
61 * @return true if the element exists in the collection, false o/w
63 public boolean contains(UUID ownerUuid
, String fieldName
, Object element
);
66 * Checks whether an index object exists within a persistent collection
69 * @param ownerUuid uuid of owner cdm entity
70 * @param fieldName field name of map
71 * @param key the index object to look for.
72 * @return true if the index object exists in the collection, false o/w
74 public boolean containsKey(UUID ownerUuid
, String fieldName
, Object key
);
77 * checks whether an value object exists within a persistent collection
80 * @param ownerUuid uuid of owner cdm entity
81 * @param fieldName field name of map
82 * @param key the value object to look for.
83 * @return true if the value object exists in the collection, false o/w
85 public boolean containsValue(UUID ownerUuid
, String fieldName
, Object element
);