@Service
public class TaskHandler
extends java.lang.Object
| Constructor and Description |
|---|
TaskHandler(ConfigurationHandler injectedConfigurationHandler,
ServerPackHandler injectedServerPackHandler,
ServerPackService injectedServerPackService,
TaskSubmitter injectedTaskSubmitter,
ApplicationProperties injectedApplicationProperties)
Constructor responsible for our DI.
|
| Modifier and Type | Method and Description |
|---|---|
void |
handleGeneration(Task task)
JmsListener listening to the destination tasks.background and selector type = 'generation', so only task
that match the generation-type are worked with in this method.If a task is received that matches this type, the generation of a new server pack is started. |
void |
handleScan(Task task)
JmsListener listening to the destination tasks.background and selector type = 'scan', so only task
that match the scan-type are worked with in this method.If a task is received that matches this type, the CurseForge project and file ID of said task is checked for validity. |
@Autowired public TaskHandler(ConfigurationHandler injectedConfigurationHandler, ServerPackHandler injectedServerPackHandler, ServerPackService injectedServerPackService, TaskSubmitter injectedTaskSubmitter, ApplicationProperties injectedApplicationProperties)
injectedConfigurationHandler - Instance of ConfigurationHandler.injectedServerPackHandler - Instance of ServerPackHandler.injectedServerPackService - Instance of ServerPackService.injectedTaskSubmitter - Instance of TaskSubmitter.injectedApplicationProperties - Instance of ApplicationProperties.@JmsListener(destination="tasks.background",
selector="type = \'scan\'")
public void handleScan(Task task)
JmsListener listening to the destination tasks.background and selector type = 'scan', so only task
that match the scan-type are worked with in this method.Generating and lastModified is bigger than 30 minutes.
In either case, a GenerateCurseProject-task is sent which will then generate a server pack from the CurseForge project
and file ID combination.task - The task for which to check the CurseForge project and file ID, as well as status.@JmsListener(destination="tasks.background",
selector="type = \'generation\'")
public void handleGeneration(Task task)
JmsListener listening to the destination tasks.background and selector type = 'generation', so only task
that match the generation-type are worked with in this method.task - The task with which to generate a server pack from a CurseForge project and file ID.