Commit 51a2ce6a authored by afreyssin's avatar afreyssin

Administration API.

parent 8640cad2
......@@ -26,6 +26,7 @@
#include "Xoram.H"
#include "Message.H"
#include "Destination.H"
#include "XoramAdmin.H"
#include "XoramWrapper.H"
//##############################################################
......@@ -107,6 +108,35 @@ char* create_queue(char* id, char* name) {
return (char*) queue;
}
/*
char* create_queue() {
if (WRAPPER_DEBUG)
printf("XoramWrapper: create_queue()\n");
Queue* queue = XoramAdmin::createQueue();
if (WRAPPER_DEBUG)
printf("XoramWrapper: create_queue queue = 0x%x\n", queue);
return (char*) queue;
}
char* create_queue(char* name) {
if (WRAPPER_DEBUG)
printf("XoramWrapper: create_queue(%s)\n", name);
Queue* queue = XoramAdmin::createQueue(name);
if (WRAPPER_DEBUG)
printf("XoramWrapper: create_queue queue = 0x%x\n", queue);
return (char*) queue;
}
char* create_queue(int serverId) {
if (WRAPPER_DEBUG)
printf("XoramWrapper: create_queue(%d)\n", serverId);
Queue* queue = XoramAdmin::createQueue(serverId);
if (WRAPPER_DEBUG)
printf("XoramWrapper: create_queue queue = 0x%x\n", queue);
return (char*) queue;
}
*/
char* create_topic(char* id, char* name) {
// id = "#0.0.1026", name = "topic"
if (WRAPPER_DEBUG)
......
......@@ -24,15 +24,29 @@
#include <stdio.h>
#include "XoramWrapper.H"
#include "XoramAdmin.H"
int main(int argc, char *argv[]) {
XoramAdmin* admin = new XoramAdmin();
admin->connect("root", "root", 60);
// create destination
Queue* xqueue = admin->createQueue("queue");
// set right
admin->setFreeReading(xqueue);
admin->setFreeWriting(xqueue);
// create "anonymous" user
admin->createUser("anonymous", "anonymous");
admin->disconnect();
char* cf = create_tcp_connection_factory("localhost", 16010);
char* cnx = create_connection(cf, "anonymous", "anonymous");
start_connection(cnx);
char* sess = create_session(cnx);
char* queue = create_queue("#0.0.1026", "queue");
char* queue = create_queue(xqueue.getUID(), xqueue.getName());
char* prod = create_producer(sess, queue);
char* cons = create_consumer(sess, queue);
printf("prod = %x, cons = %x\n", prod, cons);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment