public class CallbackService
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.lang.String |
accountId |
static java.lang.String |
CRONSCHEDULE_EVERY_DAY |
static java.lang.String |
CRONSCHEDULE_EVERY_MINUTE |
static java.lang.String |
CRONSCHEDULE_EVERY_MONTH |
static java.lang.String |
CRONSCHEDULE_EVERY_WEEK |
static java.lang.String |
CRONSCHEDULE_EVERY_WORKDAY |
java.util.HashMap<java.lang.String,java.lang.String> |
pluginMap |
java.lang.String |
tenantId |
Constructor and Description |
---|
CallbackService(java.lang.String tenantId,
java.lang.String accountId,
java.util.HashMap<java.lang.String,java.lang.String> pluginMap)
The constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
chatbotTaskScheduleExists(int id)
Get all scheduled callbacks from webservice for this plugin
|
java.util.List<ChatbotTaskSchedule> |
getCallbacks()
Get all scheduled callbacks from webservice for this plugin
|
java.lang.String |
getUserIdFromChatbotTaskScheduleMobileUserAccount(ChatbotTaskSchedule chatbotTaskSchedule)
Get userId from ChatbotTaskSchedule's MobileUserAccount object
|
boolean |
scheduleCallback(java.lang.String cronSchedule,
boolean hasAnonymousUserAccount,
AnonymousUserAccount anonymousUserAccount,
boolean hasMobileUserAccount,
MobileUserAccount mobileUserAccount)
Call webservice to schedule a callback
|
boolean |
unregisterAllCallbacks(MobileUserAccount mobileUserAccount)
Call webservice to unregister all callbacks for this user
|
boolean |
unregisterCallback(int id)
Call webservice to unregister a callback for this user by ChatbotCallback ID
|
boolean |
unregisterCallbackByUser(java.lang.String userId)
Call webservice to unregister a callback for this user
|
public static final java.lang.String CRONSCHEDULE_EVERY_MINUTE
public static final java.lang.String CRONSCHEDULE_EVERY_WORKDAY
public static final java.lang.String CRONSCHEDULE_EVERY_DAY
public static final java.lang.String CRONSCHEDULE_EVERY_WEEK
public static final java.lang.String CRONSCHEDULE_EVERY_MONTH
public java.lang.String tenantId
public java.lang.String accountId
public java.util.HashMap<java.lang.String,java.lang.String> pluginMap
public CallbackService(java.lang.String tenantId, java.lang.String accountId, java.util.HashMap<java.lang.String,java.lang.String> pluginMap)
tenantId
- the tenant identifieraccountId
- the account identifierpluginMap
- the plugin mappublic boolean scheduleCallback(java.lang.String cronSchedule, boolean hasAnonymousUserAccount, AnonymousUserAccount anonymousUserAccount, boolean hasMobileUserAccount, MobileUserAccount mobileUserAccount)
cronSchedule
- the cron schedule (e.g. "0 0/1 * * * ? *"; to fire every minute)hasAnonymousUserAccount
- if BBP request contains a AnonymousUserAccount
anonymousUserAccount
- the AnonymousUserAccount
provided in BBP request or null
hasMobileUserAccount
- if BBP request contains a MobileUserAccount
mobileUserAccount
- the MobileUserAccount
provided in BBP request or null
true
if schedule callback has been placed (success); otherwise false
public boolean unregisterCallbackByUser(java.lang.String userId)
userId
- the mobile usernametrue
on success; otherwise false
public java.lang.String getUserIdFromChatbotTaskScheduleMobileUserAccount(ChatbotTaskSchedule chatbotTaskSchedule)
chatbotTaskSchedule
- the ChatbotTaskSchedule object containing the MobileUserAccount object with the userId (as MobileAppSetting)public boolean unregisterCallback(int id)
id
- the ChatbotTaskSchedule identifiertrue
on success; otherwise false
public boolean unregisterAllCallbacks(MobileUserAccount mobileUserAccount)
mobileUserAccount
- the mobile user account objecttrue
on success; otherwise false
public java.util.List<ChatbotTaskSchedule> getCallbacks()
List
of ChatbotTaskSchedule objects if exists; otherwise null
public boolean chatbotTaskScheduleExists(int id)
id
- the ChatbotTaskSchedule identifiertrue
if cronSchedule for given user exists; otherwise false
Copyright © 2019 Citunius GmbH. All Rights Reserved.