Commit Graph

216 Commits

Author SHA1 Message Date
Sean McIlvenna d92be90789 Changes to subscriptions to include the resource that triggered the subscription in the payload, serialized as JSON or XML depending on the Subscription.channel.payload property's value 2019-08-14 14:35:18 -04:00
jamesagnew e1b43d811f Version bump to 4.1.0-SNAPSHOT 2019-08-14 14:06:06 -04:00
jamesagnew 3f22456b0f Bump version to 4.0.0 2019-08-14 11:06:26 -04:00
jamesagnew 2999a292e6 Get subscriptions working for R5 2019-08-11 18:32:47 -04:00
James Agnew 7d62064dc0 Don't require a daoregistry 2019-08-11 08:25:41 -04:00
James Agnew 4f5a2b3c0c Add fhirType() to IBase to bring it in line with what the core structures do 2019-08-09 09:44:20 -04:00
James Agnew 8d2b0ea1c3 Test fix 2019-08-08 15:50:28 -04:00
James Agnew 2518d4e0be Add some tests 2019-08-08 15:23:55 -04:00
James Agnew 55c0d5b604
Add binary storage for Attachments (#1386)
* Have this working now

* Add utility method

* Build fixes

* Add changelog
2019-07-17 18:31:17 -04:00
James Agnew 120b93f204
Use HL7 FHIR Core Structures (#1382)
* Ongoing work on core structures suport

* Ongoing work on this merge

* Ongoing work to clean up structures

* Credit for #1179

* Address compile issues

* Latest changes

* Work on parallel execution

* Work on getting tests passing

* Add H2 to migrator

* Test fix
2019-07-14 10:16:40 -04:00
jamesagnew dff2fdd3cf GET RID OF TRAILING LICENSE HEADER SPACES ONCE AND FOR ALL
YESSSSSSSSSSSSS
2019-07-05 11:19:51 -04:00
Ken Stevens 2b1ed16f68 Apply the same fix we used for Dstu3 2019-07-04 13:58:20 -04:00
James Agnew 1fd99dac63
Enable optional cascading deletes on JPA server (#1363)
* Start working on cascading deleets

* WOrk on cascading deletes

* Work on cascading deletes

* Enable cascading deletes

* Cascade deletes almost working

* FIx test

* Test fix
2019-06-28 17:32:39 -04:00
James Agnew 2bfbea4e6b Remove duplicate test class 2019-06-26 09:24:36 -04:00
James Agnew 4ad1808da3
Propagate RequestDetails to everything in JPA server (#1358) 2019-06-22 15:18:06 -05:00
jamesagnew 087c53286c License header updates 2019-06-14 18:43:55 -04:00
Stig Rohde Døssing b56f59542a Move JettyUtil to new module 2019-06-14 18:34:45 -04:00
Stig Rohde Døssing aab7bb6b64 Issue-1325: Let OS assign random ports to servers during testing, and let tests get the port of the running server once the OS has assigned a port. Delete PortUtil and similar utilities. 2019-06-14 18:34:45 -04:00
Ken Stevens 2bf680509b
DeleteConflict hook, SearchableHashMapResourceProvider, and in-memory searching (#1341)
* Make IBundle list interface more flexible

* Make matchResourceLinks visible

* Make matchResourceLinks visible

* Pull in-memory matching functionality out of subscription module into dedicated classes in searchparam module

* Added more accessors to version independent resource classes

* improved forcedid matching (needs to be verified by James)
filter out nulls from HashMapProvider.searchAll() (hopefully no tests depend on this)

* add AnyComposition

* cleanup of Any classes

* create searchparam config so people can use that module without using subscriptions

* create searchparam config so people can use that module without using subscriptions

* fix broken test

* added derivedFrom

* renamed daoRegistry.getResourceDaoIfExists to getResourceDaoOrNull
also added method to add a new dao to the registry and retrieve registered types

* TokenParam.equals

* add error check to searchable hashmap resource provider

* added support for R4

* add successor to measure

* delete conflict hook
start with failing test

* test passes.
hook is called.

* added delete conflict hook
all delete conflict tests pass

* added javadoc

* Performance test

* test bad interceptor case

* typo

* rename criteria matcher

* added support for multiple topics

* fix method name

* add effective period

* Temporarily excluding StressTest from build to try to get Travis under time limit

* change log

* review feedback

* review feedback

* review feedback
2019-06-13 13:59:51 -04:00
Stig Døssing f032916776 Issue-1337: Fix unstable concurrent code in PointcutLatch, fix subscription tests getting latch exceptions due to missing expectations, make hapi-fhir-jpaserver-subscription tests load StructureDefinitions outside latch timers, as this can be slow on busy machines (#1338) 2019-06-10 11:05:05 -04:00
Ken Stevens f278fcf175 No longer remove channels when their subscriptions are unregistered 2019-06-03 17:37:02 -04:00
James Agnew 50a8c66bf5 Version bump to 4.0.0-SNAPSHOT 2019-05-30 17:13:03 -04:00
jamesagnew 73aa53be8f Release 3.8.0 2019-05-30 16:50:04 -04:00
Ken Stevens 9b44b37df8 removed unneccessary annotation 2019-05-09 14:43:00 -04:00
Ken Stevens 130e879d04
Delete performance (#1286)
* move expunge out

* move to prototype

* turns parameters into fields

* cleanup control flow

* moved transactions outside of loops

* add expungeeverything

* moved daos out

* add expungeThreadCount

* add expungeBatchSize

* added partition runner to run in separate threads

* all done.  just need to consolidate test code.

* Moar tests

* consolidated pointcutlatch into hapi-fhir-jpaserver-model

* final cleanup

* update javadoc

* change log

* failing test

* added delete
also @Transactional

* remove unused parameter

* fix compile

* race condition

(cherry picked from commit e1940d2fb20838859a205f2b96c833b0ce9f05eb)

# Conflicts:
#	hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/expunge/PartitionRunnerTest.java

* ja feedback

* ja feedback
2019-04-25 15:38:37 -04:00
jamesagnew abd53c0cbe License header updates 2019-04-24 21:20:11 -04:00
James Agnew 738c2c1797
Interceptor framework refactoring (#1287)
Interceptor framework overhaul
2019-04-24 14:32:30 -04:00
Ken Stevens a57e50317d
Websocket cleanup (#1275)
* fix bug in websocket subscription (It wasn't destroying the channel when there are no subscribers)

* add support for removing channel.  Also synchronize removal (there was a race condition between sync and queue)

* keep deprecated method for backwards compatibility

* make websocket endpoint configurable

* make websocket context path configurable

* make websocket context path configurable

* trying mvn clean test instead of mvn clean install to see if the build goes faster

* that didn't work at all.  reverting.

* change log
2019-04-17 15:03:35 -04:00
jamesagnew a9cfce3615 Header updates 2019-04-15 12:31:11 -04:00
Ken Stevens bb98ded1fa
Websocket improvements (#1272)
* subscription loader now only pulls active subscriptions
only allow websocket connections to subscriptions of type websocket

* Added a "flag for deletion" to ActiveSubscription in the SubscriptionRegistry to handle the race condition of a scheduled sync overlapping with a subscription creation.  We could have used a package-scoped semaphore or a pre-remove FHIR read, but this seemed like the safest, simplest and most performant way to handle it.

* ActiveSubscriptionCacheTest

* WebsocketConnectionValidatorTest

* fix compile error in jpa example
2019-04-12 08:36:49 -04:00
James Agnew 7359b77d99 Address review comments 2019-04-02 09:33:01 -04:00
jamesagnew 8791ed5793 Test tweaks 2019-03-29 17:13:41 -04:00
Ken Stevens b1d41a8211 named interceptor registries 2019-03-29 14:29:36 -04:00
Ken Stevens 9a54d7086e Fix a couple of bugs (#1251)
* might keep this

* might keep this

* undoing start in interface

* fixed bug that only supported resources with ResourceType/id prefixes

* added standalone subscription support for Dstu2.  untested.

* failing test

* fixed cannonicalsubscription.equals for email

* final cleanup
2019-03-26 10:39:40 +01:00
James Agnew d1667487c2 Clean up unique composite search params 2019-03-21 21:57:38 +01:00
James Agnew 08c7afb804 Reduce logging in JPA server 2019-03-14 17:42:13 -04:00
Ken Stevens be4863133e
Pointcut parameters and Retrier log (#1236)
* Fixed a pointcut parameter list and log an exception that was being swallowed by Retrier

* Documentation clarification
2019-03-11 17:31:03 -04:00
Ken Stevens 94021989b0 add helper method to CanonicalSubscription (#1226) 2019-03-08 09:51:42 -05:00
Ken Stevens a2d4c93922 Subscription matcher transactions (#1229)
* fix bug in ResourceIndexSearchParamQuantity
Move transaction boundary around SubscriptionMatcherInterceptor so it can be overridden in subclass
Lots of CRLF changes from a mvn -P DIST

* FIXME
2019-03-06 16:12:04 -05:00
James Agnew 9bc0f6784d
Search paging timeout with 1500 < n < 2000 results (#1221)
* Avoid paging links when offset is artificially set very high

* Ongoing fixes

* Adding logging and clean up transaction processing

* Add changelog

* More work on queries

* Keep working on getting tests passing

* More test fixes

* More work on tests

* More test works

* One more test attempt

* Ongoing fixes

* One more change

* FIxes to search algorithm

* Add changelog

* Clean up for review

* Fixed NPE in token matcher when system is not null and value is null

* test opposite (null system not null value)

* added null protection to all matchers

* Address review comments

* Address broken test

* Trying to resolve DB ordering issues
2019-03-06 05:45:05 -05:00
James Agnew 48c10bddc5
Narrative Generator refactoring (#1219)
* Starting work on this

* Working on narrative templates

* Work on new narrative system

* Account for some failing tests due to refactoring of narrative mode

* Another test fix

* More test fixes

* One more test fix

* Work on searches

* Address review comments
2019-02-27 14:59:57 -05:00
James Agnew 72c4726328 Tweaks to the way that subscriptions are serialized 2019-02-17 19:17:51 -05:00
Ken Stevens 3af0bc7206 changes needed to support different number of consumers in matching vs delivery 2019-02-17 15:23:01 -05:00
James Agnew 14e04085ae Try for a test fix and a bit of cleanup 2019-02-16 16:11:33 -05:00
James Agnew c6fcb4fcbf Allow canonical subscription to hold multiple extensions with the same
URL
2019-02-16 15:28:39 -05:00
Ken Stevens badbde7e4a SubscriptionRegistry re-uses channel and handlers if channel type didn't change when subscription is updated 2019-02-14 19:38:31 -05:00
Ken Stevens 435f57335d sonar 2019-02-13 20:50:04 -05:00
Ken Stevens 455761f9b3 fix npe 2019-02-13 16:54:38 -05:00
Ken Stevens 68171ba950 don't call SUBSCRIPTION_BEFORE_PERSISTED_RESOURCE_CHECKED and SUBSCRIPTION_AFTER_PERSISTED_RESOURCE_CHECKED for DELETE operations (since we don't currently match subscriptions for DELETE operations) 2019-02-12 14:25:36 -05:00
James Agnew a5e10740c0
Merge pull request #1194 from jamesagnew/ja_more_subscription_logger
More subscription logger work
2019-02-09 11:45:25 -05:00
James Agnew 4699c51997 Address review comments 2019-02-08 17:26:34 -05:00
Ken Stevens f40614a1aa fixed bug in in-memory matching for reference id when searchparam has two components 2019-02-08 16:37:08 -05:00
James Agnew 0f8c8d18e2 Bump version to 3.8.0-SNAPSHOT 2019-02-06 20:02:28 -05:00
jamesagnew 207015c3af Version bump to 3.7.0 2019-02-05 21:36:38 -05:00
jamesagnew d4af1ee2a3 Add tests and license headers 2019-02-04 16:34:39 -05:00
James Agnew 88eb2c424e formatting 2019-02-04 13:50:47 -05:00
James Agnew 87a6c24bde More subscription logger work 2019-02-04 13:49:10 -05:00
James Agnew 447c394cac
Ja subscription debug logger (#1190)
Squashed commit adding subscription debug logger

* Work on subscription debug logger

* Add subscription logging interceptor

* Remove unneeded variables

* A bit of cleanup

* Tweak the output logs a bit

* Address review comments
2019-02-03 16:33:54 -05:00
Ken Stevens 4a49a9362e just clearing the cache doesn't shut down the channel consumers. Switching to unregisterAll 2019-02-02 19:26:20 -05:00
Ken Stevens 84db66d2e3 fixed 2019-02-02 19:07:06 -05:00
Ken Stevens 37670ac039 actually, we shouldn't be trying to match on deleted resources. Corrected assertion in test. 2019-02-02 19:00:14 -05:00
Ken Stevens 4106d67eb7 ready for review 2019-02-02 18:03:09 -05:00
Ken Stevens dd0b56142d found another bug in standalone subscriptions 2019-02-02 17:14:05 -05:00
Ken Stevens 6616fbc9bb added CannonicalSubscription.toString() 2019-02-02 13:15:07 -05:00
Ken Stevens 9280cde491
Subscription only registers active (#1189)
* Fixed a bug in standalone subscription subscriber:  It was adding REQUESTED subscriptions to the active subscription registry.  (Only ACTIVE subscriptions should be added.)
2019-02-01 10:14:46 -05:00
jamesagnew 503d1d8aff Subscription NPE fix 2019-01-26 18:42:01 -05:00
Ken Stevens 10c59fceeb
Subscription strategy tag (#1178)
tests pass
2019-01-25 13:01:04 -05:00
James Agnew f55be0b6d0 Test fix 2019-01-25 10:56:17 -05:00
James Agnew 38d03ea99a
Invalid ids in subscription queue (#1175)
* Start work on this

* Work on interceptors

* Attempt fix

* Avoid environment dependency

* Test fixes

* One more test fix

* One more build tweak

* Lots of cleanup

* A bit more cleanup

* Still more cleanup

* Some test fixes

* Add legacy methods temporarily

* Don't auto-scan interceptor beans

* One more test fix

* rsolve merge conflicts

* Address review comments
2019-01-23 21:17:47 -05:00
Ken Stevens 0eb70b81fe Oops. This was supposed to be automatically backed out. But SQUASH MERGE prevented that from happening. Hmmmmm...... 2019-01-23 18:13:29 -05:00
Ken Stevens cdd75bbe3a Merge branch 'master' into windows-fixes
# Conflicts:
#	hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/subscriber/SubscriptionDeliveringRestHookSubscriber.java
2019-01-23 17:16:08 -05:00
Ken Stevens 5a08593abd
_id support (#1176)
* added support for _id in in-memory matcher
2019-01-23 14:37:34 -05:00
Ken Stevens 707bf07099 optimistic the windows tests will now finally pass! 2019-01-23 11:57:59 -05:00
Ken Stevens 2c7eb39b29 final batch of windows fixes (to deal with jumpy windows clock)
also added semaphore to PointcutLatch
2019-01-22 18:53:54 -05:00
Ken Stevens 6b22977d7c fixing more tests for Windows 2019-01-21 22:28:48 -05:00
Ken Stevens c92cbdd3e2 Merge remote-tracking branch 'remotes/origin/submit-retry-extension' into windows-fixes 2019-01-21 20:35:04 -05:00
Ken Stevens 00320da9dc Merge branch 'master' into windows-fixes 2019-01-21 20:34:01 -05:00
Ken Stevens a6d1cc56c7 added maxRetriex extension to canonical subscription 2019-01-21 16:58:14 -05:00
James Agnew 9cf64f78d0 Deprecate a bad setter on RetfulServer, fix a paging issue, and add a
disabled unit test to the subscription matcher
2019-01-21 14:46:17 -05:00
Ken Stevens 29f483d7b4 Merge branch 'master' into windows-fixes 2019-01-21 11:06:42 -05:00
Ken Stevens b4350bbdae Working through failed tests. Consolidating sleep calls 2019-01-21 11:05:53 -05:00
jamesagnew 690af1c7ff Add interceptor example 2019-01-20 19:43:08 -05:00
Ken Stevens 10aa6c9f07 Merge branch 'master' into windows-fixes
# Conflicts:
#	hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/interceptor/api/Pointcut.java
#	hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/cache/SubscriptionRegistry.java
2019-01-20 17:04:16 -05:00
James Agnew c3c7d156e9 Interceptor cleanup 2019-01-20 10:16:18 -05:00
Ken Stevens b3bdbea19c Merge branch 'master' into windows-fixes
quickly update tests to new interceptor
2019-01-20 09:39:34 -05:00
Ken Stevens f7e05f6e58 Merge branch 'master' into windows-fixes
quickly update tests to new interceptor
2019-01-20 09:39:14 -05:00
jamesagnew cd1e0e881c Add headers 2019-01-19 18:31:17 -05:00
jamesagnew b0cbd52ae9 Interceptor cleanup 2019-01-19 18:01:00 -05:00
James Agnew 29c3cee287
Merge pull request #1172 from jamesagnew/ja-subscription-interceptors
Ja subscription interceptors
2019-01-19 07:13:14 -06:00
James Agnew 3e84173180 Merge branch 'master' into ja-subscription-interceptors 2019-01-18 17:52:23 -05:00
Ken Stevens 3d07fc1c22
fixed null subscription id (#1170)
* fixed null subscription id
2019-01-18 10:39:35 -05:00
James Agnew 5ce9d444e9 Work on interceptors 2019-01-18 09:04:45 -05:00
jamesagnew 5fd084d7cf Fix a couple of merge conflicts 2019-01-18 05:47:37 -05:00
Volker Schmidt 432ad8e5bc Subscription without Payload did not contain header. 2019-01-18 05:41:47 -05:00
Ken Stevens 7ffbe9505b Prototype.
Not working yet.
2019-01-16 23:35:14 -05:00
Ken Stevens 19afcb7e09 all tests pass 2019-01-15 18:22:08 -05:00
Ken Stevens 4f5640e541
Resilient searchparamregistry (#1165)
SearchParamRegistry and SubscriptionRegistry now both poll retrying connection to the server. This will help in particular in the scenario where the subscriptions are managed in a standalone server that depends on a FHIR Server being available to pull search parameters and subscriptions from.
2019-01-14 11:39:28 -05:00
James Agnew 93bf2788ec Add subscription narrowing interceptor and refactor RuleBuilder to be a
bit cleaner
2019-01-12 14:23:26 -06:00
Ken Stevens 0b6c4fb450 improved test name 2019-01-09 13:39:32 -05:00
Ken Stevens 5671ca88ca Simplified access to extension 2019-01-09 13:39:32 -05:00
Ken Stevens 3142ebb892 Fixed typo in class name
Added channel extensions to CanonicalSubscription
2019-01-09 13:39:32 -05:00
Ken Stevens d809569a2d Added new DaoConfig parameter to control whether subscription matching happens on this server. 2019-01-09 13:39:32 -05:00
jamesagnew a8a97ae6b2 Two test fixes 2019-01-07 09:18:11 -05:00
jamesagnew 8f8385627f Merge branch 'master' of github.com:jamesagnew/hapi-fhir 2019-01-05 11:33:08 -05:00
jamesagnew 98d93df12a License header updates 2019-01-04 16:22:15 -05:00
James Agnew 5b8fee869e Add config options for default Prefer header and _total param on server 2019-01-04 16:12:45 -05:00
James Agnew f39cf58a4a Test fix 2019-01-04 11:29:14 -05:00
James Agnew a1275874f8 Correct subscription delivery metadata 2019-01-04 10:56:21 -05:00
James Agnew 14a132a937 Squashed commit of the following:
commit 9659655830
Author: James Agnew <jamesagnew@gmail.com>
Date:   Thu Dec 27 17:54:25 2018 -0500

    Finish sync

commit 70da25b76f
Author: jamesagnew <jamesagnew@gmail.com>
Date:   Thu Dec 27 10:32:51 2018 -0500

    Work on RI4 sync
2018-12-27 17:58:47 -05:00
jamesagnew 49e418edf0 Adjust migrator to handle updated Hibernate version 2018-12-23 15:11:44 -05:00
Ken Stevens fedc59a8d6 Subscription module startup changes (#1154)
* Reorganizing packages and dependencies to support standalone subscription running within a CDR container where all hapi modules are on the classpath.

* EXPERIMENTAL: Moved Subscription registry out of interceptor and introduced ISubscriptionLoader that will be either a Database or FhirClient loader.

5 tests fail.  Looks like we're getting too many matches--likely because there is now just one list of subscriptions instead of one list per interceptor.

* Created ActiveSubscription and moved cache bits into it

* Compiles.  Next step is get app context to load.

* Application context loads.  Now fix NullPointer.

* All subscription tests pass

* FIXME cleanup

* jpa-subscription tests

* fixed config so other module tests work

* MAJOR MILESTONE: All hapi-fhir tests pass.

updated READMEs in example projects

* Moved ExecutorQueue stuff out into its own class

* Organize Imports

* FIXME cleanup

* Null check -> Optional

* Add test and supporting code to validate SubscriptionConstants.EXT_SUBSCRIPTION_RESTHOOK_DELIVER_LATEST_VERSION behaviour

* Added SubscriptionCheckingSubscriber test that works without a database

* Moved a few beans to @ComponentScan

* Replaced use of beanFactory with concrete factory classes

* Switched test to use subscribablechannel

* Added SubscriptionLoaderFhirClientTest

* Undid changes that caused SearchParamProviderFhirClientTest to revert to the Database version.  It's now calling the FhirClient version again.  (oops)

* Confirm that our SubscriptionProviderFhirClient works with a live fhir client

* Organize imports

* Organize imports

* Register interceptors with DaoConfig instead of RestServer.
Also, Rename @VisibleForTesting methods with ForUnitTest

* Ready to go

* organize imports

* add processing queue

* Fixed interface implementation names

* Fix triggering service so it uses new subscriptionmatcherinterceptor

* fixed example

* Renamed "Database" classes to "Dao"

* Tightened up StoppableSubscriber API

* final code review

* processing -> matching naming change

* fix required by CDR

* oops

* Updated changes.xml

* Renamed subscriptioncheckingsubscriber to subscriptionmatchingsubscriber

* Renamed subscriptioncheckingsubscriber to subscriptionmatchingsubscriber

* CDR integration now works

* Changing subscribable channel abstraction layer in preparation for supporting more types of subscribable channels

* Add interface over both types of messages put on queues

* cosmetic change

* added subscription support for r4

* fixed again

* oops

* self code-review
2018-12-23 13:52:26 -05:00
James Agnew a0cb7edd08 Version bump a few dependencies 2018-12-22 20:13:03 -05:00
jamesagnew 86b3e45a32 License header updates 2018-12-18 14:08:01 -05:00
Ken Stevens 84a34eb3c9
Subscription module support (#1147)
* Reorganizing packages and dependencies to support standalone subscription running within a CDR container where all hapi modules are on the classpath.

Moved Subscription registry out of interceptor and introduced SubscriptionLoader

* Created ActiveSubscription and moved cache bits into it

* Moved ExecutorQueue stuff out into its own class

* Add test and supporting code to validate SubscriptionConstants.EXT_SUBSCRIPTION_RESTHOOK_DELIVER_LATEST_VERSION behaviour

* Added SubscriptionCheckingSubscriber

* Moved a few beans to @ComponentScan

* Replaced use of beanFactory with concrete factory classes

* Switched test to use subscribablechannel

* Added SubscriptionLoaderFhirClientTest

* Confirm that our SubscriptionProviderFhirClient works with a live fhir client

* Register interceptors with DaoConfig instead of RestServer.
Also, Rename @VisibleForTesting methods with ForUnitTest

* Fix triggering service so it uses new subscriptionmatcherinterceptor

* Renamed "Database" classes to "Dao"

* processing -> matching naming change
2018-12-18 13:09:06 -05:00
jamesagnew 82f40f0423 License header updates 2018-12-03 05:22:10 -05:00
Ken Stevens 6baee4dc3f
Standalone subscription (#1125) 2018-11-30 17:19:16 -05:00