Package com.mparticle.sdk
Class MessageProcessor
java.lang.Object
com.mparticle.sdk.MessageProcessor
Provides basic structure for implementing a custom message processing module.
A typical module
- Implements processRegistrationRequest to return registration information about the module.
- Adds custom logic to processEventProcessingRequest and/or event-specific handlers.
- Implements processAudienceMembershipChangeRequest if the module subscribes to the audience data stream.
- Implements processAudienceSubscriptionRequest if the module needs to handle audience subscription updates.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final void
Logs a message.void
Handler for processing ApplicationStateTransitionEvent.void
Handler for processing audience membership changes.Handler for processing audience subscriptions.void
Handler for processing CCPA Consent State system notificationsvoid
processCustomEvent
(CustomEvent event) Handler for processing CustomEvent.Handler for processing data subject requests.void
processErrorEvent
(ErrorEvent event) Handler for processing ErrorEvent.Handler for processing event processing request.void
Handler for processing GDPR Consent State system notificationsvoid
Handler for processing ImpressionEvents.final Message
processMessage
(Message request) Parses the message and invokes specific handler.void
Handler for processing PrivacySettingChangeEvent.void
Handler for processing ProductActionEvent.void
Handler for processing PromotionActionEvents.void
Handler for processing PushMessageOpenEvent.void
Handler for processing PushMessageReceiptEvent.void
Handler for processing PushSubscriptionEvent.abstract ModuleRegistrationResponse
Handler for processing module registration request.void
Handler for processing ScreenViewEvent.void
Handler for processing SessionEndEvent.void
Handler for processing SessionStartEvent.void
Handler for processing UserAttributeChangeEvent.void
Handler for processing UserIdentityChangeEvent.void
Sets logger.
-
Constructor Details
-
MessageProcessor
public MessageProcessor()
-
-
Method Details
-
processMessage
Parses the message and invokes specific handler.- Parameters:
request
- Request message- Returns:
- Response message
- Throws:
IOException
-
processRegistrationRequest
public abstract ModuleRegistrationResponse processRegistrationRequest(ModuleRegistrationRequest request) Handler for processing module registration request.Every module is required to specify description, user settings, supported events, and request access to specific user and device identifiers.
- Parameters:
request
- request- Returns:
- response
-
processEventProcessingRequest
public EventProcessingResponse processEventProcessingRequest(EventProcessingRequest request) throws IOException Handler for processing event processing request.Base implementation parses the request and calls individual event and system notification handlers.
- Parameters:
request
- request- Returns:
- response
- Throws:
IOException
-
processGDPRConsentStateNotification
public void processGDPRConsentStateNotification(GDPRConsentStateNotification notification) throws IOException Handler for processing GDPR Consent State system notifications- Parameters:
notification
-- Throws:
IOException
-
processCCPAConsentStateNotification
public void processCCPAConsentStateNotification(CCPAConsentStateNotification notification) throws IOException Handler for processing CCPA Consent State system notifications- Parameters:
notification
-- Throws:
IOException
-
processAttributionEvent
- Parameters:
event
-- Throws:
IOException
-
processImpressionEvent
Handler for processing ImpressionEvents.- Parameters:
event
-- Throws:
IOException
-
processPromotionActionEvent
Handler for processing PromotionActionEvents.- Parameters:
event
-- Throws:
IOException
-
processProductActionEvent
Handler for processing ProductActionEvent.- Parameters:
event
- event- Throws:
IOException
-
processPushMessageReceiptEvent
Handler for processing PushMessageReceiptEvent.- Parameters:
event
- event- Throws:
IOException
-
processPushMessageOpenEvent
Handler for processing PushMessageOpenEvent.- Parameters:
event
- event- Throws:
IOException
-
processApplicationStateTransitionEvent
public void processApplicationStateTransitionEvent(ApplicationStateTransitionEvent event) throws IOException Handler for processing ApplicationStateTransitionEvent.- Parameters:
event
- event- Throws:
IOException
-
processPushSubscriptionEvent
Handler for processing PushSubscriptionEvent.- Parameters:
event
- event- Throws:
IOException
-
processUserIdentityChangeEvent
Handler for processing UserIdentityChangeEvent.- Parameters:
event
- event- Throws:
IOException
-
processUserAttributeChangeEvent
Handler for processing UserAttributeChangeEvent.- Parameters:
event
- event- Throws:
IOException
-
processSessionStartEvent
Handler for processing SessionStartEvent.- Parameters:
event
- event- Throws:
IOException
-
processSessionEndEvent
Handler for processing SessionEndEvent.- Parameters:
event
- event- Throws:
IOException
-
processCustomEvent
Handler for processing CustomEvent.- Parameters:
event
- event- Throws:
IOException
-
processErrorEvent
Handler for processing ErrorEvent.- Parameters:
event
- event- Throws:
IOException
-
processScreenViewEvent
Handler for processing ScreenViewEvent.- Parameters:
event
- event- Throws:
IOException
-
processPrivacySettingChangeEvent
Handler for processing PrivacySettingChangeEvent.- Parameters:
event
- event- Throws:
IOException
-
processDsrProcessingRequest
public DsrProcessingResponse processDsrProcessingRequest(DsrProcessingRequest request) throws IOException Handler for processing data subject requests.- Parameters:
request
- request- Returns:
- response
- Throws:
IOException
-
processAudienceMembershipChangeRequest
public AudienceMembershipChangeResponse processAudienceMembershipChangeRequest(AudienceMembershipChangeRequest request) throws IOException Handler for processing audience membership changes.- Parameters:
request
- request- Returns:
- response
- Throws:
IOException
-
processAudienceSubscriptionRequest
public AudienceSubscriptionResponse processAudienceSubscriptionRequest(AudienceSubscriptionRequest request) throws IOException Handler for processing audience subscriptions.- Parameters:
request
- request- Returns:
- response
- Throws:
IOException
-
setLogger
Sets logger.- Parameters:
logger
- logger
-
log
Logs a message.- Parameters:
message
-
-