public class ChangeHistory extends BasicItem
Modifier and Type | Field and Description |
---|---|
static Item |
TYPE
The type of item represented by this class.
|
private boolean |
valuesPermissions |
Constructor and Description |
---|
ChangeHistory(ChangeHistoryDetailData data) |
Modifier and Type | Method and Description |
---|---|
static int |
deleteStrayEntries(ProgressReporter progress)
Delete all change history entries that are linking to non-existing items.
|
static ChangeHistory |
getById(DbControl dc,
int id)
Get a
ChangeHistory item when you know the ID. |
String |
getChangeInfo()
Get some additional free-text information about the change.
|
static ItemQuery<ChangeHistory> |
getChangesBy(Job job)
Get all changes made by the specified job.
|
static ItemQuery<ChangeHistory> |
getChangesBy(User user)
Get all changes made by the specified user.
|
static ItemQuery<ChangeHistory> |
getChangesIn(Session session)
Get all changes made in the specified session.
|
ChangeType |
getChangeType()
Get the type of change that was made.
|
Client |
getClient(DbControl dc)
Load the client application that was used when the change was made.
|
Integer |
getClientId()
Get the ID of the client application that was used to
make the change.
|
(package private) ChangeHistoryDetailData |
getData()
Get the
BasicData object that holds all data for this item. |
static ItemQuery<ChangeHistory> |
getHistoryOf(BasicItem item)
Get the change history for a given item.
|
BasicItem |
getItem(DbControl dc)
Load the item that was changed.
|
int |
getItemId()
Get the ID of the item that was changed.
|
Item |
getItemType()
Get the type of the item that was changed.
|
Job |
getJob(DbControl dc)
Load the job that was executing when the change was made.
|
Integer |
getJobId()
Get the ID of the job that was executing when the change was made
|
String |
getNewValue()
Get the new value of the property had immediately after this change.
|
String |
getOldValue()
Get the old value of the property had before this change.
|
PluginDefinition |
getPlugin(DbControl dc)
Load the plug-in that made the change.
|
Integer |
getPluginId()
Get the ID of the plug-in that was making the change.
|
Project |
getProject(DbControl dc)
Load the project that was active when the change was made.
|
Integer |
getProjectId()
Get the ID of the project that was active when the change
was made.
|
Session |
getSession(DbControl dc)
Load the session in which the change was made.
|
int |
getSessionId()
Get the ID of the session in which the change was made.
|
Date |
getTime()
Get the date and time the change was made.
|
Item |
getType()
Get the type of item represented by the object.
|
User |
getUser(DbControl dc)
Load the user that made the change.
|
int |
getUserId()
Get the ID of the user that made the change.
|
(package private) void |
initPermissions(int granted,
int denied)
WRITE permission and higher is always denied.
|
addAnnotatableParents, addUsingItems, addUsingItems, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, validate
public static final Item TYPE
Item.CHANGEHISTORY
,
getType()
private boolean valuesPermissions
ChangeHistory(ChangeHistoryDetailData data)
public static ChangeHistory getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
ChangeHistory
item when you know the ID.dc
- The DbControl
which will be used for
permission checking and database access.id
- The ID of the item to loadChangeHistory
itemItemNotFoundException
- If an item with the specified
ID is not foundPermissionDeniedException
- If the logged in user doesn't
have Permission.READ
permission to the itemBaseException
- If there is another errorpublic static ItemQuery<ChangeHistory> getHistoryOf(BasicItem item)
item
- The item to get the change history forInvalidUseOfNullException
- If the item is nullpublic static ItemQuery<ChangeHistory> getChangesBy(User user)
user
- A user objectInvalidUseOfNullException
- If the user is nullpublic static ItemQuery<ChangeHistory> getChangesBy(Job job)
job
- A job objectInvalidUseOfNullException
- If the job is nullpublic static ItemQuery<ChangeHistory> getChangesIn(Session session)
session
- A session objectInvalidUseOfNullException
- If the session is nullpublic static int deleteStrayEntries(ProgressReporter progress)
progress
- An optional progress reporterChangeHistoryDetailData getData()
BasicItem
BasicData
object that holds all data for this item.public Item getType()
Identifiable
Item
enumeration.void initPermissions(int granted, int denied) throws BaseException
initPermissions
in class BasicItem
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclassBaseException
- If the permissions couldn't be initialisedpublic Date getTime()
public ChangeType getChangeType()
public int getItemId()
public Item getItemType()
public BasicItem getItem(DbControl dc)
dc
- A DbControl to use for database access, or null to
use the same DbControl this history entry belongs toItemNotFoundException
- If the item no longer exists in
the databasePermissionDeniedException
- If the logged in user doesn't
have permission to access the itempublic String getChangeInfo()
public String getOldValue()
public String getNewValue()
public int getUserId()
public User getUser(DbControl dc)
dc
- A DbControl to use for database access, or null to
use the same DbControl this history entry belongs toItemNotFoundException
- If the user no longer exists in
the databasePermissionDeniedException
- If the logged in user doesn't
have permission to access the other userpublic int getSessionId()
public Session getSession(DbControl dc)
dc
- A DbControl to use for database access, or null to
use the same DbControl this history entry belongs toItemNotFoundException
- If the session no longer exists in
the databasePermissionDeniedException
- If the logged in user doesn't
have permission to access the sessionpublic Integer getClientId()
public Client getClient(DbControl dc)
dc
- A DbControl to use for database access, or null to
use the same DbControl this history entry belongs toItemNotFoundException
- If the client application no longer exists in
the databasePermissionDeniedException
- If the logged in user doesn't
have permission to access the clientpublic Integer getProjectId()
public Project getProject(DbControl dc)
dc
- A DbControl to use for database access, or null to
use the same DbControl this history entry belongs toItemNotFoundException
- If the client application no longer exists in
the databasePermissionDeniedException
- If the logged in user doesn't
have permission to access the projectpublic Integer getPluginId()
public PluginDefinition getPlugin(DbControl dc)
dc
- A DbControl to use for database access, or null to
use the same DbControl this history entry belongs toItemNotFoundException
- If the plug-in no longer exists in
the databasePermissionDeniedException
- If the logged in user doesn't
have permission to access the plug-inpublic Integer getJobId()
public Job getJob(DbControl dc)
dc
- A DbControl to use for database access, or null to
use the same DbControl this history entry belongs toItemNotFoundException
- If the job no longer exists in
the databasePermissionDeniedException
- If the logged in user doesn't
have permission to access the job