public class Session
extends java.lang.Object
The most important part of the Session object context is the Broker reference. The Broker is the client side object that represets the broker system. The Broker object is the Session's connections to the outside world, it allow the Session object to send and receive data from the 4GL server. A 4GL procedure is executed in (at most) five stages - two for sending input data and three to receive output data. A Send/Recive cycle is called A conversation: 1) Put the scalar input values onto the stream. 2) Put the input result sets onto the stream. 3) Receive the schema of the output temp-tables (or an Error stream). 4) Receive the scalar output values. (or an Error stream). 5) Prepare handles to the output result sets. If there is no relational (Temp-Table) data to be sent or received then an execution of a 4GL procedure would go thru the (1) and (4) steps only - that is the minimum. The session object can be CONNECTED or DISCONNECTED. A CONNECTED object Can be: IDLE or RUNNING or STREAMING. RUNNING: We are inside the PersistentProc() method. STREAMING: There is (are) an open output result set(s). The Seesion "knows" that it is STREAMING when by having outputSetsChain variable referencing the chain of output result sets. IDLE: It's not RUNNING or STREAMING. The Open4GLException exception is the ONLY way the Session object communicates errors the caller (the user of the Dynamic API). The Open4GLException class is further extended to describe different 4GL errors and conditions: STOP, ERROR and QUIT. But for a programmer that Does not want to get familiar with 4GL details it is generaly enough to handle Open4GLException exceptions ( sine StopException, for example, IS A, object oriented wise, Open4GLException. Normal (user) errors are not handled by a special Session state: Error data is handled like any other output data. When a FGLErrorException exception is caught, the Session object calls an ErrorMessageReader object to decode the error information. At any point where the Session object is willing to get interrupted, it sets the interrupt varable with an Interruptable object. For example, when the input result sets are being marshaled onto the stream, the interrupt variable is set to the InputTableStreamerNoSchema streamer object, so when Session.setStop() is called, setStop() calls interrupt.stop() and that triggers InputTableStreamerNoSchema.stop() that caueses the streaming process to stop. The Session object is referenced by the the output ResultSet objects. That is important because the user of the Dynamic API (which is, indirectly, the application), pulls data from the server after the Session.runProcedure() method already returned. So if there is an error in the process of streaming the output data, the ResultSet object can notify the Session by calling the non private version of Session.handleOutputErrors().
Constructor and Description |
---|
Session(java.lang.String url,
com.progress.common.ehnlog.IAppLogger log,
IPoolProps sessionProperties) |
Modifier and Type | Method and Description |
---|---|
void |
addReference() |
void |
connect(java.lang.String requestID,
java.lang.String url,
java.lang.String userId,
java.lang.String password,
java.lang.String clientInfo) |
void |
deleteReference() |
protected void |
finalize() |
int |
getASKVersion() |
int |
getClientASKActivityTimeout() |
boolean |
getClientASKEnabled() |
int |
getClientASKResponseTimeout() |
java.lang.String |
getConnectionId() |
int |
getPoolState() |
java.lang.String |
getRequestId() |
java.lang.String |
getReturnValue() |
boolean |
getServerASKEnabled() |
java.lang.String |
getSessionID() |
java.lang.String |
getSSLSubjectName() |
PersistentProc |
instantiateClass(java.lang.String className,
int stateModel) |
boolean |
isConnected() |
boolean |
isServerSessionValid()
Check server session
|
boolean |
isStreaming() |
void |
manageASKPingRequest() |
PersistentProc |
runPersistentProcedure(java.lang.String procedureName,
int stateModel) |
PersistentProc |
runPersistentProcedure(java.lang.String procedureName,
ParameterSet params) |
PersistentProc |
runPersistentProcedure(java.lang.String procedureName,
ParameterSet params,
ResultSetSchema schema) |
PersistentProc |
runPersistentProcedure(java.lang.String requestID,
java.lang.String procedureName,
ParameterSet params) |
PersistentProc |
runPersistentProcedure(java.lang.String requestID,
java.lang.String procedureName,
ParameterSet params,
ResultSetSchema schema) |
void |
runProcedure(java.lang.String procedureName,
ParameterSet params) |
void |
runProcedure(java.lang.String procedureName,
ParameterSet params,
ResultSetSchema schema) |
void |
runProcedure(java.lang.String requestID,
java.lang.String procedureName,
ParameterSet params) |
void |
runProcedure(java.lang.String requestID,
java.lang.String procedureName,
ParameterSet params,
ResultSetSchema schema) |
void |
runStatelessProcedure(java.lang.String requestID,
java.lang.String fullProcedureName,
ParameterSet params,
java.lang.Object procId,
ResultSetSchema localSchema,
int stateModel) |
boolean |
serializeAsJson() |
boolean |
serializeDatasetsAsXml() |
int |
setPoolState(int newState) |
void |
setStop() |
void |
shutdown() |
void |
stop() |
java.lang.String |
toString() |
long |
tsCreated() |
public Session(java.lang.String url, com.progress.common.ehnlog.IAppLogger log, IPoolProps sessionProperties)
public void setStop()
public void connect(java.lang.String requestID, java.lang.String url, java.lang.String userId, java.lang.String password, java.lang.String clientInfo) throws ConnectException, SystemErrorException
ConnectException
SystemErrorException
public void addReference()
public void deleteReference() throws SystemErrorException, Open4GLException
SystemErrorException
Open4GLException
public boolean isConnected()
public PersistentProc runPersistentProcedure(java.lang.String procedureName, ParameterSet params) throws Open4GLException, RunTime4GLException, SystemErrorException
public PersistentProc runPersistentProcedure(java.lang.String requestID, java.lang.String procedureName, ParameterSet params) throws Open4GLException, RunTime4GLException, SystemErrorException
public PersistentProc runPersistentProcedure(java.lang.String procedureName, ParameterSet params, ResultSetSchema schema) throws Open4GLException, RunTime4GLException, SystemErrorException
public PersistentProc runPersistentProcedure(java.lang.String procedureName, int stateModel) throws Open4GLException, RunTime4GLException, SystemErrorException
public PersistentProc instantiateClass(java.lang.String className, int stateModel) throws Open4GLException, RunTime4GLException, SystemErrorException
public PersistentProc runPersistentProcedure(java.lang.String requestID, java.lang.String procedureName, ParameterSet params, ResultSetSchema schema) throws Open4GLException, RunTime4GLException, SystemErrorException
public void runProcedure(java.lang.String procedureName, ParameterSet params) throws Open4GLException, RunTime4GLException, SystemErrorException
public void runProcedure(java.lang.String requestID, java.lang.String procedureName, ParameterSet params) throws Open4GLException, RunTime4GLException, SystemErrorException
public void runProcedure(java.lang.String procedureName, ParameterSet params, ResultSetSchema schema) throws Open4GLException, RunTime4GLException, SystemErrorException
public void runProcedure(java.lang.String requestID, java.lang.String procedureName, ParameterSet params, ResultSetSchema schema) throws Open4GLException, RunTime4GLException, SystemErrorException
public void runStatelessProcedure(java.lang.String requestID, java.lang.String fullProcedureName, ParameterSet params, java.lang.Object procId, ResultSetSchema localSchema, int stateModel) throws Open4GLException
Open4GLException
public boolean isStreaming()
public java.lang.String getConnectionId()
public java.lang.String getRequestId()
public java.lang.String getSSLSubjectName()
public void manageASKPingRequest() throws Open4GLException
Open4GLException
public java.lang.String getReturnValue()
public void stop()
protected final void finalize()
finalize
in class java.lang.Object
public void shutdown()
public java.lang.String getSessionID()
public java.lang.String toString()
toString
in class java.lang.Object
public int getPoolState()
public int setPoolState(int newState)
public int getASKVersion()
public boolean getServerASKEnabled()
public boolean getClientASKEnabled()
public int getClientASKActivityTimeout()
public int getClientASKResponseTimeout()
public long tsCreated()
public boolean serializeDatasetsAsXml()
public boolean serializeAsJson()
public boolean isServerSessionValid()