View Javadoc

1   /**
2    * Copyright 2010-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.common.jdbc.context;
17  
18  import java.util.List;
19  
20  import org.kuali.common.jdbc.SqlReader;
21  import org.kuali.common.jdbc.listener.NoOpSqlListener;
22  import org.kuali.common.jdbc.listener.SqlListener;
23  
24  public class ExecutionContext {
25  
26  	// If false, no SQL is executed.
27  	// Everything leading up to SQL execution still takes place
28  	// Connecting to the database, parsing SQL, etc.
29  	boolean execute = true;
30  
31  	// Use this to enable multi-threaded SQL execution
32  	// When used, SQL supplied to this context does not execute sequentially
33  	int threads = 1;
34  	SqlListener listener = new NoOpSqlListener();
35  	JdbcContext jdbcContext;
36  	SqlReader reader;
37  	List<String> locations;
38  	String encoding;
39  	List<String> sql;
40  	String message;
41  
42  	public JdbcContext getJdbcContext() {
43  		return jdbcContext;
44  	}
45  
46  	public void setJdbcContext(JdbcContext jdbcContext) {
47  		this.jdbcContext = jdbcContext;
48  	}
49  
50  	public SqlReader getReader() {
51  		return reader;
52  	}
53  
54  	public void setReader(SqlReader reader) {
55  		this.reader = reader;
56  	}
57  
58  	public List<String> getLocations() {
59  		return locations;
60  	}
61  
62  	public void setLocations(List<String> locations) {
63  		this.locations = locations;
64  	}
65  
66  	public String getEncoding() {
67  		return encoding;
68  	}
69  
70  	public void setEncoding(String encoding) {
71  		this.encoding = encoding;
72  	}
73  
74  	public List<String> getSql() {
75  		return sql;
76  	}
77  
78  	public void setSql(List<String> sql) {
79  		this.sql = sql;
80  	}
81  
82  	public int getThreads() {
83  		return threads;
84  	}
85  
86  	public void setThreads(int threads) {
87  		this.threads = threads;
88  	}
89  
90  	public SqlListener getListener() {
91  		return listener;
92  	}
93  
94  	public void setListener(SqlListener listener) {
95  		this.listener = listener;
96  	}
97  
98  	public boolean isExecute() {
99  		return execute;
100 	}
101 
102 	public void setExecute(boolean execute) {
103 		this.execute = execute;
104 	}
105 
106 	public String getMessage() {
107 		return message;
108 	}
109 
110 	public void setMessage(String message) {
111 		this.message = message;
112 	}
113 
114 }