Rename $retrigger-subscription to $trigger-subscription based on

Diederik's suggestion
This commit is contained in:
James Agnew 2018-10-10 10:49:50 -04:00
parent 34bb70af65
commit 8bd185acf2
8 changed files with 27 additions and 27 deletions

View File

@ -23,7 +23,7 @@ package ca.uhn.fhir.jpa.config;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.i18n.HapiLocalizer;
import ca.uhn.fhir.jpa.dao.DaoRegistry;
import ca.uhn.fhir.jpa.provider.SubscriptionRetriggeringProvider;
import ca.uhn.fhir.jpa.provider.SubscriptionTriggeringProvider;
import ca.uhn.fhir.jpa.search.*;
import ca.uhn.fhir.jpa.sp.ISearchParamPresenceSvc;
import ca.uhn.fhir.jpa.sp.SearchParamPresenceSvcImpl;
@ -117,8 +117,8 @@ public abstract class BaseConfig implements SchedulingConfigurer {
@Bean
@Lazy
public SubscriptionRetriggeringProvider mySubscriptionRetriggeringProvider() {
return new SubscriptionRetriggeringProvider();
public SubscriptionTriggeringProvider mySubscriptionTriggeringProvider() {
return new SubscriptionTriggeringProvider();
}
@Bean(autowire = Autowire.BY_TYPE)

View File

@ -42,7 +42,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
public class SubscriptionRetriggeringProvider implements IResourceProvider {
public class SubscriptionTriggeringProvider implements IResourceProvider {
public static final String RESOURCE_ID = "resourceId";
@Autowired
@ -52,8 +52,8 @@ public class SubscriptionRetriggeringProvider implements IResourceProvider {
@Autowired(required = false)
private List<BaseSubscriptionInterceptor<?>> mySubscriptionInterceptorList;
@Operation(name= JpaConstants.OPERATION_RETRIGGER_SUBSCRIPTION)
public IBaseParameters reTriggerSubscription(
@Operation(name= JpaConstants.OPERATION_TRIGGER_SUBSCRIPTION)
public IBaseParameters triggerSubscription(
@IdParam IIdType theSubscriptionId,
@OperationParam(name= RESOURCE_ID) UriParam theResourceId) {
@ -64,13 +64,13 @@ public class SubscriptionRetriggeringProvider implements IResourceProvider {
Class<? extends IBaseResource> resourceType = myFhirContext.getResourceDefinition(resourceId.getResourceType()).getImplementingClass();
IFhirResourceDao<? extends IBaseResource> dao = mySystemDao.getDao(resourceType);
IBaseResource resourceToRetrigger = dao.read(resourceId);
IBaseResource resourceToTrigger = dao.read(resourceId);
ResourceModifiedMessage msg = new ResourceModifiedMessage();
msg.setId(resourceToRetrigger.getIdElement());
msg.setId(resourceToTrigger.getIdElement());
msg.setOperationType(ResourceModifiedMessage.OperationTypeEnum.UPDATE);
msg.setSubscriptionId(theSubscriptionId.toUnqualifiedVersionless().getValue());
msg.setNewPayload(myFhirContext, resourceToRetrigger);
msg.setNewPayload(myFhirContext, resourceToTrigger);
for (BaseSubscriptionInterceptor<?> next :mySubscriptionInterceptorList) {
next.submitResourceModified(msg);

View File

@ -39,7 +39,7 @@ public class ResourceModifiedMessage {
@JsonProperty("operationType")
private OperationTypeEnum myOperationType;
/**
* This will only be set if the resource is being retriggered for a specific
* This will only be set if the resource is being triggered for a specific
* subscription
*/
@JsonProperty(value = "subscriptionId", required = false)
@ -97,7 +97,7 @@ public class ResourceModifiedMessage {
CREATE,
UPDATE,
DELETE,
MANUALLY_RETRIGGERED;
MANUALLY_TRIGGERED;
}

View File

@ -61,7 +61,7 @@ public class SubscriptionCheckingSubscriber extends BaseSubscriptionSubscriber {
switch (msg.getOperationType()) {
case CREATE:
case UPDATE:
case MANUALLY_RETRIGGERED:
case MANUALLY_TRIGGERED:
break;
case DELETE:
default:

View File

@ -176,7 +176,7 @@ public class JpaConstants {
public static final String OPERATION_DOCUMENT = "$document";
/**
* Retrigger a subscription manually for a given resource
* Trigger a subscription manually for a given resource
*/
public static final String OPERATION_RETRIGGER_SUBSCRIPTION = "$retrigger-subscription";
public static final String OPERATION_TRIGGER_SUBSCRIPTION = "$trigger-subscription";
}

View File

@ -4,7 +4,7 @@ import ca.uhn.fhir.jpa.config.WebsocketDispatcherConfig;
import ca.uhn.fhir.jpa.dao.data.ISearchDao;
import ca.uhn.fhir.jpa.dao.dstu3.BaseJpaDstu3Test;
import ca.uhn.fhir.jpa.dao.dstu3.SearchParamRegistryDstu3;
import ca.uhn.fhir.jpa.provider.SubscriptionRetriggeringProvider;
import ca.uhn.fhir.jpa.provider.SubscriptionTriggeringProvider;
import ca.uhn.fhir.jpa.search.DatabaseBackedPagingProvider;
import ca.uhn.fhir.jpa.search.ISearchCoordinatorSvc;
import ca.uhn.fhir.jpa.subscription.email.SubscriptionEmailInterceptor;
@ -100,8 +100,8 @@ public abstract class BaseResourceProviderDstu3Test extends BaseJpaDstu3Test {
myTerminologyUploaderProvider = myAppCtx.getBean(TerminologyUploaderProviderDstu3.class);
ourRestServer.setPlainProviders(mySystemProvider, myTerminologyUploaderProvider);
SubscriptionRetriggeringProvider subscriptionRetriggeringProvider = myAppCtx.getBean(SubscriptionRetriggeringProvider.class);
ourRestServer.registerProvider(subscriptionRetriggeringProvider);
SubscriptionTriggeringProvider subscriptionTriggeringProvider = myAppCtx.getBean(SubscriptionTriggeringProvider.class);
ourRestServer.registerProvider(subscriptionTriggeringProvider);
JpaConformanceProviderDstu3 confProvider = new JpaConformanceProviderDstu3(ourRestServer, mySystemDao, myDaoConfig);
confProvider.setImplementationDescription("THIS IS THE DESC");

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.jpa.dao.DaoConfig;
import ca.uhn.fhir.jpa.provider.SubscriptionRetriggeringProvider;
import ca.uhn.fhir.jpa.provider.SubscriptionTriggeringProvider;
import ca.uhn.fhir.jpa.provider.dstu3.BaseResourceProviderDstu3Test;
import ca.uhn.fhir.jpa.util.JpaConstants;
import ca.uhn.fhir.rest.annotation.Create;
@ -33,9 +33,9 @@ import static org.junit.Assert.assertEquals;
* Test the rest-hook subscriptions
*/
@SuppressWarnings("Duplicates")
public class RetriggeringDstu3Test extends BaseResourceProviderDstu3Test {
public class SubscriptionTriggeringDstu3Test extends BaseResourceProviderDstu3Test {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(RetriggeringDstu3Test.class);
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SubscriptionTriggeringDstu3Test.class);
private static List<Observation> ourCreatedObservations = Lists.newArrayList();
private static int ourListenerPort;
private static RestfulServer ourListenerRestServer;
@ -117,7 +117,7 @@ public class RetriggeringDstu3Test extends BaseResourceProviderDstu3Test {
}
@Test
public void testRetriggerResourceToSpecificSubscription() throws Exception {
public void testTriggerResourceToSpecificSubscription() throws Exception {
String payload = "application/fhir+json";
String code = "1000000050";
@ -140,8 +140,8 @@ public class RetriggeringDstu3Test extends BaseResourceProviderDstu3Test {
Parameters response = ourClient
.operation()
.onInstance(subscriptionId)
.named(JpaConstants.OPERATION_RETRIGGER_SUBSCRIPTION)
.withParameter(Parameters.class, SubscriptionRetriggeringProvider.RESOURCE_ID, new UriType(obsId.toUnqualifiedVersionless().getValue()))
.named(JpaConstants.OPERATION_TRIGGER_SUBSCRIPTION)
.withParameter(Parameters.class, SubscriptionTriggeringProvider.RESOURCE_ID, new UriType(obsId.toUnqualifiedVersionless().getValue()))
.execute();
String responseValue = response.getParameter().get(0).getValue().primitiveValue();
@ -154,7 +154,7 @@ public class RetriggeringDstu3Test extends BaseResourceProviderDstu3Test {
}
@Test
public void testRetriggerResourceToSpecificSubscriptionWhichDoesntMatch() throws Exception {
public void testTriggerResourceToSpecificSubscriptionWhichDoesntMatch() throws Exception {
String payload = "application/fhir+json";
String code = "1000000050";
@ -177,8 +177,8 @@ public class RetriggeringDstu3Test extends BaseResourceProviderDstu3Test {
Parameters response = ourClient
.operation()
.onInstance(subscriptionId)
.named(JpaConstants.OPERATION_RETRIGGER_SUBSCRIPTION)
.withParameter(Parameters.class, SubscriptionRetriggeringProvider.RESOURCE_ID, new UriType(obsId.toUnqualifiedVersionless().getValue()))
.named(JpaConstants.OPERATION_TRIGGER_SUBSCRIPTION)
.withParameter(Parameters.class, SubscriptionTriggeringProvider.RESOURCE_ID, new UriType(obsId.toUnqualifiedVersionless().getValue()))
.execute();
String responseValue = response.getParameter().get(0).getValue().primitiveValue();

View File

@ -34,7 +34,7 @@
</action>
<action type="add">
A new operation has been added to the JPA server called
<![CDATA[<code>$retrigger-subscription</code>]]>. This can
<![CDATA[<code>$trigger-subscription</code>]]>. This can
be used to cause a transaction to redeliver a resource that previously triggered.
</action>
<action type="add">