debug as far as test marshalling - a vorbaIdFactory is now required.
[vamsas.git] / src / org / vamsas / client / simpleclient / SimpleClientFactory.java
1 package org.vamsas.client.simpleclient;
2
3 import java.io.File;
4 import java.io.IOException;
5
6 import org.vamsas.client.ClientHandle;
7 import org.vamsas.client.IClient;
8 import org.vamsas.client.IClientFactory;
9 import org.vamsas.client.UserHandle;
10
11 /**
12  * TODO document type SimpleClientFactory
13  * @author jimp
14  *
15  */
16 public class SimpleClientFactory implements IClientFactory {
17  
18   File sessionArena;
19   
20   /**
21    * default constructor - called by CreateClientFactory only.
22    *
23    */
24   public SimpleClientFactory() {
25     sessionArena = null;
26   }
27   /**
28    * Create a client factory that works with sessions at the given
29    * path.
30    * @param path
31    */
32   public SimpleClientFactory(String path) throws IOException {
33     // Check path is valid and read/writeable.
34     File newarena = new File(path);
35     if (newarena.isDirectory() && newarena.canRead() && newarena.canWrite()) {
36       sessionArena = newarena;
37     } else {
38       sessionArena = null;
39       throw(new IOException("Cannot read and write to a directory called "+path));
40     }
41   }
42   /* (non-Javadoc)
43    * @see org.vamsas.client.IClientFactory#getIClient(org.vamsas.client.ClientHandle)
44    */
45   public IClient getIClient(ClientHandle applicationHandle) {
46     // create a new session
47     // register new ClientHandle in session
48     // create SimpleClient instance
49     return null;
50   }
51
52   /* (non-Javadoc)
53    * @see org.vamsas.client.IClientFactory#getIClient(org.vamsas.client.ClientHandle, java.lang.String)
54    */
55   public IClient getIClient(ClientHandle applicationHandle, String sessionUrn) {
56     // locate session from Urn
57     // check that clientHandle is unique (with default user) - if not update the clientHandle urn to make it unique.
58     // wait for lock and attach to session
59     // create SimpleClient instance
60     return null;
61   }
62
63   /* (non-Javadoc)
64    * @see org.vamsas.client.IClientFactory#getIClient(org.vamsas.client.ClientHandle, org.vamsas.client.UserHandle, java.lang.String)
65    */
66   public IClient getIClient(ClientHandle applicationHandle, UserHandle userId,
67       String sessionUrn) {
68     // locate session from Urn
69     // check Uniqueness of user + ClientHandle in the session. Update clientHandle urn accordingly.
70     // wait for lock, attach to session
71     // create client instance
72     return null;
73   }
74
75   /* (non-Javadoc)
76    * @see org.vamsas.client.IClientFactory#getIClient(org.vamsas.client.ClientHandle, org.vamsas.client.UserHandle)
77    */
78   public IClient getIClient(ClientHandle applicationHandle, UserHandle userId) {
79     // create new session
80     // register SimpleClient and UserHandles in session
81     // create client instance
82     return null;
83   }
84
85   public static void main(String[] args) {
86   }
87 }