public class SqlTableHistory extends SqlAbstractTable implements TableHistory
Constructor and Description |
---|
SqlTableHistory() |
Modifier and Type | Method and Description |
---|---|
boolean |
containsURI(long sessionId,
int historyType,
String method,
String uri,
byte[] body) |
void |
delete(int historyId) |
void |
delete(List<Integer> ids)
Deletes from the database all the history records whose ID is in the list
ids , in
batches of 1000 records. |
void |
delete(List<Integer> ids,
int batchSize)
Deletes from the database all the history records whose ID is in the list
ids , in
batches of given batchSize . |
void |
deleteHistorySession(long sessionId) |
void |
deleteHistoryType(long sessionId,
int historyType) |
void |
deleteTemporary()
Deletes all records whose history type was marked as temporary.
|
RecordHistory |
getHistoryCache(HistoryReference ref,
HttpMessage reqMsg) |
List<Integer> |
getHistoryIds(long sessionId)
Gets all the history record IDs of the given session.
|
List<Integer> |
getHistoryIdsExceptOfHistType(long sessionId,
int... histTypes)
Returns all the history record IDs of the given session except the ones with the given
history types.
|
List<Integer> |
getHistoryIdsExceptOfHistTypeStartingAt(long sessionId,
int startAtHistoryId,
int... histTypes)
Returns the history record IDs of the given session except the ones with the given history
types starting at the specified historyId (inclusive).
|
List<Integer> |
getHistoryIdsOfHistType(long sessionId,
int... histTypes)
Gets all the history record IDs of the given session and with the given history types.
|
List<Integer> |
getHistoryIdsOfHistTypeStartingAt(long sessionId,
int startAtHistoryId,
int... histTypes)
Gets the history record IDs of the given session and with the given history types starting at
the specified historyId (inclusive).
|
List<Integer> |
getHistoryIdsStartingAt(long sessionId,
int startAtHistoryId)
Gets the history record IDs of the given session starting at the specified historyId
(inclusive).
|
List<Integer> |
getHistoryList(long sessionId,
int histType,
String filter,
boolean isRequest) |
int |
lastIndex() |
RecordHistory |
read(int historyId) |
protected void |
reconnect(Connection conn) |
static void |
setHistoryTypeAsTemporary(int historyType)
Deprecated.
(2.5.0) Use
HistoryReference.addTemporaryType(int) instead. |
static void |
unsetHistoryTypeAsTemporary(int historyType)
Deprecated.
(2.5.0) Use
HistoryReference.removeTemporaryType(int) instead. |
void |
updateNote(int historyId,
String note) |
RecordHistory |
write(long sessionId,
int histType,
HttpMessage msg) |
databaseOpen, getConnection
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
databaseOpen
protected void reconnect(Connection conn) throws DatabaseException
reconnect
in class SqlAbstractTable
DatabaseException
public RecordHistory read(int historyId) throws HttpMalformedHeaderException, DatabaseException
read
in interface TableHistory
HttpMalformedHeaderException
DatabaseException
public RecordHistory write(long sessionId, int histType, HttpMessage msg) throws HttpMalformedHeaderException, DatabaseException
write
in interface TableHistory
HttpMalformedHeaderException
DatabaseException
public List<Integer> getHistoryIds(long sessionId) throws DatabaseException
TableHistory
getHistoryIds
in interface TableHistory
sessionId
- the ID of session of the history records to be returnedList
with all the history IDs of the given session, never null
DatabaseException
- if an error occurred while getting the history IDsTableHistory.getHistoryIdsOfHistType(long, int...)
public List<Integer> getHistoryIdsStartingAt(long sessionId, int startAtHistoryId) throws DatabaseException
TableHistory
getHistoryIdsStartingAt
in interface TableHistory
sessionId
- the ID of session of the history records to be returnedstartAtHistoryId
- filters historyIds with ≥ startAtHistoryIdList
with the history IDs of the given session starting at the specified
historyId (inclusive), never null
DatabaseException
- if an error occurred while getting the history IDspublic List<Integer> getHistoryIdsOfHistType(long sessionId, int... histTypes) throws DatabaseException
TableHistory
getHistoryIdsOfHistType
in interface TableHistory
sessionId
- the ID of session of the history recordshistTypes
- the history types of the history records that should be returnedList
with all the history IDs of the given session and history types, never
null
DatabaseException
- if an error occurred while getting the history IDsTableHistory.getHistoryIds(long)
,
TableHistory.getHistoryIdsExceptOfHistType(long, int...)
public List<Integer> getHistoryIdsOfHistTypeStartingAt(long sessionId, int startAtHistoryId, int... histTypes) throws DatabaseException
TableHistory
getHistoryIdsOfHistTypeStartingAt
in interface TableHistory
sessionId
- the ID of session of the history recordsstartAtHistoryId
- filters historyIds with ≥ startAtHistoryIdhistTypes
- the history types of the history records that should be returnedList
with all the history IDs of the given session and history types
starting at the specified historyId (inclusive), never null
DatabaseException
- if an error occurred while getting the history IDspublic List<Integer> getHistoryIdsExceptOfHistType(long sessionId, int... histTypes) throws DatabaseException
TableHistory
getHistoryIdsExceptOfHistType
in interface TableHistory
sessionId
- the ID of session of the history recordshistTypes
- the history types of the history records that should be excludedList
with all the history IDs of the given session and history types, never
null
DatabaseException
- if an error occurred while getting the history IDsTableHistory.getHistoryIdsOfHistType(long, int...)
public List<Integer> getHistoryIdsExceptOfHistTypeStartingAt(long sessionId, int startAtHistoryId, int... histTypes) throws DatabaseException
TableHistory
getHistoryIdsExceptOfHistTypeStartingAt
in interface TableHistory
sessionId
- the ID of session of the history recordsstartAtHistoryId
- filters historyIds with ≥ startAtHistoryIdhistTypes
- the history types of the history records that should be excludedList
with all the history IDs of the given session and history types
starting at the specified historyId (inclusive), never null
DatabaseException
- if an error occurred while getting the history IDspublic List<Integer> getHistoryList(long sessionId, int histType, String filter, boolean isRequest) throws DatabaseException
getHistoryList
in interface TableHistory
DatabaseException
public void deleteHistorySession(long sessionId) throws DatabaseException
deleteHistorySession
in interface TableHistory
DatabaseException
public void deleteHistoryType(long sessionId, int historyType) throws DatabaseException
deleteHistoryType
in interface TableHistory
DatabaseException
public void delete(int historyId) throws DatabaseException
delete
in interface TableHistory
DatabaseException
public void delete(List<Integer> ids) throws DatabaseException
TableHistory
ids
, in
batches of 1000 records.delete
in interface TableHistory
ids
- a List
containing all the IDs of the history records to be deletedDatabaseException
- if an error occurred while deleting the history recordsTableHistory.delete(List, int)
public void delete(List<Integer> ids, int batchSize) throws DatabaseException
TableHistory
ids
, in
batches of given batchSize
.delete
in interface TableHistory
ids
- a List
containing all the IDs of the history records to be deletedbatchSize
- the maximum size of records to delete in a single batchDatabaseException
- if an error occurred while deleting the history records@Deprecated public static void setHistoryTypeAsTemporary(int historyType)
HistoryReference.addTemporaryType(int)
instead.historyType
- the history type that will be set as temporarydeleteTemporary()
@Deprecated public static void unsetHistoryTypeAsTemporary(int historyType)
HistoryReference.removeTemporaryType(int)
instead.historyType
- the history type that will be marked as temporarydeleteTemporary()
public void deleteTemporary() throws DatabaseException
TableHistory
deleteTemporary
in interface TableHistory
DatabaseException
- if an error occurred while deleting the temporary history recordsHistoryReference.getTemporaryTypes()
public boolean containsURI(long sessionId, int historyType, String method, String uri, byte[] body) throws DatabaseException
containsURI
in interface TableHistory
DatabaseException
public RecordHistory getHistoryCache(HistoryReference ref, HttpMessage reqMsg) throws DatabaseException, HttpMalformedHeaderException
getHistoryCache
in interface TableHistory
DatabaseException
HttpMalformedHeaderException
public void updateNote(int historyId, String note) throws DatabaseException
updateNote
in interface TableHistory
DatabaseException
public int lastIndex()
lastIndex
in interface TableHistory