public class DefaultJobRowBuilder extends Object implements JobRowBuilder
DefaultJobField
.Constructor and Description |
---|
DefaultJobRowBuilder(Function<Map<JobField,String>,String> idGenerator)
Builds a factory for generating JobRows containing values for every
DefaultJobField . |
DefaultJobRowBuilder(Function<Map<JobField,String>,String> idGenerator,
Function<javax.ws.rs.core.SecurityContext,String> userIdExtractor,
Clock timestampGenerator)
Builds a factory for generating JobRows with a custom function for extracting a userid from a request's
SecurityContext.
|
Modifier and Type | Method and Description |
---|---|
JobRow |
buildJobRow(javax.ws.rs.core.UriInfo request,
javax.ws.rs.container.ContainerRequestContext requestContext)
Builds a JobRow with values for every field defined in
DefaultJobField . |
public DefaultJobRowBuilder(Function<Map<JobField,String>,String> idGenerator, Function<javax.ws.rs.core.SecurityContext,String> userIdExtractor, Clock timestampGenerator)
idGenerator
- A function that takes all the job metadata except for the job's id and generates a globally
unique iduserIdExtractor
- A function that given a SecurityContext, returns the id of the user who made the requesttimestampGenerator
- The clock to use to generate timestampspublic DefaultJobRowBuilder(Function<Map<JobField,String>,String> idGenerator)
DefaultJobField
.
The user id is extracted from the UserPrincipal of a request's SecurityContext, and timestamps are generated from the System clock.
idGenerator
- A function that takes all the job metadata except for the job's id, and returns a globally
unique id for the jobpublic JobRow buildJobRow(javax.ws.rs.core.UriInfo request, javax.ws.rs.container.ContainerRequestContext requestContext)
DefaultJobField
.buildJobRow
in interface JobRowBuilder
request
- The request that is triggering this jobrequestContext
- The context of the request triggering this jobCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.