Package org.javacord.api.util.auth
Interface Response
-
public interface ResponseThis class represents the response that demands authentication.
-
-
Field Summary
Fields Modifier and Type Field Description static PatternAUTH_PARAM_PATTERNstatic StringAUTH_PARAM_PATTERN_PARTstatic PatternAUTH_PARAM_SPLIT_PATTERNstatic PatternAUTH_SCHEME_AND_PARAM_PATTERNstatic PatternAUTH_SCHEME_AND_TOKEN68_PATTERNstatic PatternAUTH_SCHEME_PATTERNstatic PatternAUTHENTICATION_HEADER_VALUE_PATTERNstatic PatternAUTHENTICATION_HEADER_VALUE_SPLIT_PATTERNstatic StringAUTHENTICATION_HEADER_VALUE_SPLIT_PATTERN_PARTstatic StringCHALLENGE_PATTERN_PARTstatic Map<Map.Entry<String,String>,List<Challenge>>CHALLENGES_CACHEstatic StringOWS_PATTERN_PARTstatic PatternQUOTED_PAIR_PATTERNstatic StringQUOTED_PAIR_PATTERN_PARTstatic PatternQUOTED_STRING_AUTH_PARAM_AT_END_PATTERNstatic StringQUOTED_STRING_PATTERN_PARTstatic PatternTOKEN_PATTERNstatic StringTOKEN_PATTERN_PARTstatic StringTOKEN68_PATTERN_PARTstatic PatternWHITESPACE_SPLIT_PATTERN
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Optional<String>getBody()The body of the response.default Stream<Challenge>getChallenges()Gets the RFC 7235 authentication challenges of this response.default Stream<Challenge>getChallenges(String authenticationScheme)Gets the RFC 7235 authentication challenges for the given scheme of this response.intgetCode()The response code.Map<String,List<String>>getHeaders()The headers of the response.default List<String>getHeaders(String headerName)The headers of the response with the given name.StringgetMessage()The response message.
-
-
-
Field Detail
-
TOKEN_PATTERN_PART
static final String TOKEN_PATTERN_PART
- See Also:
- Constant Field Values
-
TOKEN68_PATTERN_PART
static final String TOKEN68_PATTERN_PART
- See Also:
- Constant Field Values
-
OWS_PATTERN_PART
static final String OWS_PATTERN_PART
- See Also:
- Constant Field Values
-
QUOTED_PAIR_PATTERN_PART
static final String QUOTED_PAIR_PATTERN_PART
- See Also:
- Constant Field Values
-
QUOTED_STRING_PATTERN_PART
static final String QUOTED_STRING_PATTERN_PART
- See Also:
- Constant Field Values
-
AUTH_PARAM_PATTERN_PART
static final String AUTH_PARAM_PATTERN_PART
- See Also:
- Constant Field Values
-
CHALLENGE_PATTERN_PART
static final String CHALLENGE_PATTERN_PART
- See Also:
- Constant Field Values
-
AUTHENTICATION_HEADER_VALUE_SPLIT_PATTERN_PART
static final String AUTHENTICATION_HEADER_VALUE_SPLIT_PATTERN_PART
- See Also:
- Constant Field Values
-
AUTHENTICATION_HEADER_VALUE_PATTERN
static final Pattern AUTHENTICATION_HEADER_VALUE_PATTERN
-
AUTH_SCHEME_PATTERN
static final Pattern AUTH_SCHEME_PATTERN
-
AUTH_SCHEME_AND_TOKEN68_PATTERN
static final Pattern AUTH_SCHEME_AND_TOKEN68_PATTERN
-
AUTH_SCHEME_AND_PARAM_PATTERN
static final Pattern AUTH_SCHEME_AND_PARAM_PATTERN
-
AUTH_PARAM_PATTERN
static final Pattern AUTH_PARAM_PATTERN
-
TOKEN_PATTERN
static final Pattern TOKEN_PATTERN
-
QUOTED_PAIR_PATTERN
static final Pattern QUOTED_PAIR_PATTERN
-
AUTHENTICATION_HEADER_VALUE_SPLIT_PATTERN
static final Pattern AUTHENTICATION_HEADER_VALUE_SPLIT_PATTERN
-
WHITESPACE_SPLIT_PATTERN
static final Pattern WHITESPACE_SPLIT_PATTERN
-
AUTH_PARAM_SPLIT_PATTERN
static final Pattern AUTH_PARAM_SPLIT_PATTERN
-
QUOTED_STRING_AUTH_PARAM_AT_END_PATTERN
static final Pattern QUOTED_STRING_AUTH_PARAM_AT_END_PATTERN
-
-
Method Detail
-
getCode
int getCode()
The response code.- Returns:
- The response code.
-
getMessage
String getMessage()
The response message.- Returns:
- The response message.
-
getHeaders
Map<String,List<String>> getHeaders()
The headers of the response.- Returns:
- The headers of the response.
-
getHeaders
default List<String> getHeaders(String headerName)
The headers of the response with the given name.- Parameters:
headerName- The name of the header for which to return the values.- Returns:
- The headers of the response with the given name.
-
getBody
default Optional<String> getBody() throws IOException
The body of the response.- Returns:
- The body of the response.
- Throws:
IOException- If an IO error occurs.
-
getChallenges
default Stream<Challenge> getChallenges()
Gets the RFC 7235 authentication challenges of this response.- Returns:
- The authentication challenges of this response.
-
getChallenges
default Stream<Challenge> getChallenges(String authenticationScheme)
Gets the RFC 7235 authentication challenges for the given scheme of this response.- Parameters:
authenticationScheme- The authentication scheme to get the challenges for.- Returns:
- The authentication challenges of this response for the given scheme.
-
-