org.universAAL.ui.dm
Class DialogManagerImpl

Package class diagram package DialogManagerImpl
java.lang.Object
  extended by org.universAAL.middleware.bus.member.BusMember
      extended by org.universAAL.middleware.bus.member.Caller
          extended by org.universAAL.middleware.ui.UICaller
              extended by org.universAAL.ui.dm.DialogManagerImpl
All Implemented Interfaces:
IDialogManager

public final class DialogManagerImpl
extends UICaller
implements IDialogManager

The UICaller implements the interface IDialogManager.

Author:
amedrano created: 26-sep-2012 13:03:50

Field Summary
static String CALL_PREFIX
          Prefix for all DM calls (Submits).
 
Fields inherited from class org.universAAL.middleware.bus.member.BusMember
busResourceURI, owner, theBus
 
Method Summary
 boolean checkNewDialog(UIRequest request)
          This method is called by the UI bus and determines whether a dialog can be shown directly (e.g. by comparing the dialogs priority with the priority of a dialog that is currently shown).
 void communicationChannelBroken()
          Method to be called when the communication of the UICaller with the IDialogManager is lost.
static void createInstance(ModuleContext mc)
          Create a Singleton Instance.
 void dialogAborted(String dialogID, Resource data)
          This method is called when an event on the UI bus occurs indicating that a dialog was aborted.
 void dialogFinished(String dialogID)
          This method is called by the UI bus to inform the dialog manager that a dialog was successfully finished.
static File getConfigHome()
          Get the config folder.
static DialogManagerImpl getInstance()
          Get the singleton instance.
static ModuleContext getModuleContext()
          The module context reference.
static ServiceCaller getServiceCaller()
          Get the ServiceCaller for calling a service
 UIRequest getSuspendedDialog(String dialogID)
          Get a suspended dialog.
 UserDialogManager getUDM(String userURI)
          Get the UserDialogManager for a given userURI
 IUIPreferencesBuffer getUIPreferencesBuffer()
          Get the UIPreferencesBuffer.
 void handleUIResponse(UIResponse response)
          Handle UIResponse - that comes from UIHandler carrying user input.
static void setConfigHome(File configHome)
          This should only be called form an activator.
static void stopDM()
          Stop the Dialog Manager's instance
 void suspendDialog(String dialogID)
          Suspend a dialog.
 void userLogIn(Resource user, AbsLocation location)
          A User has logged in at a location resend the appropriate dialog.
 
Methods inherited from class org.universAAL.middleware.ui.UICaller
abortDialog, adaptationParametersChanged, busDyingOut, dialogSuspended, getMyID, handleReply, resumeDialog, sendUIRequest
 
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
 

Field Detail

CALL_PREFIX

public static final String CALL_PREFIX
Prefix for all DM calls (Submits).

See Also:
Constant Field Values
Method Detail

checkNewDialog

public boolean checkNewDialog(UIRequest request)
This method is called by the UI bus and determines whether a dialog can be shown directly (e.g. by comparing the dialogs priority with the priority of a dialog that is currently shown). Additionally, it adds adaptation parameters.

Specified by:
checkNewDialog in interface IDialogManager
Parameters:
request - The UI request containing a dialog.
Returns:
true, if the dialog can be shown directly.
See Also:
IDialogManager.checkNewDialog(UIRequest)

dialogFinished

public void dialogFinished(String dialogID)
This method is called by the UI bus to inform the dialog manager that a dialog was successfully finished. The dialog manager can then show dialogs that were previously suspended.

Specified by:
dialogFinished in interface IDialogManager
Parameters:
dialogID - ID of the dialog that is now finished.
See Also:
IDialogManager.dialogFinished(String)

userLogIn

public void userLogIn(Resource user,
                      AbsLocation location)
A User has logged in at a location resend the appropriate dialog.

Specified by:
userLogIn in interface IDialogManager
Parameters:
user - User of a system. It is declared as Resource because the type User is defined in the Profiling Ontology. The type is not needed for for matchmaking Either.
location - Location from which User has logged in to the system

getSuspendedDialog

public UIRequest getSuspendedDialog(String dialogID)
Get a suspended dialog. Removes the dialog from 'suspendedDialogs' and adds it to 'runningDialogs'.

Specified by:
getSuspendedDialog in interface IDialogManager
Parameters:
dialogID - ID of the dialog.
Returns:
the suspended UIRequest, null if not found.

suspendDialog

public void suspendDialog(String dialogID)
Suspend a dialog. This method is called by the UI bus and removes the given dialog from 'runningDialogs' and stores it in 'suspendedDialogs'.

Specified by:
suspendDialog in interface IDialogManager
Parameters:
dialogID - ID of the dialog.

communicationChannelBroken

public void communicationChannelBroken()
Method to be called when the communication of the UICaller with the IDialogManager is lost. Any pending request might be resend at this point. All affected pending dialogs will be aborted right after this call (with null data).

Specified by:
communicationChannelBroken in class UICaller

dialogAborted

public void dialogAborted(String dialogID,
                          Resource data)
This method is called when an event on the UI bus occurs indicating that a dialog was aborted.

Specified by:
dialogAborted in class UICaller
Parameters:
dialogID - the dialogID of the dialog to be aborted
data - the data collected up until abortion, it might be null if the data could not be retrieved.

handleUIResponse

public void handleUIResponse(UIResponse response)
Handle UIResponse - that comes from UIHandler carrying user input.

Specified by:
handleUIResponse in class UICaller
Parameters:
response - the UIResponse

getUDM

public UserDialogManager getUDM(String userURI)
Get the UserDialogManager for a given userURI

Parameters:
userURI -
Returns:

getUIPreferencesBuffer

public IUIPreferencesBuffer getUIPreferencesBuffer()
Get the UIPreferencesBuffer.

Returns:

createInstance

public static void createInstance(ModuleContext mc)
Create a Singleton Instance.

Parameters:
mc - the ModuleContext needed to create the singleton instance (for UICaller).

stopDM

public static void stopDM()
Stop the Dialog Manager's instance


getInstance

public static DialogManagerImpl getInstance()
Get the singleton instance.

Returns:
the singleton Instance, null if not created.

getServiceCaller

public static ServiceCaller getServiceCaller()
Get the ServiceCaller for calling a service

Returns:
the service caller created during the bundle start.

getModuleContext

public static ModuleContext getModuleContext()
The module context reference.

Returns:
The module context reference.

getConfigHome

public static File getConfigHome()
Get the config folder.

Returns:
the configHome

setConfigHome

public static void setConfigHome(File configHome)
This should only be called form an activator.

Parameters:
configHome - set the configHome folder.


Copyright © 2014 universAAL Consortium. All Rights Reserved.