CdmRemoteCacheManager : added cache getter methods
[taxeditor.git] / eu.etaxonomy.taxeditor.cdmlib / src / main / java / eu / etaxonomy / taxeditor / session / ICdmEntitySessionManager.java
1 package eu.etaxonomy.taxeditor.session;
2
3 import java.util.Collection;
4
5 import eu.etaxonomy.cdm.model.common.CdmBase;
6
7 public interface ICdmEntitySessionManager {
8
9 public abstract ICdmEntitySession newSession(ICdmEntitySessionEnabled sessionOwner, boolean setAsActive);
10
11 public abstract void bind(ICdmEntitySessionEnabled sessionOwner);
12
13 // public abstract <T extends Object> T load(
14 // ISessionEventListener sessionOwner, T obj);
15
16 public abstract <T extends Object> T load(T obj);
17
18 // public abstract <T extends CdmBase> T load(
19 // ISessionEventListener sessionOwner, T cdmBase);
20
21 public abstract <T extends CdmBase> T load(T cdmBase);
22
23 // public abstract <T extends CdmBase> Collection<T> load(
24 // ISessionEventListener sessionOwner, Collection<T> cdmBaseList);
25
26 public abstract <T extends CdmBase> Collection<T> load(Collection<T> cdmBaseList);
27
28 //public abstract void dispose(ICdmEntitySessionEnabled owner);
29
30 /**
31 * @return
32 */
33 public ICdmEntitySession getActiveSession();
34
35 public Collection<ICdmEntitySession> getSessions();
36
37 public void addSessionObserver(ICdmEntitySessionManagerObserver sessionObserver);
38
39 //FIXME:Remoting would be nice to have these methods working,
40 // but they can only be useful if we can 'intelligently'
41 // get from a model class to the correspoding service class
42
43 // @SuppressWarnings("unchecked")
44 // public abstract <T extends CdmBase> void addRootEntity(T cdmBase);
45 //
46 // @SuppressWarnings("unchecked")
47 // public abstract <T extends Object> void addRootEntities(
48 // Collection<T> cdmBaseList);
49
50 // public abstract void commit();
51 //
52 // public abstract void commit(ISessionEventListener sessionOwner);
53 //
54 // public abstract void commit(IService service, CdmBase cdmBase);
55
56
57 public boolean isRemoting();
58
59
60 }