resultsKeyBag.getBindingKey().add(key);
result.getKeyBag().add(resultsKeyBag);
}
else {
FindBinding fb = subscriptionFilter.getFindBinding();
org.apache.juddi.query.util.FindQualifiers findQualifiers = new org.apache.juddi.query.util.FindQualifiers();
findQualifiers.mapApiFindQualifiers(fb.getFindQualifiers());
// To do subscription "chunking", the listHead and maxRows are nulled which will set them to system default. User settings for
// these values don't make sense with the "chunking" feature.
fb.setListHead(null);
fb.setMaxRows(null);
// Setting the start index to the chunkData
Holder<Integer> subscriptionStartIndex = new Holder<Integer>(chunkData);
BindingDetail bindingDetail = InquiryHelper.getBindingDetailFromKeys(fb, findQualifiers, em, currentMatchingKeys,
startPointDate, endPointDate, subscriptionStartIndex, modelSubscription.getMaxEntities());
// Upon exiting above function, if more results are to be had, the subscriptionStartIndex will contain the latest value (or null
// if no more results)
chunkData = subscriptionStartIndex.value;
result.setBindingDetail(bindingDetail);
}
}
if (subscriptionFilter.getFindBusiness() != null) {
//Get the current matching keys
List<?> currentMatchingKeys = getSubscriptionMatches(subscriptionFilter, em);
List<String> missingKeys = getMissingKeys(currentMatchingKeys, modelSubscription.getSubscriptionMatches());
if (missingKeys != null && missingKeys.size() > 0) {
KeyBag missingKeyBag = new KeyBag();
missingKeyBag.setDeleted(true);
for (String key : missingKeys)
missingKeyBag.getBusinessKey().add(key);
result.getKeyBag().add(missingKeyBag);
}
// Re-setting the subscription matches to the new matching key collection
//modelSubscription.getSubscriptionMatches().clear();
//for (Object key : currentMatchingKeys) {
// SubscriptionMatch subMatch = new SubscriptionMatch(modelSubscription, (String)key);
// modelSubscription.getSubscriptionMatches().add(subMatch);
//}
// Now, finding the necessary entities, within the coverage period limits
if (modelSubscription.isBrief()) {
KeyBag resultsKeyBag = new KeyBag();
for (String key : (List<String>)currentMatchingKeys)
resultsKeyBag.getBusinessKey().add(key);
result.getKeyBag().add(resultsKeyBag);
}
else {
FindBusiness fb = subscriptionFilter.getFindBusiness();
org.apache.juddi.query.util.FindQualifiers findQualifiers = new org.apache.juddi.query.util.FindQualifiers();
findQualifiers.mapApiFindQualifiers(fb.getFindQualifiers());
// To do subscription "chunking", the listHead and maxRows are nulled which will set them to system default. User settings for
// these values don't make sense with the "chunking" feature.
fb.setListHead(null);
fb.setMaxRows(null);
// Setting the start index to the chunkData
Holder<Integer> subscriptionStartIndex = new Holder<Integer>(chunkData);
BusinessList businessList = InquiryHelper.getBusinessListFromKeys(fb, findQualifiers, em, currentMatchingKeys,
startPointDate, endPointDate, subscriptionStartIndex, modelSubscription.getMaxEntities());