f70a3ddf12946c15e2de9a03db2230b044347c3f
[vamsas.git] / src / uk / ac / vamsas / objects / IVorbaBinding.java
1 /**\r
2  * \r
3  */\r
4 package uk.ac.vamsas.objects;\r
5 \r
6 import uk.ac.vamsas.client.Vobject;\r
7 import uk.ac.vamsas.client.VorbaId;\r
8 \r
9 /**\r
10  * Provides methods to map between VorbaIds and arbitrary object references\r
11  * for use by a vamsas Application when moving between its own datamodel and the\r
12  * Vamsas session objects.\r
13  * The implementing class needs a valid client-document instance if it is expected\r
14  * to be able to register newly created vObjects. Normally this will be the case if\r
15  * the implementing class has been generated by an IClient implementation which will\r
16  * also have passed it a reference to the current valid IClientDocument instance for\r
17  * that application's document access thread. \r
18  * TODO: add remove/clear binding functions - currently you can just pass a null\r
19  * to either argument for bindAppsObjectToVamsasObject to remove the binding from memory. \r
20  * @author JimP\r
21  * \r
22  */\r
23 public interface IVorbaBinding {\r
24 /**\r
25  * get the Vamsas session object bound to an internal object.\r
26  * @param appObject\r
27  * @return valid session object or Null.\r
28  */\r
29   Vobject getVamsasObjectFor(Object appObject);\r
30   /**\r
31    * Get the Application's own object bound to an existing Vamsas session object\r
32    * @param vObject - object in vamsas document\r
33    * @return apps object bound to the vamsas document object\r
34    */\r
35   Object getAppsObjectFor(uk.ac.vamsas.client.Vobject vObject);\r
36 \r
37   /**\r
38    * Record a mapping between a vamsas document object and an application's internal object.\r
39    * If either appObject or vObject parameters are null then any existing \r
40    * binding to the non-null object will be deleted\r
41    * @param appObject\r
42    * @param vObject - if newly created then it will be registered using the uk.ac.vamsas.client.IClientDocument.registerObject method.\r
43    */\r
44   void bindAppsObjectToVamsasObject(Object appObject, uk.ac.vamsas.client.Vobject vObject);\r
45 }\r