public void addCDCQuery ( List < ? extends IEntity > entities , String changedSince , String bId ) throws FMSException { if ( entities == null || entities . isEmpty ( ) ) { throw new FMSException ( "Entities is required." ) ; } if ( ! StringUtils . hasText ( changedSince ) ) { throw new FMSException ( "changedSince is required." ) ; } CDCQuery cdcQuery = new CDCQuery ( ) ; StringBuffer entityParam = new StringBuffer ( ) ; for ( IEntity entity : entities ) { entityParam . append ( entity . getClass ( ) . getSimpleName ( ) ) . append ( "," ) ; } entityParam . delete ( entityParam . length ( ) - 1 , entityParam . length ( ) ) ; cdcQuery . setEntities ( entityParam . toString ( ) ) ; try { cdcQuery . setChangedSince ( DateUtils . getDateFromString ( changedSince ) ) ; } catch ( ParseException e ) { LOG . error ( "ParseException while converting to Date." , e ) ; throw new FMSException ( "ParseException while converting to Date. Please provide valid DateTime (yyyy-MM-ddTHH:mm:ss.SSSZ)." , e ) ; } BatchItemRequest batchItemRequest = new BatchItemRequest ( ) ; batchItemRequest . setBId ( bId ) ; batchItemRequest . setCDCQuery ( cdcQuery ) ; batchItemRequests . add ( batchItemRequest ) ; bIds . add ( bId ) ; }
Method to add the cdc query batch operation to batchItemRequest