org.qi4j.migration
Class MigrationService.MigrationMixin

java.lang.Object
  extended by org.qi4j.migration.MigrationService.MigrationMixin
All Implemented Interfaces:
Activatable, Migration, Migrator
Enclosing interface:
MigrationService

public static class MigrationService.MigrationMixin
extends Object
implements Migration, Migrator, Activatable


Field Summary
 MigrationBuilder builder
           
 org.slf4j.Logger log
           
 
Constructor Summary
MigrationService.MigrationMixin()
           
 
Method Summary
 void activate()
          This is invoked on the service when the instance is being activated
 boolean addAssociation(JSONObject state, String name, String defaultReference)
           
 boolean addManyAssociation(JSONObject state, String name, String... defaultReferences)
           
 boolean addProperty(JSONObject state, String name, String defaultValue)
           
 void changeEntityType(JSONObject state, String newEntityType)
           
 boolean migrate(JSONObject state, String toVersion, StateStore stateStore)
           
 void passivate()
          This is invoked on the service when the instance is being passivated
 boolean removeAssociation(JSONObject state, String name)
           
 boolean removeManyAssociation(JSONObject state, String name)
           
 boolean removeProperty(JSONObject state, String name)
           
 boolean renameAssociation(JSONObject state, String from, String to)
           
 boolean renameManyAssociation(JSONObject state, String from, String to)
           
 boolean renameProperty(JSONObject state, String from, String to)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

builder

public MigrationBuilder builder

log

public org.slf4j.Logger log
Constructor Detail

MigrationService.MigrationMixin

public MigrationService.MigrationMixin()
Method Detail

migrate

public boolean migrate(JSONObject state,
                       String toVersion,
                       StateStore stateStore)
                throws JSONException
Specified by:
migrate in interface Migration
Throws:
JSONException

activate

public void activate()
              throws Exception
Description copied from interface: Activatable
This is invoked on the service when the instance is being activated

Specified by:
activate in interface Activatable
Throws:
Exception - if service could not be activated

passivate

public void passivate()
               throws Exception
Description copied from interface: Activatable
This is invoked on the service when the instance is being passivated

Specified by:
passivate in interface Activatable
Throws:
Exception - if the service could not be passivated

addProperty

public boolean addProperty(JSONObject state,
                           String name,
                           String defaultValue)
                    throws JSONException
Specified by:
addProperty in interface Migrator
Throws:
JSONException

removeProperty

public boolean removeProperty(JSONObject state,
                              String name)
                       throws JSONException
Specified by:
removeProperty in interface Migrator
Throws:
JSONException

renameProperty

public boolean renameProperty(JSONObject state,
                              String from,
                              String to)
                       throws JSONException
Specified by:
renameProperty in interface Migrator
Throws:
JSONException

addAssociation

public boolean addAssociation(JSONObject state,
                              String name,
                              String defaultReference)
                       throws JSONException
Specified by:
addAssociation in interface Migrator
Throws:
JSONException

removeAssociation

public boolean removeAssociation(JSONObject state,
                                 String name)
                          throws JSONException
Specified by:
removeAssociation in interface Migrator
Throws:
JSONException

renameAssociation

public boolean renameAssociation(JSONObject state,
                                 String from,
                                 String to)
                          throws JSONException
Specified by:
renameAssociation in interface Migrator
Throws:
JSONException

addManyAssociation

public boolean addManyAssociation(JSONObject state,
                                  String name,
                                  String... defaultReferences)
                           throws JSONException
Specified by:
addManyAssociation in interface Migrator
Throws:
JSONException

removeManyAssociation

public boolean removeManyAssociation(JSONObject state,
                                     String name)
                              throws JSONException
Specified by:
removeManyAssociation in interface Migrator
Throws:
JSONException

renameManyAssociation

public boolean renameManyAssociation(JSONObject state,
                                     String from,
                                     String to)
                              throws JSONException
Specified by:
renameManyAssociation in interface Migrator
Throws:
JSONException

changeEntityType

public void changeEntityType(JSONObject state,
                             String newEntityType)
                      throws JSONException
Specified by:
changeEntityType in interface Migrator
Throws:
JSONException