BOALifeCycle Manager¶
Lifecycle manager.
This file contains the class BOALifeCycleManager, which handles the loop which is executed to analyze the language file.
- class lifecycles.boalc_manager.BOALifeCycleManager(instances, reports, lifecycle_args, lifecycle_instances, analysis)¶
BOALifeCycleManager class.
This class handles the modules intances. Concretely, it initializes the instances, iterates the processing throught them, and save the report records.
The steps which are followed depends on the lifecycle being used by a concrete module.
- __init__(instances, reports, lifecycle_args, lifecycle_instances, analysis)¶
It initializes all the variables which will be used by the other methods.
- Parameters
instances (list) – module instances that are going to be saved.
reports (list) – list of Report instances.
lifecycle_args (dict) – args to be used by the lifecycles.
lifecycle_instances (list) – instances of lifecycles to be used by the instances.
analysis (str) – information about which analysis we are running.
- __weakref__¶
list of weak references to the object (if defined)
- execute_instance_method(instance, method_name, args, force_invocation)¶
It attempts to execute a method of a concrete instance.
- Parameters
instance – initialized instance which a method is going to be invoked if possible.
method_name (str) – method which is going to be invoked.
args – args to be given to the invoked method.
force_invocation (bool) – force a method invocation despite something failed in the past (if False, when a failure happens, a method will not be invoked).
- Returns
it will return False if: the instance is not in self.instances, the property stop is True, … It will return True only if the execution of the given method could be executed without any exception.
- Return type
bool
- get_final_report()¶
It returns the final report.
- Returns
the final report
- Return type
Report
- handle_lifecycle()¶
This method is the one which should be invoked to handle the lifecycle.
The way the phases are invoked depends on the lifecycle.
The method that will be invoked is execute_lifecycle, which is defined in BOALifeCycleAbstract class. In that method should be defined the phases that are going to be called.
- Returns
self.rtn_code
- Return type
int
- make_final_report()¶
It makes a report which contains all the threat records contained in all the other reports.
- Returns
the final report or None
- Return type
Report