Package net.sf.basedb.core.log
Class TransactionDetails
java.lang.Object
net.sf.basedb.core.log.TransactionDetails
Holds information about the curren transaction, such as the logged in user,
the active project, the plug-in that is executing, etc.
- Version:
- 2.13
- Author:
- Nicklas
- Last modified
- $Date: 2022-08-02 13:15:28 +0200 (Tue, 02 Aug 2022) $
-
Field Summary
Modifier and TypeFieldDescriptionprivate final int
private final int
private String
private final LogControl
private final int
private String
private final int
private String
private final int
private final int
private String
-
Constructor Summary
ConstructorDescriptionTransactionDetails
(LogControl logControl, SessionControl sc) Creates a new transaction details object with information from given session control -
Method Summary
Modifier and TypeMethodDescriptionint
Get the ID of the client appliction that is used, or 0 if not known.int
getJobId()
Get the ID of the currently running job or 0 if no job is running.Utility method for loading the name of the currently executing job.getName()
Get the name of this transaction.int
Get the ID of the currently running plug-in or 0 if no plug-in is running.Utility method for loading the name of the currently executing plugin.int
Get the ID of the currently active project, or 0 if no project is active.Utility method for loading the name of the currently active project.getProjectName
(int projectId) Get the name of the project with the given id.int
Get the ID of the session or 0 if no user is logged in.int
Get the ID of the currently logged in user, or 0 if no user is logged in.Utility method for loading the name of the currently logged in user.Convert the information about the transaction to aChangeHistoryData
object.
-
Field Details
-
logControl
-
userId
private final int userId -
sessionId
private final int sessionId -
clientId
private final int clientId -
projectId
private final int projectId -
pluginId
private final int pluginId -
jobId
private final int jobId -
userName
-
projectName
-
pluginName
-
jobName
-
projectNames
-
-
Constructor Details
-
TransactionDetails
Creates a new transaction details object with information from given session control
-
-
Method Details
-
getUserId
public int getUserId()Get the ID of the currently logged in user, or 0 if no user is logged in. -
getSessionId
public int getSessionId()Get the ID of the session or 0 if no user is logged in. -
getClientId
public int getClientId()Get the ID of the client appliction that is used, or 0 if not known. -
getProjectId
public int getProjectId()Get the ID of the currently active project, or 0 if no project is active. -
getPluginId
public int getPluginId()Get the ID of the currently running plug-in or 0 if no plug-in is running. -
getJobId
public int getJobId()Get the ID of the currently running job or 0 if no job is running. -
toChangeHistoryData
Convert the information about the transaction to aChangeHistoryData
object.- Returns:
- A ChangeHistoryData object
-
getName
Get the name of this transaction.- Since:
- 3.19
-
getUserName
Utility method for loading the name of the currently logged in user. The first call to this method will lookup the name in the database but is then cached.- Returns:
- The name of the currently logged in user
- Since:
- 3.2
-
getProjectName
Utility method for loading the name of the currently active project. The first call to this method will lookup the name in the database but is then cached.- Returns:
- The name of the currently active project, or null if no project is active
- Since:
- 3.2
-
getProjectName
Get the name of the project with the given id. Special cases: 0 = default -
getPluginName
Utility method for loading the name of the currently executing plugin. The first call to this method will lookup the name in the database but is then cached.- Returns:
- The name of the currently executing plugin, or null if no plugin is executing
- Since:
- 3.2
-
getJobName
Utility method for loading the name of the currently executing job. The first call to this method will lookup the name in the database but is then cached.- Returns:
- The name of the currently executing job, or null if no job is executing
- Since:
- 3.2
-