Author: nunofsantos
Date: 2008-04-23 16:55:45 -0400 (Wed, 23 Apr 2008)
New Revision: 1969
Modified:
mgmt/mint/python/mint/__init__.py
mgmt/mint/python/mint/schema.py
mgmt/mint/python/mint/schemaparser.py
mgmt/mint/sql/schema.sql
Log:
handle updated schema; provide access to sessionId
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-04-23 19:31:21 UTC (rev 1968)
+++ mgmt/mint/python/mint/__init__.py 2008-04-23 20:55:45 UTC (rev 1969)
@@ -206,6 +206,12 @@
finally:
self.model.lock.release()
+ def getSessionId(self):
+ if isOpen(self):
+ return self.mchan.sessionId
+ else:
+ return None
+
def callMethod(self, objId, className, methodName, callback, args):
self.model.lock.acquire()
try:
Modified: mgmt/mint/python/mint/schema.py
===================================================================
--- mgmt/mint/python/mint/schema.py 2008-04-23 19:31:21 UTC (rev 1968)
+++ mgmt/mint/python/mint/schema.py 2008-04-23 20:55:45 UTC (rev 1969)
@@ -13,7 +13,7 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('SystemStats', cascade='null', default=None)
statsPrev = ForeignKey('SystemStats', cascade='null', default=None)
- sysId = StringCol(length=1000, default=None)
+ sysId = StringCol(default=None)
osName = StringCol(length=1000, default=None)
nodeName = StringCol(length=1000, default=None)
release = StringCol(length=1000, default=None)
@@ -187,6 +187,7 @@
durable = BoolCol(default=None)
autoDelete = BoolCol(default=None)
exclusive = BoolCol(default=None)
+ arguments = StringCol(length=4000, default=None)
classInfos = dict() # brokerId => classInfo
@@ -316,6 +317,7 @@
exchange = ForeignKey('Exchange', cascade='null', default=None)
queue = ForeignKey('Queue', cascade='null', default=None)
bindingKey = StringCol(length=1000, default=None)
+ arguments = StringCol(length=4000, default=None)
classInfos = dict() # brokerId => classInfo
Modified: mgmt/mint/python/mint/schemaparser.py
===================================================================
--- mgmt/mint/python/mint/schemaparser.py 2008-04-23 19:31:21 UTC (rev 1968)
+++ mgmt/mint/python/mint/schemaparser.py 2008-04-23 20:55:45 UTC (rev 1969)
@@ -30,6 +30,7 @@
self.dataTypesMap["absTime"] = self.dataTypesMap["deltaTime"] =
"BigIntCol"
self.dataTypesMap["bool"] = "BoolCol"
self.dataTypesMap["sstr"] = self.dataTypesMap["lstr"] =
"StringCol"
+ self.dataTypesMap["ftable"] = "StringCol"
def attrNameFromDbColumn(self, name, removeSuffix=""):
return self.style.dbColumnToPythonAttr(name.replace(removeSuffix, ""))
@@ -75,9 +76,11 @@
for elem in elements:
if (elem["(a)name"].endswith("Ref")):
reference =
self.style.dbTableToPythonClass(elem["(a)name"]).replace("Ref",
"")
- attrib = reference[0].lower() + reference[1:]
- self.generateForeignKeyAttrib(attrib, reference)
- self.generateMultipleJoin(reference, self.currentClass)
+ if (reference != "Store"):
+ #FIX
+ attrib = reference[0].lower() + reference[1:]
+ self.generateForeignKeyAttrib(attrib, reference)
+ self.generateMultipleJoin(reference, self.currentClass)
elif (elem["(a)type"].startswith("hilo")):
self.generateHiLoAttrib(self.attrNameFromDbColumn(elem["@name"]),
self.dataTypesMap[elem["@type"]])
elif (elem["(a)type"].startswith("mma")):
@@ -86,7 +89,7 @@
args = ""
if (elem["@type"] == "sstr"):
args += "length=1000"
- elif (elem["@type"] == "lstr"):
+ elif (elem["@type"] == "lstr" or elem["@type"] ==
"ftable"):
args += "length=4000"
self.generateAttrib(self.attrNameFromDbColumn(elem["@name"]),
self.dataTypesMap[elem["@type"]], args)
Modified: mgmt/mint/sql/schema.sql
===================================================================
--- mgmt/mint/sql/schema.sql 2008-04-23 19:31:21 UTC (rev 1968)
+++ mgmt/mint/sql/schema.sql 2008-04-23 20:55:45 UTC (rev 1969)
@@ -80,7 +80,8 @@
stats_prev_id INT,
exchange_id INT,
queue_id INT,
- binding_key VARCHAR(1000)
+ binding_key VARCHAR(1000),
+ arguments VARCHAR(4000)
);
CREATE TABLE binding_stats (
@@ -315,7 +316,8 @@
name VARCHAR(1000),
durable BOOL,
auto_delete BOOL,
- exclusive BOOL
+ exclusive BOOL,
+ arguments VARCHAR(4000)
);
CREATE TABLE queue_stats (
@@ -403,7 +405,7 @@
managed_broker VARCHAR(1000),
stats_curr_id INT,
stats_prev_id INT,
- sys_id VARCHAR(1000),
+ sys_id TEXT,
os_name VARCHAR(1000),
node_name VARCHAR(1000),
release VARCHAR(1000),