クラス org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule

すべてのメンバ一覧

説明

This class implements a SQL monitoring rule.

作者:
Emmanuel Cecchet
バージョン:
1.0

SQLMonitoringRule.java37 行で定義されています。

Public メソッド

 SQLMonitoringRule (String queryPattern, boolean isCaseSentive, boolean applyToSkeleton, boolean monitoring)
boolean isCaseSentive ()
boolean isMonitoring ()
String getQueryPattern ()
void setCaseSentive (boolean b)
void setMonitoring (boolean b)
void setQueryPattern (String queryPattern)
boolean isApplyToSkeleton ()
void setApplyToSkeleton (boolean b)
String matches (AbstractRequest request)
String getXml ()

Private 変数

RE queryPattern
boolean isCaseSentive
boolean applyToSkeleton
boolean monitoring


コンストラクタとデストラクタ

org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.SQLMonitoringRule String  queryPattern,
boolean  isCaseSentive,
boolean  applyToSkeleton,
boolean  monitoring
 

Creates a new SQL Monitoring rule

引数:
queryPattern the query pattern to match
isCaseSentive true if matching is case sensitive
applyToSkeleton true if matching applies to the query skeleton
monitoring true if the request must be monitored

SQLMonitoringRule.java52 行で定義されています。

00057   {
00058     try
00059     {
00060       this.queryPattern = new RE(queryPattern);
00061     }
00062     catch (RESyntaxException e)
00063     {
00064       throw new RuntimeException(
00065         "Invalid regexp in SQL Monitoring rule (" + e + ")");
00066     }
00067     this.isCaseSentive = isCaseSentive;
00068     if (isCaseSentive)
00069       this.queryPattern.setMatchFlags(RE.MATCH_NORMAL);
00070     else
00071       this.queryPattern.setMatchFlags(RE.MATCH_CASEINDEPENDENT);
00072     this.applyToSkeleton = applyToSkeleton;
00073     this.monitoring = monitoring;
00074   }


メソッド

String org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.getQueryPattern  ) 
 

Get query pattern

戻り値:
the query pattern

SQLMonitoringRule.java101 行で定義されています。

参照元 org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.getXml().

00102   {
00103     return queryPattern.toString();
00104   }

String org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.getXml  ) 
 

参照:
org.objectweb.cjdbc.common.xml.XmlComponent.getXml()

SQLMonitoringRule.java198 行で定義されています。

参照先 org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.getQueryPattern(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.isApplyToSkeleton(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.isCaseSentive(), と org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.isMonitoring().

00199   {
00200     String info =
00201       "<"
00202         + DatabasesXmlTags.ELT_SQLMonitoringRule
00203         + " "
00204         + DatabasesXmlTags.ATT_queryPattern
00205         + "=\""
00206         + getQueryPattern()
00207         + "\" "
00208         + DatabasesXmlTags.ATT_caseSensitive
00209         + "=\""
00210         + isCaseSentive()
00211         + "\" "
00212         + DatabasesXmlTags.ATT_applyToSkeleton
00213         + "=\""
00214         + isApplyToSkeleton()
00215         + "\" "
00216         + DatabasesXmlTags.ATT_monitoring
00217         + "=\"";
00218     if (isMonitoring())
00219       info += "on";
00220     else
00221       info += "off";
00222     info += "\"/>";
00223     return info;
00224   }

boolean org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.isApplyToSkeleton  ) 
 

If the pattern apply to the skeleton ot the instanciated query.

戻り値:
true if the pattern apply to the query skeleton

SQLMonitoringRule.java149 行で定義されています。

参照元 org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.getXml().

00150   {
00151     return applyToSkeleton;
00152   }

boolean org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.isCaseSentive  ) 
 

If matching is case sensitive or not

戻り値:
true if the matching is case sensitive

SQLMonitoringRule.java81 行で定義されています。

参照元 org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.getXml().

00082   {
00083     return isCaseSentive;
00084   }

boolean org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.isMonitoring  ) 
 

If monitoring is activated or not.

戻り値:
true if monitoring is activated for this pattern

SQLMonitoringRule.java91 行で定義されています。

参照元 org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.getXml(), と org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.monitorRequestRule().

00092   {
00093     return monitoring;
00094   }

String org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.matches AbstractRequest  request  ) 
 

Returns true if the given query matches the pattern of this rule. This function applies the applytoSkeleton rule.

引数:
request the query
戻り値:
the SQL that matches the rule or null if it does not match

SQLMonitoringRule.java171 行で定義されています。

参照先 org.objectweb.cjdbc.common.sql.AbstractRequest.getSQL(), と org.objectweb.cjdbc.common.sql.AbstractRequest.getSqlSkeleton().

参照元 org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.monitorRequestRule().

00172   {
00173     if (applyToSkeleton)
00174     {
00175       String skel = request.getSqlSkeleton();
00176       if (skel == null)
00177         return null;
00178       else
00179       {
00180         if (queryPattern.match(skel))
00181           return skel;
00182         else
00183           return null;
00184       }
00185     }
00186     else
00187     {
00188       if (queryPattern.match(request.getSQL()))
00189         return request.getSQL();
00190       else
00191         return null;
00192     }
00193   }

void org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.setApplyToSkeleton boolean  b  ) 
 

Set to true if the pattern apply to the query skeleton

引数:
b true if the pattern apply to the query skeleton

SQLMonitoringRule.java159 行で定義されています。

00160   {
00161     applyToSkeleton = b;
00162   }

void org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.setCaseSentive boolean  b  ) 
 

Set the matching case sensitiveness

引数:
b true if matching is case sensitive

SQLMonitoringRule.java111 行で定義されています。

00112   {
00113     isCaseSentive = b;
00114   }

void org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.setMonitoring boolean  b  ) 
 

Set the monitoring on or off

引数:
b true if monitoring must be activated for this rule

SQLMonitoringRule.java121 行で定義されています。

00122   {
00123     monitoring = b;
00124   }

void org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.setQueryPattern String  queryPattern  ) 
 

Sets the query pattern

引数:
queryPattern the queryPattern

SQLMonitoringRule.java131 行で定義されています。

00132   {
00133     try
00134     {
00135       this.queryPattern = new RE(queryPattern);
00136     }
00137     catch (RESyntaxException e)
00138     {
00139       throw new RuntimeException(
00140         "Invalid regexp in SQL Monitoring rule (" + e + ")");
00141     }
00142   }


変数

boolean org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.applyToSkeleton [private]
 

SQLMonitoringRule.java41 行で定義されています。

boolean org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.isCaseSentive [private]
 

SQLMonitoringRule.java40 行で定義されています。

boolean org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.monitoring [private]
 

SQLMonitoringRule.java42 行で定義されています。

RE org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.queryPattern [private]
 

SQLMonitoringRule.java39 行で定義されています。


このクラスの説明は次のファイルから生成されました:
CJDBCversion1.0rc6に対してWed May 5 18:02:49 2004に生成されました。 doxygen 1.3.6