use of eu.europa.ec.fisheries.schema.audit.search.v1.ListCriteria in project UVMS-ActivityModule-APP by UnionVMS.
the class MovementModuleServiceBean method addListCriteria.
private void addListCriteria(List<String> vesselIds, MovementQuery movementQuery) {
for (String vesselId : vesselIds) {
ListCriteria listCriteria = new ListCriteria();
listCriteria.setKey(SearchKey.CONNECT_ID);
listCriteria.setValue(vesselId);
movementQuery.getMovementSearchCriteria().add(listCriteria);
}
}
use of eu.europa.ec.fisheries.schema.audit.search.v1.ListCriteria in project UVMS-Docker by UnionVMS.
the class AssetTestHelper method assertAuditLog.
private static void assertAuditLog(String guid, AuditOperationEnum auditOperation, AuditLogListQuery auditLogListQuery, Date fromDate) throws Exception {
ListCriteria typeListCriteria = new ListCriteria();
typeListCriteria.setKey(SearchKey.OPERATION);
typeListCriteria.setValue(auditOperation.getValue());
auditLogListQuery.getAuditSearchCriteria().add(typeListCriteria);
ListCriteria fromDateListCriteria = new ListCriteria();
fromDateListCriteria.setKey(SearchKey.FROM_DATE);
fromDateListCriteria.setValue(DateUtils.parseUTCDateToString(fromDate));
auditLogListQuery.getAuditSearchCriteria().add(fromDateListCriteria);
List<AuditLogType> auditLogs = AuditHelper.getAuditLogs(auditLogListQuery);
boolean found = false;
for (AuditLogType auditLogType : auditLogs) {
if (auditLogType.getAffectedObject().equals(guid)) {
found = true;
}
}
assertTrue(found);
}
use of eu.europa.ec.fisheries.schema.audit.search.v1.ListCriteria in project UVMS-Docker by UnionVMS.
the class AssetTestHelper method getAssetAuditLogListQuery.
private static AuditLogListQuery getAssetAuditLogListQuery(AuditObjectTypeEnum auditObjectType) {
AuditLogListQuery auditLogListQuery = AuditHelper.getBasicAuditLogListQuery();
ListCriteria typeListCriteria = new ListCriteria();
typeListCriteria.setKey(SearchKey.TYPE);
typeListCriteria.setValue(auditObjectType.getValue());
auditLogListQuery.getAuditSearchCriteria().add(typeListCriteria);
return auditLogListQuery;
}
use of eu.europa.ec.fisheries.schema.audit.search.v1.ListCriteria in project UVMS-Docker by UnionVMS.
the class MovementMovementRestIT method createMovementQueryNumberOfLatestReports.
/**
* Creates the movement query number of latest reports.
*
* @param numberPositions the number positions
* @return the movement query
*/
private MovementQuery createMovementQueryNumberOfLatestReports(int numberPositions) {
MovementQuery movementQuery = new MovementQuery();
movementQuery.setExcludeFirstAndLastSegment(false);
ListPagination listPagination = new ListPagination();
listPagination.setListSize(BigInteger.valueOf(1000000));
listPagination.setPage(BigInteger.valueOf(1));
movementQuery.setPagination(listPagination);
ListCriteria listCriteria = new ListCriteria();
listCriteria.setKey(SearchKey.NR_OF_LATEST_REPORTS);
listCriteria.setValue("" + numberPositions);
movementQuery.getMovementSearchCriteria().add(listCriteria);
RangeCriteria rangeCriteria = new RangeCriteria();
rangeCriteria.setKey(RangeKeyType.DATE);
rangeCriteria.setFrom("2017-09-25 15:33:14 +0200");
rangeCriteria.setTo("2017-10-09 15:33:14 +0200");
movementQuery.getMovementRangeSearchCriteria().add(rangeCriteria);
return movementQuery;
}
use of eu.europa.ec.fisheries.schema.audit.search.v1.ListCriteria in project UVMS-Docker by UnionVMS.
the class MovementMovementRestIT method createMovementQuery.
/**
* Creates the movement query.
*
* @return the movement query
*/
private MovementQuery createMovementQuery() {
MovementQuery movementQuery = new MovementQuery();
movementQuery.setExcludeFirstAndLastSegment(false);
ListPagination listPagination = new ListPagination();
listPagination.setListSize(BigInteger.valueOf(100));
listPagination.setPage(BigInteger.valueOf(1));
movementQuery.setPagination(listPagination);
ListCriteria listCriteria = new ListCriteria();
listCriteria.setKey(SearchKey.CONNECT_ID);
listCriteria.setValue("Some connectId");
movementQuery.getMovementSearchCriteria().add(listCriteria);
return movementQuery;
}
Aggregations