Source Code Cross Referenced for SequoiaRequestRegExp.java in  » Database-JDBC-Connection-Pool » sequoia-2.10.9 » org » continuent » sequoia » controller » requests » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database JDBC Connection Pool » sequoia 2.10.9 » org.continuent.sequoia.controller.requests 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Sequoia: Database clustering technology.
003:         * Copyright (C) 2005 AmicoSoft, Inc. dba Emic Networks
004:         * Contact: sequoia@continuent.org
005:         * 
006:         * Licensed under the Apache License, Version 2.0 (the "License");
007:         * you may not use this file except in compliance with the License.
008:         * You may obtain a copy of the License at
009:         * 
010:         * http://www.apache.org/licenses/LICENSE-2.0
011:         * 
012:         * Unless required by applicable law or agreed to in writing, software
013:         * distributed under the License is distributed on an "AS IS" BASIS,
014:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015:         * See the License for the specific language governing permissions and
016:         * limitations under the License. 
017:         *
018:         * Initial developer(s): Emmanuel Cecchet.
019:         * Contributor(s): ______________________.
020:         */package org.continuent.sequoia.controller.requests;
021:
022:        import java.util.regex.Pattern;
023:
024:        /**
025:         * This class defines the regular expressions to be used with generic ANSI SQL
026:         * requests.
027:         * 
028:         * @author <a href="mailto:emmanuel.cecchet@continuent.com">Emmanuel Cecchet</a>
029:         * @version 1.0
030:         */
031:        public final class SequoiaRequestRegExp implements  RequestRegExp {
032:            private static final String ALTER_REQUEST_PATTERN_STRING = "^alter.*";
033:            private static final String CREATE_REQUEST_PATTERN_STRING = "^(create|select\\s.+\\sinto\\s).*";
034:            private static final String DELETE_REQUEST_PATTERN_STRING = "^(delete|truncate).*";
035:            private static final String DROP_REQUEST_PATTERN_STRING = "^drop.*";
036:            private static final String INSERT_REQUEST_PATTERN_STRING = "^insert.*";
037:            private static final String SELECT_REQUEST_PATTERN_STRING = "^(\\s|\\()*select.*";
038:            private static final String SELECT_FOR_UPDATE_PATTERN_STRING = ".*select.*\\s+for\\s+update\\s*.*";
039:            private static final String STORED_PROCEDURE_PATTERN_STRING = "^\\{(\\s*\\?\\s*=)?\\s*call.*";
040:            private static final String UPDATE_REQUEST_PATTERN_STRING = "^update.*";
041:            private static final String UNKNOWN_READ_REQUEST_PATTERN_STRING = "^show.*";
042:            private static final String UNKNOWN_WRITE_REQUEST_PATTERN_STRING = "^(grant|lock|revoke|set).*";
043:            private static final String STATEMENT_EXECUTE_REQUEST_PATTERN_STRING = "^(explain\\s+analyze).*";
044:            private static final String UNAUTHORIZED_REQUEST_PATTERN_STRING = "^(shutdown|kill).*";
045:
046:            // Note that we use Patterns and not Matchers because these objects are
047:            // potentially accessed concurrently and parsing could occur in parallel. This
048:            // way, each caller will have to call Pattern.matcher() that will allocate a
049:            // matcher for its own use in a thread-safe way.
050:
051:            private static final Pattern ALTER_REQUEST_PATTERN = Pattern
052:                    .compile(ALTER_REQUEST_PATTERN_STRING,
053:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
054:
055:            private static final Pattern CREATE_REQUEST_PATTERN = Pattern
056:                    .compile(CREATE_REQUEST_PATTERN_STRING,
057:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
058:
059:            private static final Pattern DELETE_REQUEST_PATTERN = Pattern
060:                    .compile(DELETE_REQUEST_PATTERN_STRING,
061:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
062:            private static final Pattern DROP_REQUEST_PATTERN = Pattern
063:                    .compile(DROP_REQUEST_PATTERN_STRING,
064:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
065:
066:            private static final Pattern INSERT_REQUEST_PATTERN = Pattern
067:                    .compile(INSERT_REQUEST_PATTERN_STRING,
068:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
069:
070:            private static final Pattern SELECT_REQUEST_PATTERN = Pattern
071:                    .compile(SELECT_REQUEST_PATTERN_STRING,
072:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
073:            private static final Pattern SELECT_FOR_UPDATE_PATTERN = Pattern
074:                    .compile(SELECT_FOR_UPDATE_PATTERN_STRING,
075:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
076:
077:            private static final Pattern STORED_PROCEDURE_PATTERN = Pattern
078:                    .compile(STORED_PROCEDURE_PATTERN_STRING,
079:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
080:
081:            private static final Pattern UPDATE_REQUEST_PATTERN = Pattern
082:                    .compile(UPDATE_REQUEST_PATTERN_STRING,
083:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
084:
085:            private static final Pattern UNKNOWN_READ_REQUEST_PATTERN = Pattern
086:                    .compile(UNKNOWN_READ_REQUEST_PATTERN_STRING,
087:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
088:
089:            private static final Pattern UNKNOWN_WRITE_REQUEST_PATTERN = Pattern
090:                    .compile(UNKNOWN_WRITE_REQUEST_PATTERN_STRING,
091:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
092:
093:            private static final Pattern STATEMENT_EXECUTE_REQUEST_PATTERN = Pattern
094:                    .compile(STATEMENT_EXECUTE_REQUEST_PATTERN_STRING,
095:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
096:
097:            private static final Pattern UNAUTHORIZED_REQUEST_PATTERN = Pattern
098:                    .compile(UNAUTHORIZED_REQUEST_PATTERN_STRING,
099:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
100:
101:            /**
102:             * @see org.continuent.sequoia.controller.requests.RequestRegExp#getAlterRequestPattern()
103:             */
104:            public Pattern getAlterRequestPattern() {
105:                return ALTER_REQUEST_PATTERN;
106:            }
107:
108:            /**
109:             * @see org.continuent.sequoia.controller.requests.RequestRegExp#getCreateRequestPattern()
110:             */
111:            public Pattern getCreateRequestPattern() {
112:                return CREATE_REQUEST_PATTERN;
113:            }
114:
115:            /**
116:             * @see org.continuent.sequoia.controller.requests.RequestRegExp#getDeleteRequestPattern()
117:             */
118:            public Pattern getDeleteRequestPattern() {
119:                return DELETE_REQUEST_PATTERN;
120:            }
121:
122:            /**
123:             * @see org.continuent.sequoia.controller.requests.RequestRegExp#getDropRequestPattern()
124:             */
125:            public Pattern getDropRequestPattern() {
126:                return DROP_REQUEST_PATTERN;
127:            }
128:
129:            /**
130:             * @see org.continuent.sequoia.controller.requests.RequestRegExp#getInsertQueryPattern()
131:             */
132:            public Pattern getInsertQueryPattern() {
133:                return INSERT_REQUEST_PATTERN;
134:            }
135:
136:            /**
137:             * @see org.continuent.sequoia.controller.requests.RequestRegExp#getSelectForUpdatePattern()
138:             */
139:            public Pattern getSelectForUpdatePattern() {
140:                return SELECT_FOR_UPDATE_PATTERN;
141:            }
142:
143:            /**
144:             * @see org.continuent.sequoia.controller.requests.RequestRegExp#getSelectRequestPattern()
145:             */
146:            public Pattern getSelectRequestPattern() {
147:                return SELECT_REQUEST_PATTERN;
148:            }
149:
150:            /**
151:             * @see org.continuent.sequoia.controller.requests.RequestRegExp#getStoredProcedurePattern()
152:             */
153:            public Pattern getStoredProcedurePattern() {
154:                return STORED_PROCEDURE_PATTERN;
155:            }
156:
157:            /**
158:             * @see org.continuent.sequoia.controller.requests.RequestRegExp#getUnknownReadRequestPattern()
159:             */
160:            public Pattern getUnknownReadRequestPattern() {
161:                return UNKNOWN_READ_REQUEST_PATTERN;
162:            }
163:
164:            /**
165:             * @see org.continuent.sequoia.controller.requests.RequestRegExp#getUnknownWriteRequestPattern()
166:             */
167:            public Pattern getUnknownWriteRequestPattern() {
168:                return UNKNOWN_WRITE_REQUEST_PATTERN;
169:            }
170:
171:            /**
172:             * @see org.continuent.sequoia.controller.requests.RequestRegExp#getUpdateRequestPattern()
173:             */
174:            public Pattern getUpdateRequestPattern() {
175:                return UPDATE_REQUEST_PATTERN;
176:            }
177:
178:            /**
179:             * @see org.continuent.sequoia.controller.requests.RequestRegExp#getStatementExecuteRequestPattern()
180:             */
181:            public Pattern getStatementExecuteRequestPattern() {
182:                return STATEMENT_EXECUTE_REQUEST_PATTERN;
183:            }
184:
185:            /**
186:             * @see org.continuent.sequoia.controller.requests.RequestRegExp#getUnauthorizedRequestsPattern()
187:             */
188:            public Pattern getUnauthorizedRequestsPattern() {
189:                return UNAUTHORIZED_REQUEST_PATTERN;
190:            }
191:
192:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.