KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > rmi > RmiUser


1 package com.daffodilwoods.rmi;
2
3 import java.util.ArrayList JavaDoc;
4 import com.daffodilwoods.database.resource.DException;
5 import com.daffodilwoods.daffodildb.server.serversystem._Connection;
6 import java.util.Properties JavaDoc;
7 import com.daffodilwoods.daffodildb.server.datadictionarysystem.information._DatabaseInformation;
8 import com.daffodilwoods.daffodildb.server.serversystem._User;
9 import com.daffodilwoods.rmi.interfaces.*;
10 import com.daffodilwoods.database.resource.DException;
11 import java.rmi.RemoteException JavaDoc;
12 public class RmiUser implements _User{
13     _RmiUser user_interface;
14
15     public RmiUser(_RmiUser user_interface) {
16         this.user_interface = user_interface;
17     }
18     public String JavaDoc getUserName() {
19         try {
20             return user_interface.getUserName();
21         }catch(RemoteException JavaDoc re ) {
22             throw new RuntimeException JavaDoc(re.getMessage());
23         }
24     }
25     public ArrayList JavaDoc getAllDatabases()throws DException {
26         try {
27             return user_interface.getAllDatabases();
28         }catch(RemoteException JavaDoc re ) {
29             throw new RuntimeException JavaDoc(re.getMessage());
30         }
31     }
32     public _Connection getConnection(String JavaDoc databaseName, Properties JavaDoc prop) throws DException{
33         try {
34             return new RmiConnection( user_interface.getConnection(databaseName , prop) );
35         }catch(RemoteException JavaDoc re ) {
36             throw new RuntimeException JavaDoc(re.getMessage());
37         }
38
39     }
40     public _DatabaseInformation getDatabaseInformation(String JavaDoc databaseName)throws DException {
41         try {
42             return new RmiDatabaseInformation(user_interface.getDatabaseInformation(databaseName));
43         }catch(RemoteException JavaDoc re ) {
44             throw new RuntimeException JavaDoc(re.getMessage());
45         }
46     }
47     public ArrayList JavaDoc getAllSessions(String JavaDoc databaseName)throws DException {
48         try {
49             return user_interface.getAllSessions(databaseName);
50         }catch(RemoteException JavaDoc re ) {
51             throw new RuntimeException JavaDoc(re.getMessage());
52         }
53     }
54
55     public void createDatabase(String JavaDoc databaseName,Properties JavaDoc prop) throws DException{
56           try {
57                   user_interface.createDatabase(databaseName,prop);
58           }catch(RemoteException JavaDoc re ) {
59                   throw new RuntimeException JavaDoc(re.getMessage());
60           }
61
62     }
63
64     public void refersh() {
65           try {
66                   user_interface.refresh();
67           }catch(RemoteException JavaDoc re ) {
68           }
69
70     }
71
72     public void dropDatabase(String JavaDoc databaseName) throws DException{
73           try {
74                   user_interface.dropDatabase(databaseName);
75           }catch(RemoteException JavaDoc re ) {
76                  throw new RuntimeException JavaDoc(re.getMessage());
77           }
78     }
79
80     public void setUserName(String JavaDoc userName0){
81           try {
82                   user_interface.setUserName(userName0);
83           }catch(RemoteException JavaDoc re ) {
84           }
85     }
86
87     public void setPassword(String JavaDoc passWord0){
88           try {
89                   user_interface.setPassword(passWord0);
90           }catch(RemoteException JavaDoc re ) {
91           }
92     }
93 }
94
Popular Tags