[rhmessaging-commits] rhmessaging commits: r1391 - in mgmt: mint and 1 other directories.
rhmessaging-commits at lists.jboss.org
rhmessaging-commits at lists.jboss.org
Thu Nov 29 09:58:41 EST 2007
Author: justi9
Date: 2007-11-29 09:58:41 -0500 (Thu, 29 Nov 2007)
New Revision: 1391
Modified:
mgmt/cumin/python/cumin/__init__.py
mgmt/cumin/python/cumin/broker.py
mgmt/cumin/python/cumin/measurement.py
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/parameters.py
mgmt/mint/Makefile
mgmt/mint/python/mint/__init__.py
mgmt/mint/python/mint/schema.sql
Log:
Introduces management-side-only schema types such as BrokerGroup.
Makes all mint classes, management side or generated accessible via
the mint module.
Modified: mgmt/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/cumin/python/cumin/__init__.py 2007-11-29 14:57:02 UTC (rev 1390)
+++ mgmt/cumin/python/cumin/__init__.py 2007-11-29 14:58:41 UTC (rev 1391)
@@ -7,7 +7,6 @@
from wooly.devel import DevelPage
from wooly.parameters import IntegerParameter
from mint import *
-from mint.schema import *
from sqlobject.main import *
from model import DummyModel, CuminModel
Modified: mgmt/cumin/python/cumin/broker.py
===================================================================
--- mgmt/cumin/python/cumin/broker.py 2007-11-29 14:57:02 UTC (rev 1390)
+++ mgmt/cumin/python/cumin/broker.py 2007-11-29 14:58:41 UTC (rev 1391)
@@ -1,4 +1,4 @@
-import mint.schema as mint
+import mint
from wooly import *
from wooly.widgets import *
from random import random
Modified: mgmt/cumin/python/cumin/measurement.py
===================================================================
--- mgmt/cumin/python/cumin/measurement.py 2007-11-29 14:57:02 UTC (rev 1390)
+++ mgmt/cumin/python/cumin/measurement.py 2007-11-29 14:58:41 UTC (rev 1391)
@@ -1,6 +1,6 @@
from wooly import *
from wooly.widgets import *
-from mint.schema import *
+from mint import *
from widgets import *
from parameters import *
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-11-29 14:57:02 UTC (rev 1390)
+++ mgmt/cumin/python/cumin/model.py 2007-11-29 14:58:41 UTC (rev 1391)
@@ -1,4 +1,4 @@
-import mint.schema as mint
+import mint
from wooly import *
from wooly.model import *
Modified: mgmt/cumin/python/cumin/parameters.py
===================================================================
--- mgmt/cumin/python/cumin/parameters.py 2007-11-29 14:57:02 UTC (rev 1390)
+++ mgmt/cumin/python/cumin/parameters.py 2007-11-29 14:58:41 UTC (rev 1391)
@@ -1,5 +1,5 @@
from wooly import *
-from mint.schema import *
+from mint import *
class BrokerClusterParameter(Parameter):
def do_unmarshal(self, string):
Modified: mgmt/mint/Makefile
===================================================================
--- mgmt/mint/Makefile 2007-11-29 14:57:02 UTC (rev 1390)
+++ mgmt/mint/Makefile 2007-11-29 14:58:41 UTC (rev 1391)
@@ -16,4 +16,4 @@
python python/mint/schemaparser.py ${MINT_XML_SCHEMA} python/mint/schema.py ${dsn}
schema-sql: python/mint/schema.py
- sqlobject-admin sql -m mint.schema -c ${dsn} | sed -e '1,2d' > python/mint/schema.sql
+ sqlobject-admin sql -m mint -m mint.schema -c ${dsn} | sed -e '1,2d' > python/mint/schema.sql
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2007-11-29 14:57:02 UTC (rev 1390)
+++ mgmt/mint/python/mint/__init__.py 2007-11-29 14:58:41 UTC (rev 1391)
@@ -2,8 +2,45 @@
from datetime import *
from sqlobject import *
-import schema
+from mint import schema
+this_mod = __import__(__name__)
+
+for item in dir(schema):
+ cls = getattr(schema, item)
+
+ try:
+ if issubclass(cls, SQLObject) and cls is not SQLObject:
+ setattr(this_mod, item, cls)
+ except TypeError:
+ pass
+
+class BrokerRegistration(SQLObject):
+ name = StringCol(length=1000)
+ host = StringCol(length=1000)
+ port = SmallIntCol()
+ broker = ForeignKey("Broker", cascade="null", default=None)
+
+class BrokerGroup(SQLObject):
+ name = StringCol(length=1000)
+
+BrokerGroup.sqlmeta.addJoin(MultipleJoin("Broker", joinMethodName="brokers"))
+
+class BrokerCluster(SQLObject):
+ name = StringCol(length=1000)
+
+BrokerCluster.sqlmeta.addJoin(MultipleJoin("Broker", joinMethodName="brokers"))
+
+class BrokerProfile(SQLObject):
+ name = StringCol(length=1000)
+
+BrokerProfile.sqlmeta.addJoin(MultipleJoin("Broker", joinMethodName="brokers"))
+
+class ConfigProperty(SQLObject):
+ name = StringCol(length=1000)
+ value = StringCol(length=1000)
+ type = StringCol(length=1)
+
class OriginalIdDict:
def __init__(self):
self.idMap = dict()
@@ -86,7 +123,7 @@
# needs special handling until schema is sendind info about systems
d.pop("systemRef")
# d["system"] = connectedBroker.getByOriginalId(System, 0)
- d["system"] = schema.System.selectBy(idOriginal=0)[:1][0]
+ d["system"] = System.selectBy(idOriginal=0)[:1][0]
connectedBroker.objs.set(0, d["system"])
else:
parentKey = self.findParentKey(d)
Modified: mgmt/mint/python/mint/schema.sql
===================================================================
--- mgmt/mint/python/mint/schema.sql 2007-11-29 14:57:02 UTC (rev 1390)
+++ mgmt/mint/python/mint/schema.sql 2007-11-29 14:58:41 UTC (rev 1391)
@@ -1,3 +1,33 @@
+CREATE TABLE broker_cluster (
+ id SERIAL PRIMARY KEY,
+ name VARCHAR(1000)
+);
+
+CREATE TABLE broker_group (
+ id SERIAL PRIMARY KEY,
+ name VARCHAR(1000)
+);
+
+CREATE TABLE broker_profile (
+ id SERIAL PRIMARY KEY,
+ name VARCHAR(1000)
+);
+
+CREATE TABLE broker_registration (
+ id SERIAL PRIMARY KEY,
+ name VARCHAR(1000),
+ host VARCHAR(1000),
+ port SMALLINT,
+ broker_id INT
+);
+
+CREATE TABLE config_property (
+ id SERIAL PRIMARY KEY,
+ name VARCHAR(1000),
+ value VARCHAR(1000),
+ type VARCHAR(1)
+);
+
CREATE TABLE binding (
id SERIAL PRIMARY KEY,
id_original BIGINT,
@@ -337,6 +367,8 @@
vhost_id INT
);
+ALTER TABLE broker_registration ADD CONSTRAINT broker_id_exists FOREIGN KEY (broker_id) REFERENCES broker (id) ON DELETE SET NULL;
+
ALTER TABLE binding ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id) REFERENCES binding_stats (id) ON DELETE SET NULL;
ALTER TABLE binding ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id) REFERENCES binding_stats (id) ON DELETE SET NULL;
More information about the rhmessaging-commits
mailing list