Hi,
I am accessing the Sequoia controller using an example similar to
SimpleJmxClient.java. What is the necessary parameters and procedure to
replicate a database using the following method call:
proxy.replicateBackend("localhost","localhost3",new HashMap());
Currently it fails.
Thanks,
Jared
Rest of code...
public static void main(String[] args) throws Exception {
String port = "1090";
String host = "localhost";
String vdbName = "myDB";
JMXServiceURL address = new JMXServiceURL("rmi", host, 0, "/jndi/jrmp");
Map environment = new HashMap();
environment.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.rmi.registry.RegistryContextFactory");
environment.put(Context.PROVIDER_URL, "rmi://" + host + ":" + port);
// use username and password for authentication of connections
// with the controller, the values are compared to the ones
// specified in the controller.xml config file.
// this line is not required if no username/password is configured
environment.put(JMXConnector.CREDENTIALS, PasswordAuthenticator
.createCredentials("jmxuser", "jmxpassword"));
JMXConnector connector = JMXConnectorFactory.connect(address,
environment);
ObjectName db = JmxConstants.getVirtualDataBaseObjectName(vdbName);
// build a subject for authentication
VirtualDatabaseUser dbUser = new VirtualDatabaseUser("user", "");
AdminUser adminUser = new AdminUser("admin", "");
Set principals = new HashSet();
principals.add(adminUser);
principals.add(dbUser);
Subject subj = new Subject(true, principals, new HashSet(), new
HashSet());
// open a connection for this subject, all susequent calls with this
// connection will be executed on the behalf of our subject.
MBeanServerConnection delegateConnection;
delegateConnection = connector.getMBeanServerConnection(subj);
// create a proxy to the virtual database
VirtualDatabaseMBean proxy = (VirtualDatabaseMBean)
MBeanServerInvocationHandler
.newProxyInstance(delegateConnection, db,
VirtualDatabaseMBean.class, false);
System.out.println("JMX Controller Report...");
System.out.println("\n");
// we call a method on the virtual database
System.out.println("The Virtual Database name is: "
+ proxy.getVirtualDatabaseName());
}
proxy.replicateBackend("localhost","localhost3",new HashMap());
_______________________________________________
Sequoia mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/sequoia