Search in sources :

Example 1 with ListCriteria

use of eu.europa.ec.fisheries.schema.movement.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);
    }
}
Also used : ListCriteria(eu.europa.ec.fisheries.schema.movement.search.v1.ListCriteria)

Example 2 with ListCriteria

use of eu.europa.ec.fisheries.schema.movement.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);
}
Also used : AuditLogType(eu.europa.ec.fisheries.schema.audit.v1.AuditLogType) ListCriteria(eu.europa.ec.fisheries.schema.audit.search.v1.ListCriteria) AssetListCriteria(eu.europa.ec.fisheries.wsdl.asset.types.AssetListCriteria)

Example 3 with ListCriteria

use of eu.europa.ec.fisheries.schema.movement.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;
}
Also used : AuditLogListQuery(eu.europa.ec.fisheries.schema.audit.search.v1.AuditLogListQuery) ListCriteria(eu.europa.ec.fisheries.schema.audit.search.v1.ListCriteria) AssetListCriteria(eu.europa.ec.fisheries.wsdl.asset.types.AssetListCriteria)

Example 4 with ListCriteria

use of eu.europa.ec.fisheries.schema.movement.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;
}
Also used : MovementQuery(eu.europa.ec.fisheries.schema.movement.search.v1.MovementQuery) RangeCriteria(eu.europa.ec.fisheries.schema.movement.search.v1.RangeCriteria) ListCriteria(eu.europa.ec.fisheries.schema.movement.search.v1.ListCriteria) ListPagination(eu.europa.ec.fisheries.schema.movement.search.v1.ListPagination)

Example 5 with ListCriteria

use of eu.europa.ec.fisheries.schema.movement.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;
}
Also used : MovementQuery(eu.europa.ec.fisheries.schema.movement.search.v1.MovementQuery) ListCriteria(eu.europa.ec.fisheries.schema.movement.search.v1.ListCriteria) ListPagination(eu.europa.ec.fisheries.schema.movement.search.v1.ListPagination)

Aggregations

ListCriteria (eu.europa.ec.fisheries.schema.movement.search.v1.ListCriteria)3 ListCriteria (eu.europa.ec.fisheries.schema.audit.search.v1.ListCriteria)2 ListPagination (eu.europa.ec.fisheries.schema.movement.search.v1.ListPagination)2 MovementQuery (eu.europa.ec.fisheries.schema.movement.search.v1.MovementQuery)2 AssetListCriteria (eu.europa.ec.fisheries.wsdl.asset.types.AssetListCriteria)2 AuditLogListQuery (eu.europa.ec.fisheries.schema.audit.search.v1.AuditLogListQuery)1 AuditLogType (eu.europa.ec.fisheries.schema.audit.v1.AuditLogType)1 RangeCriteria (eu.europa.ec.fisheries.schema.movement.search.v1.RangeCriteria)1