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); }