@Test(expectedExceptions = FMSException.class) void testCDCQuery_InvalidDate() throws FMSException { String invalidDate = "2000~01~01"; List<IEntity> entities = new ArrayList<>(); entities.add(new Account()); entities.add(new Attachable()); batchOperation.addCDCQuery(entities, invalidDate, ""); }
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); }
BatchOperation { 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); } }
BatchOperation { 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); }  }
BatchOperation { 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); }  void addEntity(T entity, OperationEnum operation, String bId); void addQuery(String query, String bId); void addCDCQuery(List<? extends IEntity> entities, String changedSince, String bId); void addReportQuery(String reportQuery, String bId); List<BatchItemRequest> getBatchItemRequests(); List<String> getBIds(); boolean isFault(String bId); boolean isReport(String bId); boolean isQuery(String bId); boolean isCDCQuery(String bId); boolean isEntity(String bId); Fault getFault(String bId); Report getReport(String bId); QueryResult getQueryResponse(String bId); CDCQueryResult getCDCQueryResult(String bId); IEntity getEntity(String bId); Map<String, Fault> getFaultResult(); Map<String, Report> getReportResult(); Map<String, QueryResult> getQueryResult(); Map<String, CDCQueryResult> getCDCQueryResult(); Map<String, IEntity> getEntityResult(); }
BatchOperation { 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); }  void addEntity(T entity, OperationEnum operation, String bId); void addQuery(String query, String bId); void addCDCQuery(List<? extends IEntity> entities, String changedSince, String bId); void addReportQuery(String reportQuery, String bId); List<BatchItemRequest> getBatchItemRequests(); List<String> getBIds(); boolean isFault(String bId); boolean isReport(String bId); boolean isQuery(String bId); boolean isCDCQuery(String bId); boolean isEntity(String bId); Fault getFault(String bId); Report getReport(String bId); QueryResult getQueryResponse(String bId); CDCQueryResult getCDCQueryResult(String bId); IEntity getEntity(String bId); Map<String, Fault> getFaultResult(); Map<String, Report> getReportResult(); Map<String, QueryResult> getQueryResult(); Map<String, CDCQueryResult> getCDCQueryResult(); Map<String, IEntity> getEntityResult();  }