}
public static TModelList getTModelListFromKeys(FindTModel body, FindQualifiers findQualifiers, EntityManager em, List<?> keysFound,
Date modifiedAfter, Date modifiedBefore, Holder<Integer> subscriptionStartIndex, Integer subscriptionMaxRows)
throws DispositionReportFaultMessage {
TModelList result = new TModelList();
ListDescription listDesc = new ListDescription();
result.setListDescription(listDesc);
// Sort and retrieve the final results taking paging into account
List<?> queryResults = FetchTModelsQuery.select(em, findQualifiers, keysFound, body.getMaxRows(), body.getListHead(), listDesc);
if (queryResults != null && queryResults.size() > 0)
result.setTModelInfos(new org.uddi.api_v3.TModelInfos());
// Set the currentIndex to 0 or the value of the subscriptionStartIndex
int currentIndex = 0;
if (subscriptionStartIndex != null && subscriptionStartIndex.value != null)
currentIndex = subscriptionStartIndex.value;
int returnedRowCount = 0;
while (currentIndex < queryResults.size()) {
Object item = queryResults.get(currentIndex);
org.apache.juddi.model.Tmodel modelTModel = (org.apache.juddi.model.Tmodel)item;
org.uddi.api_v3.TModelInfo apiTModelInfo = new org.uddi.api_v3.TModelInfo();
if (modifiedAfter != null && modifiedAfter.after(modelTModel.getModifiedIncludingChildren())) {
currentIndex++;
continue;
}
if (modifiedBefore != null && modifiedBefore.before(modelTModel.getModifiedIncludingChildren())) {
currentIndex++;
continue;
}
MappingModelToApi.mapTModelInfo(modelTModel, apiTModelInfo);
result.getTModelInfos().getTModelInfo().add(apiTModelInfo);
returnedRowCount++;
// If the returned rows equals the max allowed, we can end the loop (applies to subscription calls only)
if (subscriptionMaxRows != null) {
if (returnedRowCount == subscriptionMaxRows)