00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 package org.objectweb.cjdbc.console.text.commands.dbadmin;
00026
00027 import java.util.StringTokenizer;
00028
00029 import org.objectweb.cjdbc.common.i18n.ConsoleTranslate;
00030 import org.objectweb.cjdbc.common.jmx.mbeans.VirtualDatabaseMBean;
00031 import org.objectweb.cjdbc.console.text.ConsoleException;
00032 import org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin;
00033
00034
00035
00036
00037
00038
00039
00040 public class SetCheckpoint extends AbstractAdminCommand
00041 {
00042
00043
00044
00045
00046
00047
00048 public SetCheckpoint(VirtualDatabaseAdmin module)
00049 {
00050 super(module);
00051 }
00052
00053
00054
00055
00056 public void parse(String commandText) throws Exception
00057 {
00058 StringTokenizer st = new StringTokenizer(commandText);
00059 if (st.countTokens() != 2)
00060 throw new ConsoleException(ConsoleTranslate
00061 .get("console.error.invalid.comment.argument"));
00062 String backendName = st.nextToken();
00063 String checkpointName = st.nextToken();
00064 console.println(ConsoleTranslate.get("admin.command.set.checkpoint.echo",
00065 new String[]{backendName, checkpointName}));
00066 VirtualDatabaseMBean vdjc = jmxClient.getVirtualDatabaseProxy(dbName, user,
00067 password);
00068 vdjc.setBackendLastKnownCheckpoint(backendName, checkpointName);
00069 }
00070
00071
00072
00073
00074 public String getCommandName()
00075 {
00076 return "setCheckpoint";
00077 }
00078
00079
00080
00081
00082 public String getCommandDescription()
00083 {
00084 return ConsoleTranslate.get("admin.command.set.checkpoint");
00085 }
00086
00087
00088
00089
00090 public String getCommandParameters()
00091 {
00092 return "<backendName> <checkpoint>";
00093 }
00094 }