Interface JsonJOSEObjectBuilder<A,B extends JsonJOSEObject<A>,C extends JOSEHeaderConfigurator<C>,D extends JsonJOSEObjectBuilder<A,B,C,D>>
- Type Parameters:
A
- the payload typeB
- the JSON JOSE object typeC
- the JOSE header configurator typeD
- the JSON JOSE object builder type
- All Known Subinterfaces:
JsonJWEBuilder<A,
,B, C> JsonJWSBuilder<A,
B, C>
A JSON JOSE object builder is used to build JSON JOSE objects that can be serialized to the JSON representation.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the JSON JOSE object.Builds the JSON JOSE object using the specified payload media type.Builds the JSON JOSE object using the specified payload encoder.Specifies the common protected and unprotected headers.Specifies the payload.
-
Method Details
-
headers
Specifies the common protected and unprotected headers.
The payload is common and as a result it is recommended to specify the payload content type in the common headers.
- Parameters:
protectedHeaderConfigurer
- the protected JOSE header configurerunprotectedHeaderConfigurer
- the unprotected JOSE header configurer- Returns:
- this builder
-
payload
Specifies the payload.
- Parameters:
payload
- the payload- Returns:
- this builder
-
build
Builds the JSON JOSE object.
The builder will rely on the payload media type specified in the JOSE headers to determine how to serialize the payload. The operation will fail if it is not able to determine the media type converter to use. Please consider other build methods
build(java.lang.String)
andbuild(java.util.function.Function)
to explicitly specifies how the payload should be serialized.- Returns:
- a single JSON JOSE object publisher
- Throws:
JOSEObjectBuildException
- if there was an error building the JSON JOSE objectJOSEProcessingException
- if there was a JOSE processing error
-
build
Builds the JSON JOSE object using the specified payload media type.
The builder will use the specified media type to determine the converter to use to serialize the payload and ignore the content type specified in the JOSE headers. The operation will fail if there is no media type converters defined for that particular media type. Media types converters are provided when building the JOSE module. Please consider build method
build(java.util.function.Function)
to provide a custom payload encoder.- Parameters:
contentType
- the payload media type- Returns:
- a single JSON JOSE object publisher
- Throws:
JOSEObjectBuildException
- if there was an error building the JSON JOSE objectJOSEProcessingException
- if there was a JOSE processing error
-
build
Mono<B> build(Function<A, Mono<String>> payloadEncoder) throws JOSEObjectBuildException, JOSEProcessingExceptionBuilds the JSON JOSE object using the specified payload encoder.
The builder will use the specified payload encoder to serialize the payload and ignore the content type specified in the JOSE headers.
- Parameters:
payloadEncoder
- a payload encoder- Returns:
- a single JSON JOSE object publisher
- Throws:
JOSEObjectBuildException
- if there was an error building the JSON JOSE objectJOSEProcessingException
- if there was a JOSE processing error
-