Package dev.le_app.mcss_api_java
Class Job
java.lang.Object
dev.le_app.mcss_api_java.Job
- Direct Known Subclasses:
BackupJob,RunCommandsJob,ServerActionJob
Represents a job.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ServerActionGet the action of the task.abstract StringGet the Backup ID of the backup executed by the taskGet the commands of the task.abstract JobsetAction(ServerAction action) Set the new action to executeabstract JobsetBackupGUID(String backupGUID) Set the new backup to executeabstract JobsetCommands(String... commands) Set the new commands to execute
-
Constructor Details
-
Job
public Job()
-
-
Method Details
-
getAction
public abstract ServerAction getAction() throws APIUnauthorizedException, APINotFoundException, IOException, APIInvalidTaskDetailsExceptionGet the action of the task.- Returns:
- The action 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.
-
getCommands
public abstract ArrayList<String> getCommands() throws APIUnauthorizedException, APINotFoundException, IOException, APIInvalidTaskDetailsExceptionGet the commands of the task.- 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
public abstract String getBackupGUID() throws APIUnauthorizedException, APINotFoundException, IOExceptionGet the Backup ID of the backup executed by the task- Returns:
- The Backup ID of the backup executed by 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).
-
setAction
public abstract Job setAction(ServerAction action) throws APIUnauthorizedException, APINotFoundException, APIInvalidTaskDetailsException, IOException Set the new action to execute- Parameters:
action- The new action 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).
-
setCommands
public abstract Job setCommands(String... commands) throws APIUnauthorizedException, APINotFoundException, APIInvalidTaskDetailsException, IOException Set the new commands to execute- 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
public abstract Job setBackupGUID(String backupGUID) throws APIUnauthorizedException, APINotFoundException, IOException, APIInvalidTaskDetailsException Set the new backup to execute- Parameters:
backupGUID- The new backup 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).
-