public final class TransHeader
extends java.lang.Object
Constructor and Description |
---|
TransHeader(VirtualDB layer,
long transId,
java.util.Date transDate,
java.lang.String personGlobalID,
java.lang.String reason,
java.lang.Long transGroupId,
boolean inSlave) |
Modifier and Type | Method and Description |
---|---|
void |
adjustReason(java.lang.String reason) |
static boolean |
assertTransIdValid(long transId)
check if the transaction is valid
|
void |
checkInMemory()
Checks that all the records modified in this transaction are if in cache at least up to this transaction number.
|
boolean |
dataKnownToExistAt(DBData data)
is it know that this record existed at the time of this transaction.
|
static void |
disableTranIdAsserts()
Disable the assert checks for transaction ids.
|
TransRecord[] |
fetchRecordList()
fetch the record list from cache.
|
ArchiveLayerData |
findFilteredLayerData(long rowId,
DBClass realClass,
java.util.Date asOfDate,
Hint hint,
TransHeader[] exclude,
boolean doNotUseCurrentData)
filter the result by classType and asOfDate
|
DBObject |
findKey(GlobalKey gKey,
ArchiveDataSource ads)
Finds a new DBObject by its primary key
INTERNAL ONLY
|
TransGroup |
findTransGroup()
return the transaction group.
|
java.lang.String |
getActions() |
ArchiveLayerData |
getCachedLayerData(long rowUID) |
PossibleRowsHolder[] |
getClauseCache(DBClass dbClass,
DBPathClause clause)
Check the cache for this clause.
|
VirtualDB |
getDatabase() |
java.lang.String |
getKey() |
Person |
getPerson() |
java.lang.String |
getpersonGlobalID()
The personGlobalID for this transaction.
|
java.lang.String |
getReason()
The reason for this transaction.
|
TransRecord[] |
getRecordList() |
TransRecord |
getRow(long row_uid) |
long |
getTranGroupId()
The transaction group
|
static java.util.Date |
getTranscationDate(DBObject obj,
DBField fld,
java.lang.Object value,
java.util.Date fromDate,
java.util.Date toDate)
Returns the transaction date of the object when field is updated to value between fromDate and toDate
If field is updated to value more than once between fromDate and toDate, the latest transaction date will be returned.
|
java.util.Date |
getTransDate() |
long |
getTransId()
returns the transaction id for this transaction header.
|
static TransHeader |
latestTransaction(DBObject obj) |
static TransHeader |
latestTransaction(DBObject obj,
VirtualDB vDB)
Gets latest Transaction for this object in specified datasource
|
static TransHeader |
latestTransactionInLayers(DBObject obj)
Gets Latest Transaction from family of layers
|
static TransHeader[] |
listTransaction(DBClass cls,
long rowUID,
java.util.Date fromDate,
java.util.Date toDate)
List of all the transactions for this Object between fromDate and toDate
|
static TransHeader[] |
listTransaction(DBClass dbClass,
long rowUid,
long mustFindTransId) |
static TransHeader[] |
listTransaction(DBObject obj)
List of all the transactions for this Object
|
static TransHeader[] |
listTransaction(DBObject obj,
java.util.Date fromDate,
java.util.Date toDate)
List of all the transactions for this Object between fromDate and toDate
|
static TransHeader[] |
listTransaction(Path path,
long rowUID,
java.util.Date fromDate,
java.util.Date toDate,
boolean listAll)
List of all the transactions for this Object between fromDate and toDate
|
static TransHeader[] |
listTransaction(VirtualDB layer,
java.util.Date fromDate,
java.util.Date toDate)
List of all the transactions for this Object between fromDate and toDate
|
static TransHeader |
maxTransaction(VirtualDB layer,
DBClass dbClass,
long rowUid) |
void |
placeCachedLayerData(long rowUID,
ArchiveLayerData ld)
place into cache
|
DBObject |
restore() |
long |
reverse(Login login) |
long |
reverse(Login login,
boolean replayMode,
boolean eraseMode) |
void |
reverse(MutableDataSource mds,
boolean replayMode) |
static java.lang.Iterable<TransHeader> |
search(VirtualDB layer,
java.util.Date fromDate) |
static void |
sortHeaders(TransHeader[] list) |
void |
stats(CollectorDBClass collector) |
java.lang.String |
toString()
to string
|
static void |
writeThreadEraseLog(java.lang.String msg)
write to the current log
|
public TransHeader(@Nonnull VirtualDB layer, long transId, @Nonnull java.util.Date transDate, java.lang.String personGlobalID, java.lang.String reason, java.lang.Long transGroupId, boolean inSlave)
layer
- the layertransId
- the transactiontransDate
- the datepersonGlobalID
- the personreason
- the reasontransGroupId
- the groupinSlave
- is a slave@CheckReturnValue @Nullable public ArchiveLayerData getCachedLayerData(long rowUID)
rowUID
- the rowpublic void placeCachedLayerData(long rowUID, @Nonnull ArchiveLayerData ld)
rowUID
- the rowld
- the layer data@CheckReturnValue @Nonnull public static java.lang.Iterable<TransHeader> search(@Nonnull VirtualDB layer, @Nonnull java.util.Date fromDate)
@CheckReturnValue @Nonnull public ArchiveLayerData findFilteredLayerData(long rowId, DBClass realClass, java.util.Date asOfDate, Hint hint, TransHeader[] exclude, boolean doNotUseCurrentData) throws java.lang.Exception
rowId
- The row IDrealClass
- The real class.asOfDate
- The archive datehint
- the hintexclude
- the list of transactions to excludedoNotUseCurrentData
- will the archive use the current data ?java.lang.Exception
- A serious problem@CheckReturnValue public long getTranGroupId()
public void stats(CollectorDBClass collector)
collector
- the collector@CheckReturnValue public boolean dataKnownToExistAt(@Nonnull DBData data) throws java.sql.SQLException
data
- the data to checkjava.sql.SQLException
- a serious problempublic void checkInMemory() throws java.lang.Exception
java.lang.Exception
- A serious problem@CheckReturnValue @Nonnull public PossibleRowsHolder[] getClauseCache(@Nonnull DBClass dbClass, @Nullable DBPathClause clause)
clause
- the clausedbClass
- the class@CheckReturnValue @Nonnull public DBObject findKey(@Nonnull GlobalKey gKey, @Nonnull ArchiveDataSource ads) throws NotFoundException
ads
- The archive data source to used.gKey
- The key to findNotFoundException
- The key was not found@CheckReturnValue @Nonnull public java.lang.String getReason()
@CheckReturnValue @Nonnull public java.lang.String getpersonGlobalID()
@CheckReturnValue @Nonnull public TransGroup findTransGroup() throws NotFoundException
NotFoundException
- The transaction group was not found.@CheckReturnValue @Nonnull public java.lang.String getActions() throws java.lang.Exception
java.lang.Exception
- a serious problempublic long reverse(Login login) throws java.lang.Exception
login
- the loginjava.lang.Exception
- a serious problempublic long reverse(Login login, boolean replayMode, boolean eraseMode) throws java.lang.Exception
login
- the loginreplayMode
- Reverse only if safe to do so.eraseMode
- we are going to erase the transactionjava.lang.Exception
- a serious problempublic static void writeThreadEraseLog(java.lang.String msg)
msg
- message to logpublic void reverse(MutableDataSource mds, boolean replayMode) throws java.lang.Exception
mds
- the mutable data sourcereplayMode
- Reverse only if safe to do so.java.lang.Exception
- a serious problem@CheckReturnValue @Nullable public DBObject restore()
@CheckReturnValue @Nullable public TransRecord[] fetchRecordList()
@CheckReturnValue @Nonnull public TransRecord[] getRecordList() throws java.lang.Exception
java.lang.Exception
- a serious problem@CheckReturnValue @Nonnull public static TransHeader[] listTransaction(@Nullable DBObject obj) throws java.lang.Exception
obj
- the objectjava.lang.Exception
- a serious problem@CheckReturnValue @Nonnull public static TransHeader maxTransaction(@Nonnull VirtualDB layer, @Nonnull DBClass dbClass, long rowUid) throws java.lang.Exception
dbClass
- the classrowUid
- the rowlayer
- the layerjava.lang.Exception
- a serious problem@CheckReturnValue @Nonnull public static TransHeader[] listTransaction(DBClass dbClass, long rowUid, long mustFindTransId) throws java.lang.Exception
dbClass
- the classrowUid
- the rowmustFindTransId
- the transaction we must findjava.lang.Exception
- a serious problempublic static void sortHeaders(@Nonnull TransHeader[] list)
list
- the list@CheckReturnValue @Nonnull public static TransHeader[] listTransaction(@Nullable DBObject obj, @Nullable java.util.Date fromDate, @Nullable java.util.Date toDate) throws java.lang.Exception
obj
- The DBObject to list the records for.fromDate
- From what timestamp ( maybe null)toDate
- To what timestamp ( maybe null)java.lang.Exception
- A serious problem@CheckReturnValue @Nonnull public static TransHeader[] listTransaction(@Nonnull DBClass cls, long rowUID, @Nullable java.util.Date fromDate, @Nullable java.util.Date toDate) throws java.lang.Exception
cls
- the classrowUID
- the rowfromDate
- From what timestamp ( maybe null)toDate
- To what timestamp ( maybe null)java.lang.Exception
- A serious problem@CheckReturnValue @Nonnull public static TransHeader[] listTransaction(VirtualDB layer, java.util.Date fromDate, java.util.Date toDate) throws java.lang.Exception
layer
- the layer to searchfromDate
- From what timestamp ( maybe null)toDate
- To what timestamp ( maybe null)java.lang.Exception
- A serious problem@CheckReturnValue @Nonnull public static TransHeader[] listTransaction(Path path, long rowUID, java.util.Date fromDate, java.util.Date toDate, boolean listAll) throws java.lang.Exception
path
- the pathrowUID
- the rowfromDate
- From what timestamp ( maybe null)toDate
- To what timestamp ( maybe null)listAll
- To list all the transactions from this path if the inward link field is Derived or Formulajava.lang.Exception
- A serious problem@CheckReturnValue @Nullable public static TransHeader latestTransactionInLayers(@Nullable DBObject obj) throws java.lang.Exception
obj
- the objectjava.lang.Exception
- Exception A serious problem@CheckReturnValue @Nullable public static TransHeader latestTransaction(@Nonnull DBObject obj) throws java.lang.Exception
obj
- the objectjava.lang.Exception
- a serious problem@CheckReturnValue @Nullable public static TransHeader latestTransaction(@Nullable DBObject obj, @Nonnull VirtualDB vDB) throws java.lang.Exception
obj
- the objectvDB
- the layerjava.lang.Exception
- if the Transaction Id is not found@CheckReturnValue @Nullable public static java.util.Date getTranscationDate(DBObject obj, DBField fld, java.lang.Object value, java.util.Date fromDate, java.util.Date toDate) throws java.lang.Exception
obj
- the objectfld
- the fieldvalue
- the valuefromDate
- form datetoDate
- to datejava.lang.Exception
- a serious problem@CheckReturnValue @Nonnull public VirtualDB getDatabase()
@CheckReturnValue @Nullable public TransRecord getRow(long row_uid)
row_uid
- the row@CheckReturnValue public long getTransId()
@CheckReturnValue @Nonnull public java.util.Date getTransDate()
@CheckReturnValue @Nullable public Person getPerson()
public void adjustReason(@Nonnull java.lang.String reason) throws java.lang.Exception
java.lang.Exception
public static void disableTranIdAsserts()
@CheckReturnValue public static boolean assertTransIdValid(long transId)
transId
- the transaction id@CheckReturnValue @Nonnull public java.lang.String toString()
toString
in class java.lang.Object
@CheckReturnValue @Nonnull public java.lang.String getKey()
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.