Package org.btrplace.json.plan
Class AllocateConverter
java.lang.Object
org.btrplace.json.plan.AllocateConverter
- All Implemented Interfaces:
ActionConverter<Allocate>
public class AllocateConverter extends Object implements ActionConverter<Allocate>
JSON serialisation for
Allocate
actions.-
Field Summary
Fields inherited from interface org.btrplace.json.plan.ActionConverter
END_LABEL, ID_LABEL, NODE_LABEL, ON_LABEL, RC_AMOUNT_LABEL, RC_LABEL, START_LABEL, VM_DESTINATION_LABEL, VM_LABEL, VM_LOCATION_LABEL
-
Constructor Summary
Constructors Constructor Description AllocateConverter()
-
Method Summary
Modifier and Type Method Description void
fillJSON(Allocate ac, net.minidev.json.JSONObject ob)
Fill the JSON skeleton that will represent this action.Allocate
fromJSON(Model mo, net.minidev.json.JSONObject ob)
Create an action from a JSON Object.String
id()
The JSON identifier for the action.Class<Allocate>
supportedAction()
The action that is supported by this converter.
-
Constructor Details
-
AllocateConverter
public AllocateConverter()
-
-
Method Details
-
id
Description copied from interface:ActionConverter
The JSON identifier for the action.- Specified by:
id
in interfaceActionConverter<Allocate>
- Returns:
- a String that will be written inside the field
ActionConverter.ID_LABEL
-
supportedAction
Description copied from interface:ActionConverter
The action that is supported by this converter.- Specified by:
supportedAction
in interfaceActionConverter<Allocate>
- Returns:
- the action class.
-
fillJSON
Description copied from interface:ActionConverter
Fill the JSON skeleton that will represent this action. The events will be added in a later stage.- Specified by:
fillJSON
in interfaceActionConverter<Allocate>
- Parameters:
ac
- the action.ob
- the object to fill.
-
fromJSON
Description copied from interface:ActionConverter
Create an action from a JSON Object. The events attached to the hooks will be parsed in a later stage.- Specified by:
fromJSON
in interfaceActionConverter<Allocate>
- Parameters:
mo
- the model to use to parse elements.ob
- the object to convert- Returns:
- the resulting action.
- Throws:
JSONConverterException
- if the conversion failed.
-