Package org.dspace.storage.rdbms
Class SiteServiceInitializer
- java.lang.Object
-
- org.dspace.storage.rdbms.SiteServiceInitializer
-
- All Implemented Interfaces:
org.flywaydb.core.api.callback.Callback
public class SiteServiceInitializer extends Object implements org.flywaydb.core.api.callback.Callback
Callback method to ensure that the Site object is created (if no site exists) after the database migration completes.- Author:
- kevinvandevelde at atmire.com
-
-
Field Summary
Fields Modifier and Type Field Description protected SiteServicesiteService
-
Constructor Summary
Constructors Constructor Description SiteServiceInitializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanHandleInTransaction(org.flywaydb.core.api.callback.Event event, org.flywaydb.core.api.callback.Context context)Whether event can be handled in a transaction or whether it must be handle outside of transaction.voidhandle(org.flywaydb.core.api.callback.Event event, org.flywaydb.core.api.callback.Context context)What to run when the callback is triggered.voidinitializeSiteObject()booleansupports(org.flywaydb.core.api.callback.Event event, org.flywaydb.core.api.callback.Context context)Events supported by this callback.
-
-
-
Field Detail
-
siteService
@Autowired(required=true) protected SiteService siteService
-
-
Method Detail
-
initializeSiteObject
public void initializeSiteObject()
-
supports
public boolean supports(org.flywaydb.core.api.callback.Event event, org.flywaydb.core.api.callback.Context context)Events supported by this callback.- Specified by:
supportsin interfaceorg.flywaydb.core.api.callback.Callback- Parameters:
event- Flyway eventcontext- Flyway context- Returns:
- true if AFTER_MIGRATE event
-
canHandleInTransaction
public boolean canHandleInTransaction(org.flywaydb.core.api.callback.Event event, org.flywaydb.core.api.callback.Context context)Whether event can be handled in a transaction or whether it must be handle outside of transaction.- Specified by:
canHandleInTransactionin interfaceorg.flywaydb.core.api.callback.Callback- Parameters:
event- Flyway eventcontext- Flyway context- Returns:
- true
-
handle
public void handle(org.flywaydb.core.api.callback.Event event, org.flywaydb.core.api.callback.Context context)What to run when the callback is triggered.- Specified by:
handlein interfaceorg.flywaydb.core.api.callback.Callback- Parameters:
event- Flyway eventcontext- Flyway context
-
-