Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin Class Reference

Inheritance diagram for org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin:

Inheritance graph
[legend]
Collaboration diagram for org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin:

Collaboration graph
[legend]
List of all members.

Public Member Functions

String getLogin ()
String getPassword ()
String getVirtualDbName ()
void login (String[] params)
String getDescriptionString ()
String getPromptString ()
 VirtualDatabaseAdmin (Console console)

Protected Member Functions

void loadCommands ()

Detailed Description

This is the C-JDBC controller console virtual database administration module.

Author:
Emmanuel Cecchet

Mathieu Peltier

Nicolas Modrzyk

Version:
1.0

Definition at line 62 of file VirtualDatabaseAdmin.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin.VirtualDatabaseAdmin Console  console  ) 
 

Creates a new VirtualDatabaseAdmin instance.

Parameters:
console console console

Definition at line 215 of file VirtualDatabaseAdmin.java.

00216   {
00217     super(console);
00218   }


Member Function Documentation

String org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin.getDescriptionString  )  [virtual]
 

See also:
org.objectweb.cjdbc.console.text.module.AbstractConsoleModule.getDescriptionString()

Implements org.objectweb.cjdbc.console.text.module.AbstractConsoleModule.

Definition at line 167 of file VirtualDatabaseAdmin.java.

00168   {
00169     return "VirtualDatabase Administration";
00170   }

String org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin.getLogin  ) 
 

Returns the login value.

Returns:
Returns the login.

Definition at line 71 of file VirtualDatabaseAdmin.java.

Referenced by org.objectweb.cjdbc.console.text.commands.dbadmin.AbstractAdminCommand.AbstractAdminCommand().

00072   {
00073     return login;
00074   }

String org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin.getPassword  ) 
 

Returns the password value.

Returns:
Returns the password.

Definition at line 81 of file VirtualDatabaseAdmin.java.

Referenced by org.objectweb.cjdbc.console.text.commands.dbadmin.AbstractAdminCommand.AbstractAdminCommand().

00082   {
00083     return password;
00084   }

String org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin.getPromptString  )  [virtual]
 

See also:
org.objectweb.cjdbc.console.text.module.AbstractConsoleModule.getPromptString()

Implements org.objectweb.cjdbc.console.text.module.AbstractConsoleModule.

Definition at line 175 of file VirtualDatabaseAdmin.java.

00176   {
00177     return virtualDbName + "(" + login + ")";
00178   }

String org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin.getVirtualDbName  ) 
 

Returns the virtualDbName value.

Returns:
Returns the virtualDbName.

Definition at line 91 of file VirtualDatabaseAdmin.java.

Referenced by org.objectweb.cjdbc.console.text.commands.dbadmin.AbstractAdminCommand.AbstractAdminCommand().

00092   {
00093     return virtualDbName;
00094   }

void org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin.loadCommands  )  [protected, virtual]
 

See also:
org.objectweb.cjdbc.console.text.module.AbstractConsoleModule.loadCommands()

Implements org.objectweb.cjdbc.console.text.module.AbstractConsoleModule.

Definition at line 183 of file VirtualDatabaseAdmin.java.

Referenced by org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin.login().

00184   {
00185     commands.clear();
00186     commands.add(new Help(this));
00187     commands.add(new History(this));
00188     commands.add(new Quit(this));
00189     commands.add(new Backup(this));
00190     commands.add(new Disable(this));
00191     commands.add(new DisableRead(this));
00192     commands.add(new DisableAll(this));
00193     commands.add(new Enable(this));
00194     commands.add(new EnableRead(this));
00195     commands.add(new EnableAll(this));
00196     commands.add(new GetBackendSchema(this));
00197     commands.add(new Native(this));
00198     commands.add(new RemoveCheckpoint(this));
00199     commands.add(new RemoveDumpFile(this));
00200     commands.add(new Replicate(this));
00201     commands.add(new Restore(this));
00202     commands.add(new TransferBackend(this));
00203     commands.add(new ShowBackends(this));
00204     commands.add(new ShowBackendState(this));
00205     commands.add(new SetCheckpoint(this));
00206     commands.add(new ViewCheckpointNames(this));
00207     commands.add(new ViewDumpNames(this));
00208   }

void org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin.login String[]  params  )  [virtual]
 

See also:
org.objectweb.cjdbc.console.text.module.AbstractConsoleModule.login(java.lang.String[])

Implements org.objectweb.cjdbc.console.text.module.AbstractConsoleModule.

Definition at line 99 of file VirtualDatabaseAdmin.java.

References org.objectweb.cjdbc.common.jmx.mbeans.VirtualDatabaseMBean.checkAdminAuthentication(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.getControllerProxy(), org.objectweb.cjdbc.console.text.Console.getJmxClient(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.getVirtualDatabaseProxy(), org.objectweb.cjdbc.common.jmx.mbeans.ControllerMBean.hasVirtualDatabase(), org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin.loadCommands(), org.objectweb.cjdbc.console.text.Console.printError(), org.objectweb.cjdbc.console.text.Console.println(), org.objectweb.cjdbc.console.text.module.AbstractConsoleModule.quit(), org.objectweb.cjdbc.console.text.Console.readLine(), and org.objectweb.cjdbc.console.text.Console.readPassword().

00100   {
00101     // In case a login has failed before
00102     quit = false;
00103     String vdbName = params[0];
00104     try
00105     {
00106       if (vdbName == null || vdbName.trim().equals(""))
00107       {
00108         vdbName = console.readLine(ConsoleTranslate.get("admin.login.dbname"));
00109         if (vdbName == null)
00110           return;
00111       }
00112 
00113       login = console.readLine(ConsoleTranslate.get("admin.login.user"));
00114       if (login == null)
00115         return;
00116 
00117       password = console.readPassword(ConsoleTranslate
00118           .get("admin.login.password"));
00119       if (password == null)
00120         return;
00121 
00122       try
00123       {
00124         ControllerMBean mbean = console.getJmxClient().getControllerProxy();
00125         if (!mbean.hasVirtualDatabase(vdbName))
00126         {
00127           console.printError(ConsoleTranslate.get("module.database.invalid",
00128               vdbName));
00129           quit();
00130           return;
00131         }
00132         VirtualDatabaseMBean vdb = console.getJmxClient()
00133             .getVirtualDatabaseProxy(vdbName, login, password);
00134         if (!vdb.checkAdminAuthentication(login, password))
00135         {
00136           console.printError(ConsoleTranslate.get("module.database.login.fail",
00137               login));
00138           quit();
00139         }
00140       }
00141       catch (Exception e)
00142       {
00143         // does not exists: quit
00144         console.printError(ConsoleTranslate.get("module.database.invalid",
00145             vdbName), e);
00146         quit();
00147       }
00148       this.virtualDbName = vdbName;
00149       if (quit)
00150         return;
00151 
00152       // Reload commands because target has changed
00153       loadCommands();
00154       console.println(ConsoleTranslate.get("admin.login.ready", virtualDbName));
00155     }
00156     catch (Exception e)
00157     {
00158       console.printError(e.getMessage(), e);
00159       quit();
00160     }
00161 
00162   }


The documentation for this class was generated from the following file:
Generated on Mon Apr 11 22:03:11 2005 for C-JDBC by  doxygen 1.3.9.1