KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > sessionsystem > _Session


1 package com.daffodilwoods.daffodildb.server.sessionsystem;
2
3 import com.daffodilwoods.daffodildb.server.serversystem.*;
4 import com.daffodilwoods.database.resource.*;
5
6 import com.daffodilwoods.database.general.*;
7 import java.util.TimeZone JavaDoc;
8 import java.sql.*;
9 import java.util.ArrayList JavaDoc;
10 import java.util.TreeMap JavaDoc;
11 import com.daffodilwoods.daffodildb.server.sql99.common.*;
12 import com.daffodilwoods.daffodildb.utils.*;
13 import com.daffodilwoods.daffodildb.server.sql99.dql.iterator._Iterator;
14 import com.daffodilwoods.daffodildb.server.datasystem.interfaces._Table;
15 import com.daffodilwoods.daffodildb.server.sql99.expression.booleanvalueexpression._SingleTableExecuter;
16 public interface _Session {
17
18    public final static int ReadUncommitted = java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
19    public final static int ReadCommitted = java.sql.Connection.TRANSACTION_READ_COMMITTED;
20    public final static int ReadSessionSerializable = 5;
21    public final static int ReadUnLokedCommitted = 6;
22    public final static int ReadTransactionSerializable = java.sql.Connection.TRANSACTION_SERIALIZABLE;
23    public final static int ReadRepeatable = java.sql.Connection.TRANSACTION_REPEATABLE_READ;
24
25   /**
26    * Return a condition corresponding to the Isolation Level for the current user session.
27    * @return ParameterisedCondition
28    * @throws DException
29    */

30   public SessionConditionInfo getSessionCondition()throws DException;
31
32   /**
33    * Returns Session Id on which user is working (current sessionId).
34    * @return Object
35    * @throws DException
36    */

37   public Object JavaDoc getSessionId() throws DException ;
38   public Object JavaDoc getParentSessionId() throws DException ;
39
40   /**
41    * Returns a table for a session user to work on.
42    * @param tableName
43    * @return
44    * @throws DException
45    */

46   public _SessionTable getSessionTable( QualifiedIdentifier tableName ) throws DException;
47
48   /**
49    * Sets the Isolation level for the session.
50    * @param level
51    * @throws DException
52    */

53   public void setIsolationLevel(int level ) throws DException ;
54
55   /**
56    * returns the integer corresponding to isolation level of the session.
57    * @return int
58    * @throws DException
59    */

60   public int getIsolationLevel() throws DException ;
61
62   /**
63    * returns Transaction ID given at the start of a session.
64    * @return Object
65    * @throws DException
66    */

67   public Object JavaDoc getTransactionIdAtStart() throws DException ;
68
69   /**
70    * Writes the processed records of the current session in a file on disk.
71    * @param statementExecutionContext
72    * @throws DException
73    */

74   public void commit(_StatementExecutionContext statementExecutionContext) throws DException;
75
76   /**
77    * rolls back all the operations performed on the records in the session.
78    * @param statementExecutionContext
79    * @throws DException
80    */

81   public void rollback(_StatementExecutionContext statementExecutionContext) throws DException;
82
83   /**
84    * returns a Object of Lock Class.
85    * @return Lock
86    * @throws DException
87    */

88   public Lock getLock() throws DException ;
89
90
91   /**
92    * returns a Database for the session on which a user is currently working.
93    * @return
94    * @throws DException
95    */

96   public _SessionDatabase getSessionDatabase() throws DException ;
97
98   /**
99    * will return true if the user passed is the current one.
100    * @param authorizationIdentifier
101    * @return
102    * @throws DException
103    */

104   public boolean isEnabledAuthorizationIdentifier(String JavaDoc authorizationIdentifier) throws DException ;
105
106   /**
107    * returns the current role or User.
108    * @return
109    * @throws DException
110    */

111   public String JavaDoc getAuthorizationIdentifier() throws DException ;
112
113   /**
114    * returns current role from Session SQL.
115    * @return String
116    * @throws DException
117    */

118   public String JavaDoc getCurrentRole() throws DException ;
119
120   /**
121    * returns current User of this session.
122    * @return
123    * @throws DException
124    */

125   public String JavaDoc getCurrentUser() throws DException ;
126
127   /**
128    * sets the session Tranaction mode as immiediate or deffered for the session.
129    * @param sessionTransactionMode
130    * @throws DException
131    */

132   public void setTransactionMode( SessionTransactionMode sessionTransactionMode ) throws DException ;
133
134   /**
135    * returns the session Tranaction mode as immiediate or deffered for the session.
136    * @return SessionTransactionMode
137    * @throws DException
138    */

139   public SessionTransactionMode getTransactionMode() throws DException ;
140
141   /**
142    * returns the Current Date.
143    * @return Date
144    * @throws DException
145    */

146   public Date getDate() throws DException ;
147
148   /**
149    * returns the current time.
150    * @return Time
151    * @throws DException
152    */

153   public Time getTime() throws DException ;
154
155   /**
156    * returns the current month .
157    * @return int
158    * @throws DException
159    */

160   public int getMonth() throws DException ;
161
162   /**
163    * returns the current year.
164    * @return int
165    * @throws DException
166    */

167   public int getYear() throws DException ;
168
169   /**
170    * returns the current hour.
171    * @return int
172    * @throws DException
173    */

174   public int getHour() throws DException ;
175
176   /**
177    * returns the current minutes.
178    * @return int
179    * @throws DException
180    */

181   public int getMinutes() throws DException ;
182
183   /**
184    * returns the current seconds.
185    * @return int
186    * @throws DException
187    */

188   public int getSeconds() throws DException ;
189
190   /**
191    * returns the current time zone.
192    * @return TimeZone
193    * @throws DException
194    */

195   public TimeZone JavaDoc getTimeZone() throws DException ;
196
197   /**
198    * Adds or removes the constraint Name to immediateModeConstraints Tree Map according to their mode.
199    * @param constraintName
200    * @param mode
201    * @throws DException
202    */

203   public void setConstraintStatus(Object JavaDoc constraintName, String JavaDoc mode) throws DException ;
204
205   /**
206    * removes the table name from session table list.
207    * @param tableName
208    * @throws DException
209    */

210   public void removeTable(QualifiedIdentifier tableName) throws DException;
211
212   /**
213    * fetches the time stamp from session SQL.
214    * @return TimeStamp
215    * @throws DException
216    */

217   public java.sql.Timestamp JavaDoc getTimeStamp( ) throws DException ;
218
219   /**
220    * will add the user or role to a Stack.
221    * @param athrznIdntfr
222    * @throws DException
223    */

224   public void pushAuthorizationIdentifier(AuthorizationIdentifier athrznIdntfr) throws DException ;
225
226   /**
227    * returns only a list of constraints which are changed from deffered to immeidate for the table.
228    * @param tableName
229    * @return ArrayList
230    * @throws DException
231    */

232   public ArrayList JavaDoc getImmediateConstriants(QualifiedIdentifier tableName) throws DException ;
233
234   /**
235    * returns the immeidate constraint
236    * @return TreeMap
237    * @throws DException
238    */

239   public TreeMap JavaDoc getImmediateConstriants() throws DException ;
240
241   /**
242    * returns the session constant
243    * @return Object
244    * @throws DException
245    */

246   public Object JavaDoc getSessionConstant() throws DException ;
247
248   /**
249    * retruns a Object of GlobalSession.
250    * @return _GloabalSession
251    * @throws DException
252    */

253   public _ServerSession getGlobalSession() throws DException ;
254
255   /**
256    * Prepare is used for Distributed transactions, it writes the data in memory to a file on disk.
257    * @param statementExecutionContext
258    * @return boolean
259    * @throws DException
260    */

261   boolean prepare(_StatementExecutionContext statementExecutionContext) throws DException;
262
263   /**
264    * makes the changes made during prepare statement permanent, (used for distributed transactions)
265    * @param statementExecutionContext
266    * @return boolean
267    * @throws DException
268    */

269   boolean makePersistent(_StatementExecutionContext statementExecutionContext) throws DException;
270
271   /**
272    * check the constrains with the one present in the table defenation.
273    * @return boolean
274    * @throws DException
275    */

276   public boolean checkConstraint()throws DException;
277
278   /**
279    * Sets the value to false so that no constraint checking can take place.
280    * @throws DException
281    */

282   public void stopConstraintChecking()throws DException;
283
284
285   /**
286    * will set the User name and place the use name to Stack through pushAuthorizationIdentifier.
287    * @param userName
288    * @throws DException
289    */

290   public void setAuthorizationIdentifier( String JavaDoc userName )throws DException;
291
292   /**
293    * removes all the entries from the table list i.e contaning the names of all the table in use of same session.
294    * @throws DException
295    */

296   public void removeAllTables()throws DException;
297
298   public boolean getImmediateConstriantsForChecking();
299   public boolean getDeferredConstriantsForChecking();
300   public boolean isDataModified() throws DException ;
301   public void startSavePoint() throws DException;
302   public void commitSavePoint(_StatementExecutionContext sec) throws DException;
303   public void rollbackSavePoint(_StatementExecutionContext sec) throws DException;
304   public void releaseSavePoint(_StatementExecutionContext sec) throws DException;
305   public int getNumberOfSavePiontsStarted() throws DException;
306   public Object JavaDoc[] getRecursiveSessionIds() throws DException;
307   public void hideSavePoint() throws DException;
308   public void unhideSavePoint() throws DException;
309   public void ignoreParallelSavePoint() throws DException ;
310   public void allowParallelSavePoint() throws DException ;
311   public void checkImmediateConstraintsOnCommit() throws DException;
312   public void updateDataModifiedStatus() throws DException;
313   public boolean hasAnyChild() throws DException;
314   public void setRole(String JavaDoc roleName) throws DException;
315   public void resetTime() throws DException;
316   public void setAutoCommit(boolean autoCommit0) ;
317   public boolean getAutoCommit();
318   public void addTableInChangedTableList(QualifiedIdentifier tableName);
319   public void startTransaction() throws DException;
320 }
321
Popular Tags