Package dev.le_app.mcss_api_java
Class ServerActionJob
java.lang.Object
dev.le_app.mcss_api_java.Job
dev.le_app.mcss_api_java.ServerActionJob
Represents a job.
-
Constructor Summary
ConstructorsConstructorDescriptionServerActionJob(MCSSApi api, String GUID, String TaskID) Create a new ServerActionJob. -
Method Summary
Modifier and TypeMethodDescriptionGet the action of the job.Get the Backup ID of the backup executed by the taskGet the commands of the task.setAction(ServerAction action) The action to be performed on the server.setBackupGUID(String backupGUID) Set the new backup to executesetCommands(String... commands) Set the new commands to execute
-
Constructor Details
-
ServerActionJob
Create a new ServerActionJob.- Parameters:
api- The API instance.GUID- The GUID of the server.TaskID- The ID of the task.
-
-
Method Details
-
getAction
public ServerAction getAction() throws APIUnauthorizedException, APINotFoundException, IOException, APIInvalidTaskDetailsExceptionGet the action of the job.- Specified by:
getActionin classJob- Returns:
- The action of the job.
- Throws:
APIUnauthorizedException- If the API key is not valid.APINotFoundException- If the server is not found.IOException- If there is an IO error (e.g. server is offline).APIInvalidTaskDetailsException- If the task is not found.
-
getCommands
public ArrayList<String> getCommands() throws APIUnauthorizedException, APINotFoundException, IOException, APIInvalidTaskDetailsExceptionDescription copied from class:JobGet the commands of the task.- Specified by:
getCommandsin classJob- Returns:
- The commands of the task.
- Throws:
APIUnauthorizedException- If the API key is not valid.APINotFoundException- If the server is not found.IOException- If there is an IO error (e.g. server is offline).APIInvalidTaskDetailsException- If the task details are invalid.
-
getBackupGUID
Description copied from class:JobGet the Backup ID of the backup executed by the task- Specified by:
getBackupGUIDin classJob- Returns:
- The Backup ID of the backup executed by the task
-
setAction
public Job setAction(ServerAction action) throws APIUnauthorizedException, APINotFoundException, APIInvalidTaskDetailsException, IOException The action to be performed on the server.- Specified by:
setActionin classJob- Parameters:
action- the action to be performed on the server.- Returns:
- this.Job (used for concatenating)
- Throws:
APIUnauthorizedException- If the API key is not valid.APINotFoundException- If the server is not found.IOException- If there is an IO error (e.g. server is offline).APIInvalidTaskDetailsException- If the task is not found.
-
setCommands
public Job setCommands(String... commands) throws APIUnauthorizedException, APINotFoundException, APIInvalidTaskDetailsException, IOException Description copied from class:JobSet the new commands to execute- Specified by:
setCommandsin classJob- Parameters:
commands- The new commands to execute- Returns:
- this.Job (used for concatenating)
- Throws:
APIUnauthorizedException- If the API key is not valid.APINotFoundException- If the server is not found.APIInvalidTaskDetailsException- If the task details are invalid.IOException- If there is an IO error (e.g. server is offline).
-
setBackupGUID
Description copied from class:JobSet the new backup to execute- Specified by:
setBackupGUIDin classJob- Parameters:
backupGUID- The new backup to execute- Returns:
- this.Job (used for concatenating)
-