
public class XMLTransferDAO extends Object implements TransferDAO
| Modifier and Type | Field and Description |
|---|---|
static String |
ROOT_ELEMENT |
static String |
ROOT_LIST |
static String |
XMLEXTENSION |
| Constructor and Description |
|---|
XMLTransferDAO() |
| Modifier and Type | Method and Description |
|---|---|
static int |
clearCache()
To enable clear of oldest entries in the cache
|
void |
close() |
long |
count(List<Filter> fitlers)
|
static void |
createLruCache(int limit,
long ttl)
Create the LRU cache
|
void |
delete(Transfer transfer)
Remove the specified object from the persistance layer
|
void |
deleteAll()
|
boolean |
exist(long id,
String requester,
String requested,
String owner)
Verify if a Transfer object with the specified Special ID exists in the
persistance layer
|
boolean |
exist(String id)
|
List<Transfer> |
find(List<Filter> fitlers)
|
List<Transfer> |
find(List<Filter> filters,
int limit)
|
List<Transfer> |
find(List<Filter> filters,
int limit,
int offset)
|
List<Transfer> |
find(List<Filter> filters,
String column,
boolean ascend)
|
List<Transfer> |
find(List<Filter> filters,
String column,
boolean ascend,
int limit)
|
List<Transfer> |
find(List<Filter> filters,
String column,
boolean ascend,
int limit,
int offset)
|
List<Transfer> |
getAll()
Retrieve all objects in a List from the persistance layer
|
static String |
hashStatus() |
void |
insert(Transfer transfer)
Insert the specified object in the persistance layer
|
static void |
removeNoDbSpecialId(long specialId)
To allow to remove specifically one SpecialId from MemoryHashmap
|
Transfer |
select(long id,
String requester,
String requested,
String owner)
Retrieve the Transfer object with the specified Special ID from the
persistance layer
|
Transfer |
select(String id)
|
static void |
setNoFile(boolean newNoFile) |
void |
update(List<Filter> filters,
String toSet)
Update all objects corresponding to the given filters in a List
from the persistance layer
|
void |
update(Transfer transfer)
Update the specified object in the persistance layer
|
static void |
updateLruCacheTimeout(long ttl)
To update the TTL for the cache (to 10xTIMEOUT)
|
static void |
updateUsed(long specialId)
To update the usage TTL of the associated object
|
public static final String ROOT_LIST
public static final String ROOT_ELEMENT
public static final String XMLEXTENSION
public static void setNoFile(boolean newNoFile)
newNoFile - if True, no file will be created but only on Memory
using LruCachepublic static void createLruCache(int limit,
long ttl)
limit - limit of number of entries in the cachettl - time to leave usedpublic static String hashStatus()
public static int clearCache()
public static void updateLruCacheTimeout(long ttl)
ttl - public static void removeNoDbSpecialId(long specialId)
specialId - public static void updateUsed(long specialId)
specialId - public void close()
close in interface AbstractDAO<Transfer>public void delete(Transfer transfer)
AbstractDAOdelete in interface AbstractDAO<Transfer>transfer - object to deletepublic void deleteAll()
deleteAll in interface AbstractDAO<Transfer>public List<Transfer> getAll() throws DAOConnectionException
AbstractDAOgetAll in interface AbstractDAO<Transfer>DAOConnectionException - If data access error occurspublic boolean exist(long id,
String requester,
String requested,
String owner)
TransferDAOexist in interface TransferDAOid - special ID of the Transfer object verifiedpublic List<Transfer> find(List<Filter> fitlers) throws DAOConnectionException
find in interface AbstractDAO<Transfer>fitlers - List of filterDAOConnectionException - If data access error occurspublic long count(List<Filter> fitlers) throws DAOConnectionException
count in interface AbstractDAO<Transfer>count in interface TransferDAOfitlers - List of filterDAOConnectionException - If data access error occurspublic Transfer select(String id)
select in interface AbstractDAO<Transfer>id - id of the object requestedpublic boolean exist(String id)
exist in interface AbstractDAO<Transfer>id - id of the object verifiedpublic List<Transfer> find(List<Filter> filters, int limit) throws DAOConnectionException
find in interface AbstractDAO<Transfer>find in interface TransferDAOfilters - List of filterlimit - max number of items to getDAOConnectionException - If data access error occurspublic List<Transfer> find(List<Filter> filters, int limit, int offset) throws DAOConnectionException
find in interface TransferDAOfilters - List of filterDAOConnectionException - If data access error occurspublic List<Transfer> find(List<Filter> filters, String column, boolean ascend) throws DAOConnectionException
find in interface AbstractDAO<Transfer>find in interface TransferDAOfilters - List of filtercolumn - field to sort onascend - True for ascending, False for descending orderDAOConnectionException - If data access error occurspublic List<Transfer> find(List<Filter> filters, String column, boolean ascend, int limit) throws DAOConnectionException
find in interface AbstractDAO<Transfer>find in interface TransferDAOfilters - List of filtercolumn - field to sort onascend - True for ascending, False for descending orderlimit - max number of items to getDAOConnectionException - If data access error occurspublic List<Transfer> find(List<Filter> filters, String column, boolean ascend, int limit, int offset) throws DAOConnectionException
find in interface AbstractDAO<Transfer>find in interface TransferDAOfilters - List of filtercolumn - field to sort onascend - True for ascending, False for descending orderlimit - max number of items to getoffset - start for items to getDAOConnectionException - If data access error occurspublic void update(List<Filter> filters, String toSet) throws DAOConnectionException
AbstractDAOupdate in interface AbstractDAO<Transfer>filters - List of filtertoSet - field to update as "field1 = value1, field2 = value2, ..."DAOConnectionException - If data access error occurspublic void insert(Transfer transfer) throws DAOConnectionException
AbstractDAOinsert in interface AbstractDAO<Transfer>transfer - object to insertDAOConnectionException - If a data access error occurspublic Transfer select(long id, String requester, String requested, String owner) throws DAOConnectionException, DAONoDataException
TransferDAOselect in interface TransferDAOid - special ID of the Transfer object requestedDAOConnectionException - If a data access error occursDAONoDataException - if no data are availablepublic void update(Transfer transfer) throws DAOConnectionException
AbstractDAOupdate in interface AbstractDAO<Transfer>transfer - object to updateDAOConnectionException - If a data access error occursCopyright © 2009–2022 Waarp. All rights reserved.