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