Class JobRequestMetadata
- java.lang.Object
-
- com.netflix.genie.common.internal.dtos.JobRequestMetadata
-
- All Implemented Interfaces:
java.io.Serializable
public class JobRequestMetadata extends java.lang.Object implements java.io.Serializable
Metadata gathered by the system as part of anyJobRequest
.- Since:
- 4.0.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JobRequestMetadata(ApiClientMetadata apiClientMetadata, AgentClientMetadata agentClientMetadata, int numAttachments, long totalSizeOfAttachments, java.util.Map<java.lang.String,java.lang.String> requestHeaders)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<AgentClientMetadata>
getAgentClientMetadata()
If the job request was sent via the Agent this field will be populated.java.util.Optional<ApiClientMetadata>
getApiClientMetadata()
If the job request was sent via API this field will be populated.
-
-
-
Constructor Detail
-
JobRequestMetadata
public JobRequestMetadata(@Nullable ApiClientMetadata apiClientMetadata, @Nullable AgentClientMetadata agentClientMetadata, int numAttachments, long totalSizeOfAttachments, @Nullable java.util.Map<java.lang.String,java.lang.String> requestHeaders) throws java.lang.IllegalArgumentException
Constructor. One of apiClientMetadata or agentClientMetadata is required. Both cannot be present.- Parameters:
apiClientMetadata
- The metadata about the client if this request was received via APIagentClientMetadata
- The metadata about the client if this request was received from the AgentnumAttachments
- The number of attachments that came with this job requesttotalSizeOfAttachments
- The total size of the attachments that came with this job requestrequestHeaders
- The map of HTTP headers (filtered upstream) if this request was received via API- Throws:
java.lang.IllegalArgumentException
- If both apiClientMetadata and agentClientMetadata are missing or both are present
-
-
Method Detail
-
getApiClientMetadata
public java.util.Optional<ApiClientMetadata> getApiClientMetadata()
If the job request was sent via API this field will be populated.- Returns:
- The API client metadata wrapped in an
Optional
-
getAgentClientMetadata
public java.util.Optional<AgentClientMetadata> getAgentClientMetadata()
If the job request was sent via the Agent this field will be populated.- Returns:
- The Agent client metadata wrapped in an
Optional
-
-