public class UIBusImpl extends AbstractBus implements IUIBus
IUIBus
interfacebusStrategy, communicationModule, context, OPTIONAL_URI_PREFIX, registry, spaceManager
Modifier and Type | Method and Description |
---|---|
void |
abortDialog(String callerID,
String dialogID)
Aborts the dialog upon request from the application or Dialog Manager.
|
void |
adaptationParametersChanged(IDialogManager dm,
UIRequest uiRequest,
String changedProp)
Only the Dialog Manager (DM) can call this method.
|
void |
addNewProfile(String handlerID,
UIHandlerProfile newProfile)
|
void |
assessContentSerialization(Resource content) |
void |
brokerUIRequest(String callerID,
UIRequest req)
Asks the bus to find an appropriate UI handler and forward the request to
it for handling
|
protected BusStrategy |
createBusStrategy(CommunicationModule commModule) |
void |
dialogFinished(String handlerID,
UIResponse response)
|
void |
dialogSuspended(IDialogManager dm,
String dialogID)
Only the Dialog Manager (DM) can call this method.
|
UIHandlerProfile[] |
getMatchingProfiles(String modalityRegex)
Returns list of
UIHandlerProfile s that match the given expression |
static ModuleContext |
getModuleContext() |
static Object[] |
getUIBusFetchParams() |
void |
handleSendError(ChannelMessage message,
CommunicationConnectorException e)
Callback for error handling
|
void |
removeMatchingProfile(String handlerID,
UIHandlerProfile oldProfile)
|
void |
resumeDialog(String callerID,
String dialogID,
Resource dialogData)
Applications can use this method to ask the
IUIBus to resume a
dialog that was interrupted due to the activation of a sub-dialog of it. |
void |
setDialogManager(IDialogManager dm) |
static void |
startModule(Container c,
ModuleContext mc,
Object[] uiBusShareParams,
Object[] uiBusFetchParams) |
static void |
stopModule() |
void |
unregister(String memberID,
BusMember m)
Unregisters bus member from the bus (if the bus member with given ID
exists).
|
void |
unregister(String callerID,
UICaller caller)
Unregisters an application's caller from the bus.
|
void |
unregister(String handlerID,
UIHandler handler)
Unregisters the given
UIHandler from the bus.. |
void |
userLoggedIn(String handlerID,
Resource user,
AbsLocation loginLocation)
|
addRegistryListener, brokerMessage, createBusSpecificID, createRegistry, dispose, getBrokerName, getBusMember, getBusMemberID, getBusMembers, getBusMembersByID, getCurrentNumberOfPeers, getPeerCard, getPeerFromBusResourceURI, getURI, init, initBrokerage, isBusResourceURI, isValidMember, messageReceived, register, removeRegistryListener, unmarshall
public static Object[] getUIBusFetchParams()
public void assessContentSerialization(Resource content)
public static void startModule(Container c, ModuleContext mc, Object[] uiBusShareParams, Object[] uiBusFetchParams)
public static void stopModule()
public static ModuleContext getModuleContext()
ModuleContext
protected BusStrategy createBusStrategy(CommunicationModule commModule)
createBusStrategy
in class AbstractBus
public void setDialogManager(IDialogManager dm)
dm
- IDialogManager
public void abortDialog(String callerID, String dialogID)
IUIBus
abortDialog
in interface IUIBus
callerID
- ID of the application that had originally started the dialogdialogID
- ID of the dialogpublic void adaptationParametersChanged(IDialogManager dm, UIRequest uiRequest, String changedProp)
IUIBus
IUIBus
by calling this
method. The IUIBus
may then either notify the UIHandler
in charge of that dialog to consider the changes (if the changes in the
adaptation parameters still match its profile -- see also
UIHandler.adaptationParametersChanged(String, String, Object)
) or
switch to another UIHandler
(if the new situation cannot be
handled by the previous UIHandler
). In the latter case, the
previous UIHandler
is notified to abort the dialog while
returning any intermediate user input collected so far (by calling
UIHandler.cutDialog(String)
), and then the new UIHandler
is mandated (by calling UIHandler.handleUICall(UIRequest)
) to
continue with the dialog presentation without loss of data.adaptationParametersChanged
in interface IUIBus
dm
- Dialog ManageruiRequest
- The whole call context that is affected by the change,
including the dialog ID and the the new value of the changed
propertychangedProp
- the property (from among all properties of the call context)
that has changedpublic void addNewProfile(String handlerID, UIHandlerProfile newProfile)
IUIBus
UIHandler
) with
regard to UIRequest
s that it can handle. Responsible (together
with IUIBus.removeMatchingProfile(String, UIHandlerProfile)
) for
changing the handler's profile dynamically.addNewProfile
in interface IUIBus
handlerID
- ID of the UIHandler
introducing the new registration
parametersnewProfile
- the new class of UIRequest
s that can additionally be
handled by the given UIHandler
public void dialogFinished(String handlerID, UIResponse response)
IUIBus
dialogFinished
in interface IUIBus
handlerID
- ID of the UIHandler
that has finished the dialogpublic void dialogSuspended(IDialogManager dm, String dialogID)
IUIBus
UIRequest
with a higher priority than the running one is
addressing the same user, or because the user wants to switch to another
dialog using the "standard buttons"), then it must notify the
IUIBus
by calling this method. The IUIBus
will then ask
the UIHandler
in charge of handling the running dialog to cut
that dialog (see UIHandler.cutDialog(String)
) and return all user
input collected so far so that the dialog can be resumed later without
loss of data.dialogSuspended
in interface IUIBus
dm
- Dialog ManagerdialogID
- ID of the dialog to suspendpublic void removeMatchingProfile(String handlerID, UIHandlerProfile oldProfile)
IUIBus
UIRequest
s from the profile of the
UIHandler
. Responsible (together with
IUIBus.addNewProfile(String, UIHandlerProfile)
) for changing the
handler's profile dynamically.removeMatchingProfile
in interface IUIBus
handlerID
- ID of the calling UIHandler
that had previously
registered 'oldProfile'public void resumeDialog(String callerID, String dialogID, Resource dialogData)
IUIBus
IUIBus
to resume a
dialog that was interrupted due to the activation of a sub-dialog of it.
This is the only case where the applications are aware about a dialog
having been suspended because the resumption depends on them having
processed the user input in the context of the sub-dialog and having
incorporated it into the form data of the parent dialog if needed. Then,
they can activate the parent dialog using this method.resumeDialog
in interface IUIBus
callerID
- ID of the application that had originally started the dialogdialogID
- ID of the dialogdialogData
- dialog data (see Form.getData()
)public void brokerUIRequest(String callerID, UIRequest req)
brokerUIRequest
in interface IUIBus
callerID
- the ID of the UICaller that is asking the busreq
- the request to be forwarded to a UI handlerIUIBus.brokerUIRequest(java.lang.String,
org.universAAL.middleware.ui.UIRequest)
public void unregister(String callerID, UICaller caller)
IUIBus
unregister
in interface IUIBus
callerID
- ID of the caller to be unregisteredcaller
- the caller to be unregisteredpublic void unregister(String handlerID, UIHandler handler)
IUIBus
UIHandler
from the bus..unregister
in interface IUIBus
handlerID
- ID of the handler to be unregisteredhandler
- the handler to be unregisteredpublic void unregister(String memberID, BusMember m)
AbstractBus
unregister
in class AbstractBus
public void userLoggedIn(String handlerID, Resource user, AbsLocation loginLocation)
IUIBus
userLoggedIn
in interface IUIBus
handlerID
- id of the UIHandler
which is received when registering
to the IUIBus
. It must be passed to the bus when
calling bus methods.user
- human User
. It is declared as Resource because the
type User is defined in the Profiling Ontology. The type is
not needed for for matchmaking Either.loginLocation
- login Location
of the User
public void handleSendError(ChannelMessage message, CommunicationConnectorException e)
MessageListener
handleSendError
in interface MessageListener
public UIHandlerProfile[] getMatchingProfiles(String modalityRegex)
UIHandlerProfile
s that match the given expressiongetMatchingProfiles
in interface IUIBus
modalityRegex
- - regular expression used for matching
UIHandlerProfile
s modalitiesUIHandlerProfile
sCopyright © 2018 universAAL Consortium. All rights reserved.