Class SpallocServiceImpl
java.lang.Object
uk.ac.manchester.spinnaker.alloc.web.BackgroundSupport
uk.ac.manchester.spinnaker.alloc.web.SpallocServiceImpl
- All Implemented Interfaces:
- SpallocServiceAPI
@Service("service")
@Path("spalloc")
public class SpallocServiceImpl
extends BackgroundSupport
implements SpallocServiceAPI
The implementation of the user-facing REST API. Operations are delegated to
 
SpallocAPI for fulfilment; this class is responsible for turning the
 operations described by users into the form understood by the service core,
 and for converting the responses. It also handles the transfer of calls onto
 suitable worker threads, where appropriate.- Author:
- Donal Fellows
- 
Nested Class SummaryNested classes/interfaces inherited from class uk.ac.manchester.spinnaker.alloc.web.BackgroundSupportBackgroundSupport.BackgroundActionNested classes/interfaces inherited from interface uk.ac.manchester.spinnaker.alloc.web.SpallocServiceAPISpallocServiceAPI.JobAPI, SpallocServiceAPI.MachineAPI
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcreateJob(CreateJobRequest req, jakarta.ws.rs.core.UriInfo ui, jakarta.ws.rs.core.SecurityContext security, jakarta.ws.rs.container.AsyncResponse response) Create a job.describeService(jakarta.ws.rs.core.UriInfo ui, jakarta.ws.rs.core.SecurityContext sec, jakarta.servlet.http.HttpServletRequest req) Get a description of the overall service.voidemergencyStop(String commandCode, jakarta.ws.rs.container.AsyncResponse response) Immediately stop all jobs and power down all boards.getJob(int id, jakarta.ws.rs.core.UriInfo ui, jakarta.servlet.http.HttpServletRequest req, jakarta.ws.rs.core.SecurityContext security) Get a sub-resource for managing a job.getMachine(String name, jakarta.ws.rs.core.UriInfo ui, jakarta.ws.rs.core.SecurityContext sec) Get a sub-resource for managing a machine.getMachines(jakarta.ws.rs.core.UriInfo ui) Get a description of the machines.voidlistJobs(boolean wait, boolean destroyed, int limit, int start, jakarta.ws.rs.core.UriInfo ui, jakarta.ws.rs.container.AsyncResponse response) List jobs.Methods inherited from class uk.ac.manchester.spinnaker.alloc.web.BackgroundSupportbgAction, bgAction, fgAction
- 
Constructor Details- 
SpallocServiceImplpublic SpallocServiceImpl()
 
- 
- 
Method Details- 
describeServicepublic ServiceDescription describeService(jakarta.ws.rs.core.UriInfo ui, jakarta.ws.rs.core.SecurityContext sec, jakarta.servlet.http.HttpServletRequest req) Description copied from interface:SpallocServiceAPIGet a description of the overall service.- Specified by:
- describeServicein interface- SpallocServiceAPI
- Parameters:
- ui- How to build URIs
- sec- What are the user's identity and granted permissions?
- req- Details about the request, used to extract the CSRF token.
- Returns:
- A wrapped ServiceDescription
 
- 
getMachinesDescription copied from interface:SpallocServiceAPIGet a description of the machines.- Specified by:
- getMachinesin interface- SpallocServiceAPI
- Parameters:
- ui- How to build URIs
- Returns:
- A list of machines
 
- 
getMachinepublic SpallocServiceAPI.MachineAPI getMachine(String name, jakarta.ws.rs.core.UriInfo ui, jakarta.ws.rs.core.SecurityContext sec) Description copied from interface:SpallocServiceAPIGet a sub-resource for managing a machine.- Specified by:
- getMachinein interface- SpallocServiceAPI
- Parameters:
- name- The name of the machine
- ui- How to build URIs
- sec- What are the user's identity and granted permissions?
- Returns:
- The sub-resource
 
- 
getJobpublic SpallocServiceAPI.JobAPI getJob(int id, jakarta.ws.rs.core.UriInfo ui, jakarta.servlet.http.HttpServletRequest req, jakarta.ws.rs.core.SecurityContext security) Description copied from interface:SpallocServiceAPIGet a sub-resource for managing a job.- Specified by:
- getJobin interface- SpallocServiceAPI
- Parameters:
- id- The ID of the job
- ui- How to build URIs
- req- Information about the request
- security- Information about the user
- Returns:
- The sub-resource
 
- 
listJobspublic void listJobs(boolean wait, boolean destroyed, int limit, int start, jakarta.ws.rs.core.UriInfo ui, jakarta.ws.rs.container.AsyncResponse response) Description copied from interface:SpallocServiceAPIList jobs.- Specified by:
- listJobsin interface- SpallocServiceAPI
- Parameters:
- wait- Whether we are waiting for a change with a long query
- destroyed- Whether to include destroyed jobs
- limit- Paging support: how many values to bring back
- start- Paging support: where in the sequence to start
- ui- How to build URIs
- response- Filled out with a- ListJobsResponse
 
- 
createJobpublic void createJob(CreateJobRequest req, jakarta.ws.rs.core.UriInfo ui, jakarta.ws.rs.core.SecurityContext security, jakarta.ws.rs.container.AsyncResponse response) Description copied from interface:SpallocServiceAPICreate a job.- Specified by:
- createJobin interface- SpallocServiceAPI
- Parameters:
- req- Description of what to create
- ui- How to build URIs
- security- Information about the user
- response- Filled out with a- CreateJobResponse
 
- 
emergencyStopDescription copied from interface:SpallocServiceAPIImmediately stop all jobs and power down all boards.- Specified by:
- emergencyStopin interface- SpallocServiceAPI
 
 
-