Package zendesk.core
Interface ActionHandlerRegistry
-
public interface ActionHandlerRegistry
Defines an interface for a registry ofActionHandler
objects to be used for inter-SDK actions, such as starting anandroid.app.Activity
from one SDK, in another SDK, without any dependency between them.ActionHandler
objects can be added and removed from the registry usingActionHandlerRegistry.add(ActionHandler)
andActionHandlerRegistry.remove(ActionHandler)
, respectively. A query method,ActionHandlerRegistry.handlerByAction(String)
, returns the highest priorityActionHandler
whoseActionHandler.canHandle(String)
returned true.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description void
add(ActionHandler actionHandler)
Adds anActionHandler
to the registry.void
clear()
Removes allActionHandler
s from the registry.ActionHandler
handlerByAction(java.lang.String actionName)
Finds and returns the highest priorityActionHandler
whoseActionHandler.canHandle(String)
method returned true for the given action String, or null if noActionHandler
s returned true.java.util.List<ActionHandler>
handlersByAction(java.lang.String actionName)
Finds and returns a priority ordered list ofActionHandler
whoseActionHandler.canHandle(String)
method returned true for the given action String, or an empty list if noActionHandler
s returned true.void
remove(ActionHandler actionHandler)
Removes anActionHandler
from the registry.void
updateSettings(java.util.Map<java.lang.String,JsonElement> settings)
Notifies the Registry of an update to settings.
-
-
-
Method Detail
-
add
void add(ActionHandler actionHandler)
Adds anActionHandler
to the registry.- Parameters:
actionHandler
- the ActionHandler to add to the registry.
-
remove
void remove(ActionHandler actionHandler)
Removes anActionHandler
from the registry.- Parameters:
actionHandler
- the ActionHandler to remove from the registry.
-
clear
void clear()
Removes allActionHandler
s from the registry.
-
handlerByAction
ActionHandler handlerByAction(java.lang.String actionName)
Finds and returns the highest priorityActionHandler
whoseActionHandler.canHandle(String)
method returned true for the given action String, or null if noActionHandler
s returned true.- Parameters:
actionName
- the action String with which to query theActionHandler
s in the registry.- Returns:
- the highest priority
ActionHandler
whoseActionHandler.canHandle(String)
method returned true, or null if noActionHandler
s returned true.
-
handlersByAction
java.util.List<ActionHandler> handlersByAction(java.lang.String actionName)
Finds and returns a priority ordered list ofActionHandler
whoseActionHandler.canHandle(String)
method returned true for the given action String, or an empty list if noActionHandler
s returned true.- Parameters:
actionName
- the action String with which to query theActionHandler
s in the registry.- Returns:
- A priority ordered list of
ActionHandler
whoseActionHandler.canHandle(String)
method returned true, or an empty list if noActionHandler
s 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.
-
-