SubscriptionServiceImpl

public class SubscriptionServiceImpl implements SubscriptionService

Default implementation of org.motechproject.hub.service.SubscriptionService

Constructors

SubscriptionServiceImpl

public SubscriptionServiceImpl(HubTopicMDSService hubTopicService, HubSubscriptionMDSService hubSubscriptionMDSService, HttpAgent httpAgentImpl)

Creates a new instance of SubscriptionServiceImpl, with all fields set to the autowired parameters values.

Parameters:

Methods

getHttpAgentImpl

public HttpAgent getHttpAgentImpl()

Gets the HttpAgent which is an OSGI service used for sending http requests.

Returns:the http agent

setHttpAgentImpl

public void setHttpAgentImpl(HttpAgent httpAgentImpl)

Sets the HttpAgent which is an OSGI service used for sending http requests.

Parameters:
  • httpAgentImpl – the http agent to be set

setRetryCount

public void setRetryCount(String retryCount)

Sets the number of allowed request retries in case of request error.

Parameters:
  • retryCount – the retry count to be set

setRetryInterval

public void setRetryInterval(String retryInterval)

Sets the interval between request retries in case of request error.

Parameters:
  • retryInterval – the retry interval to be set

subscribe

public Long subscribe(String callbackUrl, Modes mode, String topic, String leaseSeconds, String secret)