Module io.inverno.mod.http.base
Class AuthorizationCodec
java.lang.Object
io.inverno.mod.http.base.internal.header.AuthorizationCodec
- All Implemented Interfaces:
HeaderCodec<AuthorizationCodec.Authorization>
public class AuthorizationCodec
extends Object
implements HeaderCodec<AuthorizationCodec.Authorization>
Authorization HTTP HeaderCodec implementation.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Nested Class Summary
Nested Classes -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an authorization header codec.AuthorizationCodec(Set<String> tokenExpectedSchemes) Creates an authorization header codec with the specified expected schemes. -
Method Summary
Modifier and TypeMethodDescriptionDecodes the specified raw valueByteBuffor the specified header name using the specified charset.Decodes the specified raw header value for the specified header name.Encodes the specified header as a string.Encodes the value of the specified header as a string.Returns a list of header names supported by the codec.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.inverno.mod.http.base.header.HeaderCodec
encode, encodeValue
-
Constructor Details
-
AuthorizationCodec
public AuthorizationCodec()Creates an authorization header codec.
-
AuthorizationCodec
Creates an authorization header codec with the specified expected schemes.
- Parameters:
tokenExpectedSchemes- a set of authorization schemes
-
-
Method Details
-
decode
Description copied from interface:HeaderCodecDecodes the specified raw header value for the specified header name.
- Specified by:
decodein interfaceHeaderCodec<AuthorizationCodec.Authorization>- Parameters:
name- a header namevalue- a header raw value- Returns:
- a decoded header instance
-
decode
public AuthorizationCodec.Authorization decode(String name, io.netty.buffer.ByteBuf buffer, Charset charset) Description copied from interface:HeaderCodecDecodes the specified raw value
ByteBuffor the specified header name using the specified charset.- Specified by:
decodein interfaceHeaderCodec<AuthorizationCodec.Authorization>- Parameters:
name- a header namebuffer- a header raw valuecharset- the charset to use for decoding- Returns:
- a decoded header instance
-
encode
Description copied from interface:HeaderCodecEncodes the specified header as a string.
The resulting value is a header field as defined by RFC 7230 Section 3.2.
- Specified by:
encodein interfaceHeaderCodec<AuthorizationCodec.Authorization>- Parameters:
header- the header to encode- Returns:
- the encoded header
-
encodeValue
Description copied from interface:HeaderCodecEncodes the value of the specified header as a string.
The resulting value corresponds to the header field value as defined by RFC 7230 Section 3.2.
- Specified by:
encodeValuein interfaceHeaderCodec<AuthorizationCodec.Authorization>- Parameters:
header- the header to encode- Returns:
- the encoded header value
-
getSupportedHeaderNames
Description copied from interface:HeaderCodecReturns a list of header names supported by the codec.
- Specified by:
getSupportedHeaderNamesin interfaceHeaderCodec<AuthorizationCodec.Authorization>- Returns:
- a list of header names
-