Class SqlUpgradeAction
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.migration.action.impl.SqlUpgradeAction
-
- All Implemented Interfaces:
Action
,LogEnabled
,Serviceable
- Direct Known Subclasses:
SqlInitializationAction
public class SqlUpgradeAction extends AbstractLogEnabled implements Action, Serviceable
SQL action: A script will be executed
-
-
Field Summary
Fields Modifier and Type Field Description protected SourceResolver
_sourceResolver
Source resolver
-
Constructor Summary
Constructors Constructor Description SqlUpgradeAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_upgrade(SqlUpgradeActionData sqlUpgradeData, SqlVersion sqlVersion)
Do the upgrade with the right objectsvoid
doAction(ActionData actionData)
Run the action with the provided dataActionData
generateActionData(String versionNumber, Version version, String comment, String from, String type, String pluginName, Configuration configuration)
Generate anActionData
linked to this kind of actionvoid
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_sourceResolver
protected SourceResolver _sourceResolver
Source resolver
-
-
Constructor Detail
-
SqlUpgradeAction
public SqlUpgradeAction()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
doAction
public void doAction(ActionData actionData) throws MigrationException
Description copied from interface:Action
Run the action with the provided data- Specified by:
doAction
in interfaceAction
- Parameters:
actionData
- data needed to do the action (contains the version)- Throws:
MigrationException
- Something went wrong
-
_upgrade
protected void _upgrade(SqlUpgradeActionData sqlUpgradeData, SqlVersion sqlVersion) throws MigrationException
Do the upgrade with the right objects- Parameters:
sqlUpgradeData
- upgrade datasqlVersion
- version- Throws:
MigrationException
- Something went wrong
-
generateActionData
public ActionData generateActionData(String versionNumber, Version version, String comment, String from, String type, String pluginName, Configuration configuration) throws MigrationException, ConfigurationException
Description copied from interface:Action
Generate anActionData
linked to this kind of action- Specified by:
generateActionData
in interfaceAction
- Parameters:
versionNumber
- id of the actionversion
- original versioncomment
- Comment about this actionfrom
- if this actions is the equivalent of multiple actions, this is the version id just before the 1st action impacted by this actiontype
- type of actionpluginName
- name of the pluginconfiguration
- configuration of the action- Returns:
- a
ActionData
for this type of action - Throws:
MigrationException
- Something went wrongConfigurationException
- Configuration malformed
-
-