public class

PuSHSubscriberModule

extends AbstractPuSHModule
java.lang.Object
   ↳ org.mule.module.pubsubhubbub.AbstractPuSHModule
     ↳ org.mule.module.pubsubhubbub.PuSHSubscriberModule
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Allows Mule to act as a PubSubHubbub (aka PuSH) subscriber.
Pubsubhubbub is a simple, open, web-hook-based pubsub protocol & open source reference implementation.
This module implements the PubSubHubbub Core 0.3 -- Working Draft specification, except 7.5 Aggregated Content Distribution.

Summary

Fields
private String callbackUrl The URL that the hub should call back, which is the public URL of the HTTP inbound endpoint placed in front of the subscriber element.
private String hubUrl The URL of the PubSubHubbub to connect to.
private Long leaseSeconds (Optional) Number of seconds for which the subscriber would like to have the subscription active.
private String secret (Optional) A subscriber-provided secret string that will be used to compute an HMAC digest for authorized content distribution.
private String topic The topic URL that the subscriber wishes to subscribe to.
[Expand]
Inherited Fields
From class org.mule.module.pubsubhubbub.AbstractPuSHModule
Public Constructors
PuSHSubscriberModule()
Public Methods
String getCallbackUrl()
String getHubUrl()
Long getLeaseSeconds()
String getSecret()
String getTopic()
String getVerifyToken()
String handleSubscriberRequest(String httpMethod, String contentType, Map<String, Object> responseHeaders, String onBehalfOf, String payload, SourceCallback sourceCallback)
Handle all subscriber requests.
void setCallbackUrl(String callbackUrl)
void setHubUrl(String hubUrl)
void setLeaseSeconds(Long leaseSeconds)
void setSecret(String secret)
void setTopic(String topic)
void subscribe()
Protected Methods
String handleContentDelivery(String contentType, Map<String, Object> responseHeaders, String onBehalfOf, String payload, SourceCallback sourceCallback)
void handleOnBehalfOf(Map<String, Object> responseHeaders, String onBehalfOf)
[Expand]
Inherited Methods
From class org.mule.module.pubsubhubbub.AbstractPuSHModule
From class java.lang.Object
From interface org.mule.api.context.MuleContextAware

Fields

private String callbackUrl

The URL that the hub should call back, which is the public URL of the HTTP inbound endpoint placed in front of the subscriber element.

private String hubUrl

The URL of the PubSubHubbub to connect to.

private Long leaseSeconds

(Optional) Number of seconds for which the subscriber would like to have the subscription active. Defaults to 7 days.

private String secret

(Optional) A subscriber-provided secret string that will be used to compute an HMAC digest for authorized content distribution.

private String topic

The topic URL that the subscriber wishes to subscribe to.

Public Constructors

public PuSHSubscriberModule ()

Public Methods

public String getCallbackUrl ()

public String getHubUrl ()

public Long getLeaseSeconds ()

public String getSecret ()

public String getTopic ()

public String getVerifyToken ()

public String handleSubscriberRequest (String httpMethod, String contentType, Map<String, Object> responseHeaders, String onBehalfOf, String payload, SourceCallback sourceCallback)

Handle all subscriber requests.

Parameters
httpMethod The HTTP method name
contentType The content-type of the request
responseHeaders The outbound/response headers
onBehalfOf (Optional) number of subscribers this subscriber is representing, should be either an integer or a Mule expression
payload The message payload
sourceCallback The callback to call when content is propagated
Returns
  • the response body
Throws
Exception
MuleException
DecoderException
Exception

public void setCallbackUrl (String callbackUrl)

Parameters
callbackUrl

public void setHubUrl (String hubUrl)

Parameters
hubUrl

public void setLeaseSeconds (Long leaseSeconds)

Parameters
leaseSeconds

public void setSecret (String secret)

Parameters
secret

public void setTopic (String topic)

Parameters
topic

public void subscribe ()

Throws
Exception

Protected Methods

protected String handleContentDelivery (String contentType, Map<String, Object> responseHeaders, String onBehalfOf, String payload, SourceCallback sourceCallback)

Parameters
contentType
responseHeaders
onBehalfOf
payload
sourceCallback
Throws
Exception

protected void handleOnBehalfOf (Map<String, Object> responseHeaders, String onBehalfOf)

Parameters
responseHeaders
onBehalfOf