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

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

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

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

Detailed Description

This class defines a EnableWrite

Author:
Nicolas Modrzyk
Version:
1.0

Definition at line 41 of file EnableWrite.java.


Constructor & Destructor Documentation

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

Creates a new EnableWrite object

Parameters:
module owning module

Definition at line 49 of file EnableWrite.java.

00050   {
00051     super(module);
00052   }


Member Function Documentation

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

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

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

Definition at line 95 of file EnableWrite.java.

00096   {
00097     return ConsoleTranslate.get("admin.command.enable.write");
00098   }

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

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

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

Definition at line 87 of file EnableWrite.java.

00088   {
00089     return "enableWrite";
00090   }

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

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

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

Definition at line 103 of file EnableWrite.java.

00104   {
00105     return "<backendName>";
00106   }

void org.objectweb.cjdbc.console.text.commands.dbadmin.EnableWrite.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 57 of file EnableWrite.java.

References org.objectweb.cjdbc.common.jmx.mbeans.VirtualDatabaseMBean.enableBackendFromCheckpoint(), org.objectweb.cjdbc.common.jmx.mbeans.DatabaseBackendMBean.enableWrite(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.getDatabaseBackendProxy(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.getVirtualDatabaseProxy(), org.objectweb.cjdbc.common.jmx.mbeans.VirtualDatabaseMBean.hasRecoveryLog(), org.objectweb.cjdbc.common.jmx.mbeans.DatabaseBackendMBean.isWriteEnabled(), and org.objectweb.cjdbc.console.text.Console.println().

00058   {
00059     StringTokenizer st = new StringTokenizer(commandText);
00060     if (st.countTokens() != 1)
00061       throw new ConsoleException(ConsoleTranslate
00062           .get("console.error.invalid.comment.argument"));
00063     String backendName = st.nextToken();
00064     console.println(ConsoleTranslate.get("admin.command.enable.write.echo",
00065         backendName));
00066     VirtualDatabaseMBean vdjc = jmxClient.getVirtualDatabaseProxy(dbName, user,
00067         password);
00068     DatabaseBackendMBean mbean = jmxClient.getDatabaseBackendProxy(dbName,
00069         backendName, user, password);
00070     if(vdjc.hasRecoveryLog())
00071     {
00072       if(mbean.isWriteEnabled())
00073         return;
00074         vdjc.enableBackendFromCheckpoint(backendName);
00075     }
00076     else
00077     {
00078       mbean.enableWrite();
00079     }
00080       
00081 
00082   }


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