Package cmion.level2.competencies
Class Migration
- java.lang.Object
-
- ion.Meta.Element
-
- cmion.architecture.CmionComponent
-
- cmion.level2.Competency
-
- cmion.level2.competencies.Migration
-
- All Implemented Interfaces:
java.lang.Runnable
public class Migration extends Competency
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classMigration.Device
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSUCCESS_TAG-
Fields inherited from class cmion.level2.Competency
available, competencyName, competencyType, plan, running
-
Fields inherited from class cmion.architecture.CmionComponent
architecture
-
-
Constructor Summary
Constructors Constructor Description Migration(IArchitecture architecture, java.lang.String configFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMigrationData(org.w3c.dom.Element xmlElement)protected booleancompetencyCode(java.util.HashMap<java.lang.String,java.lang.String> parameters)every competency sub class must implement this method and in it perform the competency code.java.util.Set<Migration.Device>getAllDevices()java.util.Set<Migration.Device>getAvailableDevices()java.util.Map<java.lang.String,Migration.Device>getDeviceList()protected SynchronizergetNewSynchronizer(int listenPort)voidimportConfig(org.w3c.dom.Document doc)voidinitialize()custom competency initialisation code should go in herebooleanisOccupied()protected java.io.InputStreamopenConfigFile(java.lang.String configFile)This method is responsible for opening the configuration file correctly.voidregisterHandlers()registers request and event handlers of the competency execution system, if overridden, remember to call super.registerHandlers(); from withinbooleanrunsInBackground()every competency must provide information of whether it will run in the background permanently (returns true) or whether it will be invoked through the competency execution system (returns false)-
Methods inherited from class cmion.level2.Competency
cancel, getCompetencyName, getCompetencyType, isAvailable, isRunning, requestStartCompetency, run, setAdditionalData
-
Methods inherited from class cmion.architecture.CmionComponent
getArchitecture, isConnected, onDestroy, raise
-
-
-
-
Field Detail
-
SUCCESS_TAG
public static final java.lang.String SUCCESS_TAG
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Migration
public Migration(IArchitecture architecture, java.lang.String configFile)
-
-
Method Detail
-
openConfigFile
protected java.io.InputStream openConfigFile(java.lang.String configFile)
This method is responsible for opening the configuration file correctly. It should be different depending on the platform and the way it provides access to resources.- Returns:
- InputStream for the configuration file of the migration competency.
-
initialize
public void initialize()
Description copied from class:Competencycustom competency initialisation code should go in here- Specified by:
initializein classCompetency
-
getNewSynchronizer
protected Synchronizer getNewSynchronizer(int listenPort) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException
- Throws:
java.io.IOExceptionjavax.xml.parsers.ParserConfigurationException
-
registerHandlers
public final void registerHandlers()
Description copied from class:Competencyregisters request and event handlers of the competency execution system, if overridden, remember to call super.registerHandlers(); from within- Overrides:
registerHandlersin classCompetency
-
runsInBackground
public boolean runsInBackground()
Description copied from class:Competencyevery competency must provide information of whether it will run in the background permanently (returns true) or whether it will be invoked through the competency execution system (returns false)- Specified by:
runsInBackgroundin classCompetency
-
competencyCode
protected boolean competencyCode(java.util.HashMap<java.lang.String,java.lang.String> parameters)
Description copied from class:Competencyevery competency sub class must implement this method and in it perform the competency code. This method will run in a seperate thread, so can take its time. It should not be called from outside, instead a request should be scheduled or the convenience function requestStartComptency of this class should be used- Specified by:
competencyCodein classCompetency- Parameters:
parameters- a map including running parameters and their values- Returns:
- the return value of this method should indicate, whether the competency execution was a success (true) or failure (false)
-
addMigrationData
public void addMigrationData(org.w3c.dom.Element xmlElement)
-
getDeviceList
public java.util.Map<java.lang.String,Migration.Device> getDeviceList()
-
getAllDevices
public java.util.Set<Migration.Device> getAllDevices()
-
getAvailableDevices
public java.util.Set<Migration.Device> getAvailableDevices()
-
importConfig
public void importConfig(org.w3c.dom.Document doc)
-
isOccupied
public boolean isOccupied()
-
-