public class CallContext extends Object implements ICallContext
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_DATA_ACCESSORS
Maximal number of accessors that can be opened within single context.
|
| Constructor and Description |
|---|
CallContext(String userId)
Creates new not activated context.
|
CallContext(String userId,
ICelesta celesta,
String procName)
Creates activated context.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activate(ICelesta celesta,
String procName)
Activates CallContext with 'live' Celesta and procName.
|
void |
close() |
void |
commit()
Commits the current transaction.
|
void |
decDataAccessorsCount()
Decrements counter of open data accessor objects.
|
ICelesta |
getCelesta()
Returns Celesta instance.
|
Connection |
getConn()
Returns active database JDBC connection.
|
CallContext |
getCopy()
Duplicates callcontext with another JDBC connection.
|
DBAdaptor |
getDbAdaptor()
Returns a
DBAdaptor of current Celesta instance. |
int |
getDBPid()
Returns Process Id of current connection to the database.
|
long |
getDurationNs()
Returns number of nanoseconds since CallContext activation.
|
BasicDataAccessor |
getLastDataAccessor()
Returns the last data accessor object.
|
ILoggingManager |
getLoggingManager()
Returns a
ILoggingManager of current Celesta instance. |
IPermissionManager |
getPermissionManager()
Returns a
IPermissionManager of current Celesta instance. |
String |
getProcName()
Returns procedure name that was initially called.
|
Score |
getScore()
Returns score of current Celesta instance.
|
Date |
getStartTime()
Returns the calendar date of CallContext activation.
|
String |
getUserId()
Returns name of the current user.
|
void |
incDataAccessorsCount()
Increments counter of open data accessor objects.
|
boolean |
isClosed()
If this context is closed.
|
void |
rollback()
Rollbacks the current transaction.
|
void |
setLastDataAccessor(BasicDataAccessor dataAccessor)
Set the last data accessor object.
|
public static final int MAX_DATA_ACCESSORS
public CallContext(String userId)
userId - User identifier. Cannot be null or empty.public void activate(ICelesta celesta, String procName)
celesta - Celesta to use CallContext with.procName - Name of the called procedure (for logging/audit needs).public Connection getConn()
getConn in interface ICallContextpublic String getUserId()
public void commit()
Wraps SQLException into CelestaException.
public void rollback()
Wraps SQLException into CelestaException.
public ICelesta getCelesta()
null for not activated contextpublic Score getScore()
getScore in interface ICallContextpublic void setLastDataAccessor(BasicDataAccessor dataAccessor)
dataAccessor - data accessor objectpublic void incDataAccessorsCount()
CelestaException - if the maximal limit of data accessors is exceeded.public void decDataAccessorsCount()
public BasicDataAccessor getLastDataAccessor()
public int getDBPid()
public String getProcName()
public Date getStartTime()
public long getDurationNs()
public boolean isClosed()
isClosed in interface ICallContextpublic IPermissionManager getPermissionManager()
IPermissionManager of current Celesta instance.public ILoggingManager getLoggingManager()
ILoggingManager of current Celesta instance.public DBAdaptor getDbAdaptor()
DBAdaptor of current Celesta instance.getDbAdaptor in interface ICallContextpublic final void close()
close in interface AutoCloseableclose in interface ICallContextpublic CallContext getCopy()
Copyright © 2021 CURS. All rights reserved.