public void extractFromResource(ResourceIndexedSearchParams theParams, ResourceTable theEntity, IBaseResource theResource) { theParams.stringParams.addAll(extractSearchParamStrings(theEntity, theResource)); theParams.numberParams.addAll(extractSearchParamNumber(theEntity, theResource)); theParams.quantityParams.addAll(extractSearchParamQuantity(theEntity, theResource)); theParams.dateParams.addAll(extractSearchParamDates(theEntity, theResource)); theParams.uriParams.addAll(extractSearchParamUri(theEntity, theResource)); theParams.coordsParams.addAll(extractSearchParamCoords(theEntity, theResource)); ourLog.trace("Storing date indexes: {}", theParams.dateParams); for (BaseResourceIndexedSearchParam next : extractSearchParamTokens(theEntity, theResource)) { if (next instanceof ResourceIndexedSearchParamToken) { theParams.tokenParams.add((ResourceIndexedSearchParamToken) next); } else { theParams.stringParams.add((ResourceIndexedSearchParamString) next); } } }
public void populateFromResource(ResourceIndexedSearchParams theParams, IDao theCallingDao, Date theUpdateTime, ResourceTable theEntity, IBaseResource theResource, ResourceIndexedSearchParams existingParams) { mySearchParamExtractorService.extractFromResource(theParams, theEntity, theResource); Set<Map.Entry<String, RuntimeSearchParam>> activeSearchParams = mySearchParamRegistry.getActiveSearchParams(theEntity.getResourceType()).entrySet(); if (myDaoConfig.getIndexMissingFields() == DaoConfig.IndexEnabledEnum.ENABLED) { theParams.findMissingSearchParams(myDaoConfig.getModelConfig(), theEntity, activeSearchParams); } theParams.setUpdatedTime(theUpdateTime); extractInlineReferences(theResource); myResourceLinkExtractor.extractResourceLinks(theParams, theEntity, theResource, theUpdateTime, myDaoResourceLinkResolver, true); /* * If the existing resource already has links and those match links we still want, use them instead of removing them and re adding them */ for (Iterator<ResourceLink> existingLinkIter = existingParams.getResourceLinks().iterator(); existingLinkIter.hasNext(); ) { ResourceLink nextExisting = existingLinkIter.next(); if (theParams.links.remove(nextExisting)) { existingLinkIter.remove(); theParams.links.add(nextExisting); } } /* * Handle composites */ extractCompositeStringUniques(theEntity, theParams); }
SubscriptionMatchResult match(String criteria, IBaseResource resource) { ResourceTable entity = new ResourceTable(); String resourceType = myContext.getResourceDefinition(resource).getName(); entity.setResourceType(resourceType); ResourceIndexedSearchParams searchParams = new ResourceIndexedSearchParams(); mySearchParamExtractorService.extractFromResource(searchParams, entity, resource); myResourceLinkExtractor.extractResourceLinks(searchParams, entity, resource, resource.getMeta().getLastUpdated(), myInlineResourceLinkResolver, false); return myCriteriaResourceMatcher.match(criteria, resource, searchParams); } }
public void populateFromResource(ResourceIndexedSearchParams theParams, IDao theCallingDao, Date theUpdateTime, ResourceTable theEntity, IBaseResource theResource, ResourceIndexedSearchParams existingParams) { mySearchParamExtractorService.extractFromResource(theParams, theEntity, theResource); Set<Map.Entry<String, RuntimeSearchParam>> activeSearchParams = mySearchParamRegistry.getActiveSearchParams(theEntity.getResourceType()).entrySet(); if (myDaoConfig.getIndexMissingFields() == DaoConfig.IndexEnabledEnum.ENABLED) { theParams.findMissingSearchParams(myDaoConfig.getModelConfig(), theEntity, activeSearchParams); } theParams.setUpdatedTime(theUpdateTime); extractInlineReferences(theResource); myResourceLinkExtractor.extractResourceLinks(theParams, theEntity, theResource, theUpdateTime, myDaoResourceLinkResolver, true); /* * If the existing resource already has links and those match links we still want, use them instead of removing them and re adding them */ for (Iterator<ResourceLink> existingLinkIter = existingParams.getResourceLinks().iterator(); existingLinkIter.hasNext(); ) { ResourceLink nextExisting = existingLinkIter.next(); if (theParams.links.remove(nextExisting)) { existingLinkIter.remove(); theParams.links.add(nextExisting); } } /* * Handle composites */ extractCompositeStringUniques(theEntity, theParams); }