Class JobServiceProtoConverter
java.lang.Object
com.netflix.genie.common.internal.dtos.converters.JobServiceProtoConverter
Converter of proto messages for the 
JobServiceGrpc.JobServiceImplBase service to
 and from V4 DTO POJO's.- Since:
- 4.0.0
- See Also:
- 
- com.netflix.genie.common.internal.dtos
- com.netflix.genie.proto
 
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiontoAgentClientMetadataDto(com.netflix.genie.proto.AgentMetadata agentMetadata) Convert a protoAgentMetadatato anAgentClientMetadata.com.netflix.genie.proto.ChangeJobArchiveStatusRequesttoChangeJobStatusArchiveRequestProto(String jobId, ArchiveStatus archiveStatus) Creates a request to change the remote job archive status.com.netflix.genie.proto.ChangeJobStatusRequesttoChangeJobStatusRequestProto(@NotBlank String jobId, JobStatus currentJobStatus, JobStatus newJobStatus, String message) Convert parameters into ChangeJobStatusRequest for the server.com.netflix.genie.proto.ClaimJobRequesttoClaimJobRequestProto(String jobId, AgentClientMetadata agentClientMetadata) Convert agent metadata and job id into a ClaimJobRequest for the server.com.netflix.genie.proto.ConfigureRequesttoConfigureRequestProto(AgentClientMetadata agentClientMetadata) Convert parameters into ConfigureRequest for the server.com.netflix.genie.proto.DryRunJobSpecificationRequesttoDryRunJobSpecificationRequestProto(AgentJobRequest jobRequest) Convert a V4 Job Request DTO into a gRPC dry run resolve job specification request to be sent to the server.com.netflix.genie.proto.GetJobStatusRequesttoGetJobStatusRequestProto(String jobId) Creates a request to fetch the job status currently seen by the server.com.netflix.genie.proto.HandshakeRequesttoHandshakeRequestProto(AgentClientMetadata agentClientMetadata) Convert parameters into HandshakeRequest for the server.toJobRequestDto(com.netflix.genie.proto.DryRunJobSpecificationRequest request) Convert a gRPC request to dry run a job specification resolution into aJobRequestfor use within Genie server codebase.toJobRequestDto(com.netflix.genie.proto.ReserveJobIdRequest request) Convert a gRPC reserve job id request into a V4 Job Request DTO for use within Genie codebase.toJobSpecificationDto(com.netflix.genie.proto.JobSpecification protoSpec) Convert a response from server into a Job Specification DTO which can be used in the codebase free of gRPC.com.netflix.genie.proto.JobSpecificationtoJobSpecificationProto(JobSpecification jobSpecification) Convert a Job Specification DTO to a protobuf message representation.com.netflix.genie.proto.JobSpecificationRequestGenerate aJobSpecificationRequestfrom the given job id.com.netflix.genie.proto.JobSpecificationResponsetoJobSpecificationResponseProto(JobSpecification jobSpecification) Build aJobSpecificationResponseout of the givenJobSpecification.com.netflix.genie.proto.ReserveJobIdRequesttoReserveJobIdRequestProto(AgentJobRequest jobRequest, AgentClientMetadata agentClientMetadata) Convert a V4 Job Request DTO into a gRPC reserve job id request to be sent to the server.
- 
Constructor Details- 
JobServiceProtoConverterpublic JobServiceProtoConverter()
 
- 
- 
Method Details- 
toReserveJobIdRequestProtopublic com.netflix.genie.proto.ReserveJobIdRequest toReserveJobIdRequestProto(AgentJobRequest jobRequest, AgentClientMetadata agentClientMetadata) throws GenieConversionException Convert a V4 Job Request DTO into a gRPC reserve job id request to be sent to the server.- Parameters:
- jobRequest- The job request to convert
- agentClientMetadata- The metadata about the agent
- Returns:
- The request that should be sent to the server for a new Job Specification given the parameters
- Throws:
- GenieConversionException- if conversion fails
 
- 
toJobSpecificationRequestProtoGenerate aJobSpecificationRequestfrom the given job id.- Parameters:
- id- The job id to generate the request for
- Returns:
- The request instance
 
- 
toJobRequestDtopublic JobRequest toJobRequestDto(com.netflix.genie.proto.ReserveJobIdRequest request) throws GenieConversionException Convert a gRPC reserve job id request into a V4 Job Request DTO for use within Genie codebase.- Parameters:
- request- The request to convert
- Returns:
- The job request
- Throws:
- GenieConversionException- if conversion fails
 
- 
toDryRunJobSpecificationRequestProtopublic com.netflix.genie.proto.DryRunJobSpecificationRequest toDryRunJobSpecificationRequestProto(AgentJobRequest jobRequest) throws GenieConversionException Convert a V4 Job Request DTO into a gRPC dry run resolve job specification request to be sent to the server.- Parameters:
- jobRequest- The job request to convert
- Returns:
- The request that should be sent to the server for a new Job Specification given the parameters
- Throws:
- GenieConversionException- if conversion fails
 
- 
toJobRequestDtopublic JobRequest toJobRequestDto(com.netflix.genie.proto.DryRunJobSpecificationRequest request) throws GenieConversionException Convert a gRPC request to dry run a job specification resolution into aJobRequestfor use within Genie server codebase.- Parameters:
- request- The request to convert
- Returns:
- The job request
- Throws:
- GenieConversionException- if conversion fails
 
- 
toAgentClientMetadataDtopublic AgentClientMetadata toAgentClientMetadataDto(com.netflix.genie.proto.AgentMetadata agentMetadata) Convert a protoAgentMetadatato anAgentClientMetadata.- Parameters:
- agentMetadata- The metadata to convert
- Returns:
- The immutable DTO representation
 
- 
toJobSpecificationResponseProtopublic com.netflix.genie.proto.JobSpecificationResponse toJobSpecificationResponseProto(JobSpecification jobSpecification) Build aJobSpecificationResponseout of the givenJobSpecification.- Parameters:
- jobSpecification- The job specification to serialize
- Returns:
- The response instance
 
- 
toJobSpecificationDtoConvert a response from server into a Job Specification DTO which can be used in the codebase free of gRPC.- Parameters:
- protoSpec- The protobuf specification message
- Returns:
- A job specification DTO
 
- 
toJobSpecificationProtopublic com.netflix.genie.proto.JobSpecification toJobSpecificationProto(JobSpecification jobSpecification) Convert a Job Specification DTO to a protobuf message representation.- Parameters:
- jobSpecification- The- JobSpecificationto convert
- Returns:
- A JobSpecificationinstance
 
- 
toClaimJobRequestProtopublic com.netflix.genie.proto.ClaimJobRequest toClaimJobRequestProto(String jobId, AgentClientMetadata agentClientMetadata) Convert agent metadata and job id into a ClaimJobRequest for the server.- Parameters:
- jobId- job id
- agentClientMetadata- agent metadata
- Returns:
- a ClaimJobRequest
 
- 
toChangeJobStatusRequestProtopublic com.netflix.genie.proto.ChangeJobStatusRequest toChangeJobStatusRequestProto(@NotBlank @NotBlank String jobId, JobStatus currentJobStatus, JobStatus newJobStatus, @Nullable String message) Convert parameters into ChangeJobStatusRequest for the server.- Parameters:
- jobId- job id
- currentJobStatus- the expected current status on the server
- newJobStatus- the new current status for this job
- message- an optional message to record with the state change
- Returns:
- a ChangeJobStatusRequest
 
- 
toHandshakeRequestProtopublic com.netflix.genie.proto.HandshakeRequest toHandshakeRequestProto(AgentClientMetadata agentClientMetadata) throws GenieConversionException Convert parameters into HandshakeRequest for the server.- Parameters:
- agentClientMetadata- agent client metadata
- Returns:
- a HandshakeRequest
- Throws:
- GenieConversionException- if the inputs are invalid
 
- 
toConfigureRequestProtopublic com.netflix.genie.proto.ConfigureRequest toConfigureRequestProto(AgentClientMetadata agentClientMetadata) throws GenieConversionException Convert parameters into ConfigureRequest for the server.- Parameters:
- agentClientMetadata- agent client metadata
- Returns:
- a ConfigureRequest
- Throws:
- GenieConversionException- if the inputs are invalid
 
- 
toGetJobStatusRequestProtoCreates a request to fetch the job status currently seen by the server.- Parameters:
- jobId- the job id
- Returns:
- A GetJobStatusRequestmessage instance
 
- 
toChangeJobStatusArchiveRequestProtopublic com.netflix.genie.proto.ChangeJobArchiveStatusRequest toChangeJobStatusArchiveRequestProto(String jobId, ArchiveStatus archiveStatus) Creates a request to change the remote job archive status.- Parameters:
- jobId- the job id
- archiveStatus- the new archive status
- Returns:
- a ChangeJobArchiveStatusRequestmessage instance
 
 
-