NAME
FusionInventory::Agent::Task::Deploy::UserCheck - Deploy task user checks
DESCRIPTION
This module provides object class to interact with logged users during a deploy task.
It can be used for any job managed during one deploy task. It can be used before the downloading step and/or after the actions processing. This may give a chance for user to stop the current job or to be alerted of done job.
The object is intended to show a modal windows or a notification to any logged user.
OBJECTS STRUCTURE
While instanciated, the
Methods
PACKAGE->new(%params)
Returns a newly created FusionInventory::Agent::Task::Deploy::UserCheck object.
Availables parameters:
Supported values for check hasf ref:
- title Title to be used in a modal window
- text Text of the window or notification
- icon Icon to be used in window or notification
- timeout The time-out in second to wait for a user response
- wait Should we have to wait the user response. If set to 0, "no" or "false", it will immediatly generate an "on_async" event.
- platform Platform or list of platforms on which we are expecting user interaction. User interaction will be skipped if the agent is not on any expected platform.
- type Type of user check to select when it should happen: - "before": for checking user before downloading and processing the deploy job - "after" : for checking or notify the user after the deploy job has been processed. - "after_download_failure": for checking or notify the user after a download failed. - "after_download": for checking or notify the user after all downloads was done. - "after_failure": for checking or notify the user after the deploy task failed.
Following values may to be used to define what should be done while buttons are clicked or related event occurs:
Each event should be a string with the following format: "<local_policy>:<server_policy>:<message to send back>"
<local_policy> must be one of the following string:
<server_policy> should be a string send back to server as status. <message to send back> should be a string send back to server as status message.
Remark: as semi-colon is used as delimiter, server should not use it in sent policy.
$OBJ->tell_users()
Start the user interaction and wait until all expected events occurred.
Be careful, this may block the caller as long as the defined time-out, and even more on server handling a lot of user sessions.
$OBJ->stopped($condition)
Without $condition, returns true if the user interaction matched and event telling the current job has to be skipped while the user check is a 'before' type check.
For 'after' type check, it has only the meaning to not process any following 'after' user check in a list context, until only one 'after' check is really expected, this call could be avoided in that case.
If $condition is given, set _stopped private value accordingly: - 0 or 'no' : has the same effect than calling $OBJ->continue() - 1 or 'yes': defines the _stopped private value to be true. - any text: log the text as error and set _stopped private value to be true.