Package zendesk.core
Interface ActionHandlerRegistry
-
public interface ActionHandlerRegistryDefines an interface for a registry ofActionHandlerobjects to be used for inter-SDK actions, such as starting anandroid.app.Activityfrom one SDK, in another SDK, without any dependency between them.ActionHandlerobjects can be added and removed from the registry usingActionHandlerRegistry.add(ActionHandler)andActionHandlerRegistry.remove(ActionHandler), respectively. A query method,ActionHandlerRegistry.handlerByAction(String), returns the highest priorityActionHandlerwhoseActionHandler.canHandle(String)returned true.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidadd(ActionHandler actionHandler)Adds anActionHandlerto the registry.voidclear()Removes allActionHandlers from the registry.ActionHandlerhandlerByAction(java.lang.String actionName)Finds and returns the highest priorityActionHandlerwhoseActionHandler.canHandle(String)method returned true for the given action String, or null if noActionHandlers returned true.java.util.List<ActionHandler>handlersByAction(java.lang.String actionName)Finds and returns a priority ordered list ofActionHandlerwhoseActionHandler.canHandle(String)method returned true for the given action String, or an empty list if noActionHandlers returned true.voidremove(ActionHandler actionHandler)Removes anActionHandlerfrom the registry.voidupdateSettings(java.util.Map<java.lang.String,JsonElement> settings)Notifies the Registry of an update to settings.
-
-
-
Method Detail
-
add
void add(ActionHandler actionHandler)
Adds anActionHandlerto the registry.- Parameters:
actionHandler- the ActionHandler to add to the registry.
-
remove
void remove(ActionHandler actionHandler)
Removes anActionHandlerfrom the registry.- Parameters:
actionHandler- the ActionHandler to remove from the registry.
-
clear
void clear()
Removes allActionHandlers from the registry.
-
handlerByAction
ActionHandler handlerByAction(java.lang.String actionName)
Finds and returns the highest priorityActionHandlerwhoseActionHandler.canHandle(String)method returned true for the given action String, or null if noActionHandlers returned true.- Parameters:
actionName- the action String with which to query theActionHandlers in the registry.- Returns:
- the highest priority
ActionHandlerwhoseActionHandler.canHandle(String)method returned true, or null if noActionHandlers returned true.
-
handlersByAction
java.util.List<ActionHandler> handlersByAction(java.lang.String actionName)
Finds and returns a priority ordered list ofActionHandlerwhoseActionHandler.canHandle(String)method returned true for the given action String, or an empty list if noActionHandlers returned true.- Parameters:
actionName- the action String with which to query theActionHandlers in the registry.- Returns:
- A priority ordered list of
ActionHandlerwhoseActionHandler.canHandle(String)method returned true, or an empty list if noActionHandlers returned true.
-
updateSettings
void updateSettings(java.util.Map<java.lang.String,JsonElement> settings)
Notifies the Registry of an update to settings. These will be passed to each of the ActionHandlers via theActionHandler.updateSettings(Map)method. These settings allows the ActionHandlers to determine whether they should be enabled.- Parameters:
settings- a map representing the SDK settings for the current instance. This will contain settings for each of the SDKs enabled for this account.
-
-