Class ApnsSendPushNotificationJobHandler

java.lang.Object
com.flowable.engage.notification.apns.ApnsSendPushNotificationJobHandler
All Implemented Interfaces:
org.flowable.job.service.JobHandler

public class ApnsSendPushNotificationJobHandler
extends java.lang.Object
implements org.flowable.job.service.JobHandler
Author:
Filip Hrisafov
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected boolean addConversationNameToTitle  
    protected boolean addSenderNameToTitle  
    protected ApnsPushNotificationSender apnsPushNotificationSender  
    protected DeviceService deviceService  
    protected boolean enableNotificationTitle  
    static java.lang.String TYPE  
  • Constructor Summary

    Constructors 
    Constructor Description
    ApnsSendPushNotificationJobHandler​(DeviceService deviceService, ApnsPushNotificationSender apnsPushNotificationSender)  
  • Method Summary

    Modifier and Type Method Description
    void execute​(org.flowable.job.service.impl.persistence.entity.JobEntity job, java.lang.String configuration, org.flowable.variable.api.delegate.VariableScope variableScope, org.flowable.common.engine.impl.interceptor.CommandContext commandContext)  
    protected java.lang.String getAlertTitle​(java.lang.String recipientId, java.lang.String messageId, java.lang.String conversationId, java.lang.String senderId, java.lang.String tenantId, org.flowable.common.engine.impl.interceptor.CommandContext commandContext)
    Hook method to compose the title for the push notification.
    protected java.lang.String getConversationName​(Conversation conversation)
    Hook method to compose the conversation name used in the push notification title.
    protected java.lang.String getConversationName​(java.lang.String conversationId, org.flowable.common.engine.impl.interceptor.CommandContext commandContext)  
    java.lang.String getType()  
    protected java.lang.String getUserName​(com.flowable.core.idm.api.PlatformUser user)
    Hook method to compose the sending user name in the push notification.
    protected java.lang.String getUserName​(java.lang.String userId, java.lang.String tenantId, org.flowable.common.engine.impl.interceptor.CommandContext commandContext)  
    boolean isAddConversationNameToTitle()  
    boolean isAddSenderNameToTitle()  
    boolean isEnableNotificationTitle()  
    protected void sendLastReadMessage​(java.lang.String recipientId, com.fasterxml.jackson.databind.JsonNode payloadMessage, org.flowable.common.engine.impl.interceptor.CommandContext commandContext)  
    protected void sendMessage​(java.lang.String recipientId, com.fasterxml.jackson.databind.JsonNode payloadMessage, org.flowable.common.engine.impl.interceptor.CommandContext commandContext)  
    protected void sendPushNotificationWithBuilder​(java.lang.String recipientId, java.lang.String collapseId, java.lang.String apnsId, com.turo.pushy.apns.util.ApnsPayloadBuilder payloadBuilder)  
    void setAddConversationNameToTitle​(boolean addConversationNameToTitle)  
    void setAddSenderNameToTitle​(boolean addSenderNameToTitle)  
    void setEnableNotificationTitle​(boolean enableNotificationTitle)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • getType

      public java.lang.String getType()
      Specified by:
      getType in interface org.flowable.job.service.JobHandler
    • execute

      public void execute​(org.flowable.job.service.impl.persistence.entity.JobEntity job, java.lang.String configuration, org.flowable.variable.api.delegate.VariableScope variableScope, org.flowable.common.engine.impl.interceptor.CommandContext commandContext)
      Specified by:
      execute in interface org.flowable.job.service.JobHandler
    • sendMessage

      protected void sendMessage​(java.lang.String recipientId, com.fasterxml.jackson.databind.JsonNode payloadMessage, org.flowable.common.engine.impl.interceptor.CommandContext commandContext)
    • getAlertTitle

      protected java.lang.String getAlertTitle​(java.lang.String recipientId, java.lang.String messageId, java.lang.String conversationId, java.lang.String senderId, java.lang.String tenantId, org.flowable.common.engine.impl.interceptor.CommandContext commandContext)
      Hook method to compose the title for the push notification. This default implementation uses the sender name and the conversation name, if available.
      Parameters:
      recipientId - the id of the recipient of the push notification
      messageId - the id of the message to be pushed
      conversationId - the id of the conversation where the message was posted into
      senderId - the id of the sending user
      tenantId - the tenant id of the message
      commandContext - the command context to get further information or services, if needed
    • getUserName

      protected java.lang.String getUserName​(java.lang.String userId, java.lang.String tenantId, org.flowable.common.engine.impl.interceptor.CommandContext commandContext)
    • getUserName

      protected java.lang.String getUserName​(com.flowable.core.idm.api.PlatformUser user)
      Hook method to compose the sending user name in the push notification. Uses the display name, if available, otherwise first name / last name as a composition.
      Parameters:
      user - the user to return its name
      Returns:
      the name of the user
    • getConversationName

      protected java.lang.String getConversationName​(java.lang.String conversationId, org.flowable.common.engine.impl.interceptor.CommandContext commandContext)
    • getConversationName

      protected java.lang.String getConversationName​(Conversation conversation)
      Hook method to compose the conversation name used in the push notification title. Uses the conversation name, if available or its fallback name, otherwise null is returned.
      Parameters:
      conversation - the conversation to return its name
      Returns:
    • sendLastReadMessage

      protected void sendLastReadMessage​(java.lang.String recipientId, com.fasterxml.jackson.databind.JsonNode payloadMessage, org.flowable.common.engine.impl.interceptor.CommandContext commandContext)
    • sendPushNotificationWithBuilder

      protected void sendPushNotificationWithBuilder​(java.lang.String recipientId, java.lang.String collapseId, java.lang.String apnsId, com.turo.pushy.apns.util.ApnsPayloadBuilder payloadBuilder)
    • isEnableNotificationTitle

      public boolean isEnableNotificationTitle()
    • setEnableNotificationTitle

      public void setEnableNotificationTitle​(boolean enableNotificationTitle)
    • isAddSenderNameToTitle

      public boolean isAddSenderNameToTitle()
    • setAddSenderNameToTitle

      public void setAddSenderNameToTitle​(boolean addSenderNameToTitle)
    • isAddConversationNameToTitle

      public boolean isAddConversationNameToTitle()
    • setAddConversationNameToTitle

      public void setAddConversationNameToTitle​(boolean addConversationNameToTitle)