public Action fromJSON ( JSONObject in ) throws JSONConverterException { String id = requiredString ( in , ACTION_ID_LABEL ) ; Action a ; switch ( id ) { case "bootVM" : a = bootVMFromJSON ( in ) ; break ; case "shutdownVM" : a = shutdownVMFromJSON ( in ) ; break ; case "shutdownNode" : a = shutdownNodeFromJSON ( in ) ; break ; case "bootNode" : a = bootNodeFromJSON ( in ) ; break ; case "forgeVM" : a = forgeVMFromJSON ( in ) ; break ; case "killVM" : a = killVMFromJSON ( in ) ; break ; case "migrateVM" : a = migrateVMFromJSON ( in ) ; break ; case "resumeVM" : a = resumeVMFromJSON ( in ) ; break ; case "suspendVM" : a = suspendVMFromJSON ( in ) ; break ; case RC_ALLOCATE_LABEL : a = allocateFromJSON ( in ) ; break ; default : throw new JSONConverterException ( "Unsupported action '" + id + "'" ) ; } attachEvents ( a , in ) ; return a ; }
decode a json - encoded action .