public class XMLTransferDAO extends Object implements TransferDAO
Modifier and Type | Field and Description |
---|---|
static String |
BLOCK_SIZE_FIELD |
static String |
FILE_INFO_FIELD |
static String |
FILENAME_FIELD |
static String |
GLOBAL_STEP_FIELD |
static String |
ID_FIELD |
static String |
INFO_STATUS_FIELD |
static String |
IS_MOVED_FIELD |
static String |
LAST_GLOBAL_STEP_FIELD |
static String |
ORIGINAL_NAME_FIELD |
static String |
OWNER_FIELD |
static String |
RANK_FIELD |
static String |
REQUESTED_FIELD |
static String |
REQUESTER_FIELD |
static String |
RETRIEVE_MODE_FIELD |
static String |
ROOT_ELEMENT |
static String |
ROOT_LIST |
static String |
RULE_FIELD |
static String |
START_FIELD |
static String |
STEP_FIELD |
static String |
STEP_STATUS_FIELD |
static String |
STOP_FIELD |
static String |
TRANSFER_MODE_FIELD |
static String |
XMLEXTENSION |
Constructor and Description |
---|
XMLTransferDAO(String filePath) |
Modifier and Type | Method and Description |
---|---|
static int |
clearCache()
To enable clear of oldest entries in the cache
|
void |
close() |
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)
|
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 GLOBAL_STEP_FIELD
public static final String LAST_GLOBAL_STEP_FIELD
public static final String STEP_FIELD
public static final String RANK_FIELD
public static final String STEP_STATUS_FIELD
public static final String RETRIEVE_MODE_FIELD
public static final String FILENAME_FIELD
public static final String IS_MOVED_FIELD
public static final String RULE_FIELD
public static final String BLOCK_SIZE_FIELD
public static final String ORIGINAL_NAME_FIELD
public static final String FILE_INFO_FIELD
public static final String TRANSFER_MODE_FIELD
public static final String START_FIELD
public static final String STOP_FIELD
public static final String INFO_STATUS_FIELD
public static final String OWNER_FIELD
public static final String REQUESTER_FIELD
public static final String REQUESTED_FIELD
public static final String ID_FIELD
public static final String XMLEXTENSION
public XMLTransferDAO(String filePath)
public 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 final void removeNoDbSpecialId(long specialId)
specialId
- public static final void updateUsed(long specialId)
specialId
- public void close()
close
in interface AbstractDAO<Transfer>
public void delete(Transfer transfer) throws DAOConnectionException
AbstractDAO
delete
in interface AbstractDAO<Transfer>
transfer
- object to deleteDAOConnectionException
- If a data access error occurspublic void deleteAll() throws DAOConnectionException
deleteAll
in interface AbstractDAO<Transfer>
DAOConnectionException
- If a data access error occurspublic List<Transfer> getAll() throws DAOConnectionException
AbstractDAO
getAll
in interface AbstractDAO<Transfer>
DAOConnectionException
- If data access error occurspublic boolean exist(long id, String requester, String requested, String owner) throws DAOConnectionException
TransferDAO
exist
in interface TransferDAO
id
- special ID of the Transfer object verifiedDAOConnectionException
- If a data access error occurspublic List<Transfer> find(List<Filter> fitlers) throws DAOConnectionException
find
in interface AbstractDAO<Transfer>
fitlers
- List of filterDAOConnectionException
- If data access error occurspublic Transfer select(String id) throws DAOConnectionException, DAONoDataException
select
in interface AbstractDAO<Transfer>
id
- id of the object requestedDAOConnectionException
- If a data access error occursDAONoDataException
- if no data are availablepublic boolean exist(String id) throws DAOConnectionException
exist
in interface AbstractDAO<Transfer>
id
- id of the object verifiedDAOConnectionException
- If a data access error occurspublic List<Transfer> find(List<Filter> filters, int limit) throws DAOConnectionException
find
in interface TransferDAO
filters
- List of filterDAOConnectionException
- If data access error occurspublic List<Transfer> find(List<Filter> filters, int limit, int offset) throws DAOConnectionException
find
in interface TransferDAO
filters
- List of filterDAOConnectionException
- If data access error occurspublic List<Transfer> find(List<Filter> filters, String column, boolean ascend) throws DAOConnectionException
find
in interface TransferDAO
filters
- List of filterDAOConnectionException
- If data access error occurspublic List<Transfer> find(List<Filter> filters, String column, boolean ascend, int limit) throws DAOConnectionException
find
in interface TransferDAO
filters
- List of filterDAOConnectionException
- If data access error occurspublic List<Transfer> find(List<Filter> filters, String column, boolean ascend, int limit, int offset) throws DAOConnectionException
find
in interface TransferDAO
filters
- List of filterDAOConnectionException
- If data access error occurspublic void insert(Transfer transfer) throws DAOConnectionException
AbstractDAO
insert
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
TransferDAO
select
in interface TransferDAO
id
- special ID of the Transfer object requestedDAOConnectionException
- If a data access error occursDAONoDataException
- if no data are availablepublic void update(Transfer transfer) throws DAOConnectionException
AbstractDAO
update
in interface AbstractDAO<Transfer>
transfer
- object to updateDAOConnectionException
- If a data access error occursCopyright © 2009–2020 Waarp. All rights reserved.