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

org.objectweb.cjdbc.console.text.commands.dbadmin.Enable Class Reference

Inheritance diagram for org.objectweb.cjdbc.console.text.commands.dbadmin.Enable:

Inheritance graph
[legend]
Collaboration diagram for org.objectweb.cjdbc.console.text.commands.dbadmin.Enable:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Enable (VirtualDatabaseAdmin module)
void parse (String commandText) throws Exception
String getCommandName ()
String getCommandDescription ()
String getCommandParameters ()

Detailed Description

This class defines a Enable

Author:
Nicolas Modrzyk
Version:
1.0

Definition at line 40 of file Enable.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.console.text.commands.dbadmin.Enable.Enable VirtualDatabaseAdmin  module  ) 
 

Creates a new Enable.java object

Parameters:
module the command is attached to

Definition at line 48 of file Enable.java.

00049   {
00050     super(module);
00051   }


Member Function Documentation

String org.objectweb.cjdbc.console.text.commands.dbadmin.Enable.getCommandDescription  )  [virtual]
 

See also:
org.objectweb.cjdbc.console.text.commands.ConsoleCommand.getCommandDescription()

Implements org.objectweb.cjdbc.console.text.commands.ConsoleCommand.

Definition at line 101 of file Enable.java.

00102   {
00103     return ConsoleTranslate.get("admin.command.enable");
00104   }

String org.objectweb.cjdbc.console.text.commands.dbadmin.Enable.getCommandName  )  [virtual]
 

See also:
org.objectweb.cjdbc.console.text.commands.ConsoleCommand.getCommandName()

Implements org.objectweb.cjdbc.console.text.commands.ConsoleCommand.

Definition at line 92 of file Enable.java.

00093   {
00094 
00095     return "enable";
00096   }

String org.objectweb.cjdbc.console.text.commands.dbadmin.Enable.getCommandParameters  ) 
 

See also:
org.objectweb.cjdbc.console.text.commands.ConsoleCommand.getCommandParameters()

Reimplemented from org.objectweb.cjdbc.console.text.commands.ConsoleCommand.

Definition at line 109 of file Enable.java.

00110   {
00111     return "<backend> [<checkpoint>]";
00112   }

void org.objectweb.cjdbc.console.text.commands.dbadmin.Enable.parse String  commandText  )  throws Exception [virtual]
 

See also:
org.objectweb.cjdbc.console.text.commands.ConsoleCommand.parse(java.lang.String)

Implements org.objectweb.cjdbc.console.text.commands.ConsoleCommand.

Definition at line 56 of file Enable.java.

References org.objectweb.cjdbc.common.jmx.mbeans.VirtualDatabaseMBean.enableBackend(), org.objectweb.cjdbc.common.jmx.mbeans.VirtualDatabaseMBean.enableBackendFromCheckpoint(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.getVirtualDatabaseProxy(), and org.objectweb.cjdbc.console.text.Console.println().

00057   {
00058     String checkpoint = null;
00059     String backendName = null;
00060     StringTokenizer st = new StringTokenizer(commandText.trim());
00061 
00062     try
00063     {
00064       backendName = st.nextToken();
00065     }
00066     catch (Exception e)
00067     {
00068       throw new ConsoleException("admin.command.enable.need.backend");
00069     }
00070     if (st.hasMoreTokens())
00071       checkpoint = st.nextToken();
00072     VirtualDatabaseMBean vdjc = jmxClient.getVirtualDatabaseProxy(dbName, user,
00073         password);
00074     if (checkpoint == null)
00075     {
00076       console.println(ConsoleTranslate.get(
00077           "admin.command.enable.no.checkpoint", backendName));
00078       vdjc.enableBackend(backendName);
00079     }
00080     else
00081     {
00082       console.println(ConsoleTranslate.get(
00083           "admin.command.enable.with.checkpoint", new String[]{backendName,
00084               checkpoint}));
00085       vdjc.enableBackendFromCheckpoint(backendName);
00086     }
00087   }


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