org.universAAL.middleware.ui
Class UIHandler

Package class diagram package UIHandler
java.lang.Object
  extended by org.universAAL.middleware.bus.member.BusMember
      extended by org.universAAL.middleware.bus.member.Callee
          extended by org.universAAL.middleware.ui.UIHandler
Direct Known Subclasses:
Handler, Handler, SmsUIHandler

public abstract class UIHandler
extends Callee

Provides the interface to be implemented by UIHandlers together with shared code. Only instances of this class can handle UIRequests. The convention of the IUIBus regarding the registration parameters is the following:

Author:
mtazari, eandgrg

Field Summary
 
Fields inherited from class org.universAAL.middleware.bus.member.BusMember
busResourceURI, owner, theBus
 
Constructor Summary
protected UIHandler(ModuleContext context, UIHandlerProfile initialSubscription)
          Instantiates a new UIHandler.
protected UIHandler(ModuleContext context, UIHandlerProfile[] initialSubscriptions)
          Instantiates a new UIHandler.
 
Method Summary
abstract  void adaptationParametersChanged(String dialogID, String changedProp, Object newVal)
          Adaptation parameters changed.
 void addNewRegParams(UIHandlerProfile newSubscription)
          Adds the new UIHandler registration parameters.
 void busDyingOut(AbstractBus b)
          This method is called when the bus is stopped to announce this to the bus members.
abstract  void communicationChannelBroken()
          Method to be called when the communication of the UIHandler with the IDialogManager is lost.
abstract  Resource cutDialog(String dialogID)
          Cut dialog.
 void dialogFinished(UIResponse uiResponse)
          Dialog finished.
 String getMyID()
          Id with which the UIHandler is registered in the IUIBus
 List<UIHandlerProfile> getRealizedHandlerProfiles()
           
 void handleRequest(BusMessage msg)
          Handle request.
abstract  void handleUICall(UIRequest uiRequest)
          Handle ui call (UIRequest).
protected  void removeMatchingRegParams(UIHandlerProfile oldSubscription)
          Removes the matching registration parameters.
 void userLoggedIn(Resource user, AbsLocation loginLocation)
          User logged in.
 
Methods inherited from class org.universAAL.middleware.bus.member.BusMember
close, getType, getURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UIHandler

protected UIHandler(ModuleContext context,
                    UIHandlerProfile initialSubscription)
Instantiates a new UIHandler.

Parameters:
context - the context
initialSubscription - the initial subscription
Throws:
NullPointerException - if initialSubscription is null or one of the elements of that array is null

UIHandler

protected UIHandler(ModuleContext context,
                    UIHandlerProfile[] initialSubscriptions)
Instantiates a new UIHandler.

Parameters:
context - the context
initialSubscription - the initial subscription
Throws:
NullPointerException - if initialSubscriptions is null or one of the elements of that array is null
Method Detail

adaptationParametersChanged

public abstract void adaptationParametersChanged(String dialogID,
                                                 String changedProp,
                                                 Object newVal)
Adaptation parameters changed. The Dialog must be redrawn according to the new value of the changedProp.

Parameters:
dialogID - the dialog id
changedProp - the changed prop
newVal - the new val

addNewRegParams

public final void addNewRegParams(UIHandlerProfile newSubscription)
Adds the new UIHandler registration parameters.

Parameters:
newSubscription - the new subscription - as a UIHandlerProfile
Throws:
NullPointerException - if newSubscription is null

busDyingOut

public final void busDyingOut(AbstractBus b)
Description copied from class: BusMember
This method is called when the bus is stopped to announce this to the bus members.

Specified by:
busDyingOut in class BusMember
Parameters:
b - bus on which this member has been registered
See Also:
BusMember.busDyingOut(AbstractBus)

communicationChannelBroken

public abstract void communicationChannelBroken()
Method to be called when the communication of the UIHandler with the IDialogManager is lost. All dialogs must be de-renderized (handlers may whant to inform the user about why de dialogs are being de-renderized). The bus will automatically resend all HandlerProfiles.


cutDialog

public abstract Resource cutDialog(String dialogID)
Cut dialog. The DM is requesting an IMEDIATE de-renderization of the dialog with given dialogID.

Parameters:
dialogID - the dialog id
Returns:
the resource data form the Form filled by the user up to the moment this call is performed.

dialogFinished

public final void dialogFinished(UIResponse uiResponse)
Dialog finished. UIHandler reporting the user has submitted a Submit or a SubdialogTrigger.

Parameters:
uiResponse - the UIResponse

handleRequest

public final void handleRequest(BusMessage msg)
Handle request.

Parameters:
msg - the message

handleUICall

public abstract void handleUICall(UIRequest uiRequest)
Handle ui call (UIRequest). The bus is soliciting a Render/display of the UIRequest.

Parameters:
uiRequest - the UIRequest

removeMatchingRegParams

protected final void removeMatchingRegParams(UIHandlerProfile oldSubscription)
Removes the matching registration parameters.

Parameters:
oldSubscription - the old subscription

userLoggedIn

public final void userLoggedIn(Resource user,
                               AbsLocation loginLocation)
User logged in.

Parameters:
user - the 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 - the login location

getRealizedHandlerProfiles

public List<UIHandlerProfile> getRealizedHandlerProfiles()
Returns:
realized UIHandlerProfiles

getMyID

public String getMyID()
Id with which the UIHandler is registered in the IUIBus

Returns:
UIHandler ID


Copyright © 2014 universAAL Consortium. All Rights Reserved.