Class HttpAuthenticationFeature.BuilderImpl
- java.lang.Object
-
- org.glassfish.jersey.client.authentication.HttpAuthenticationFeature.BuilderImpl
-
- All Implemented Interfaces:
HttpAuthenticationFeature.BasicBuilder
,HttpAuthenticationFeature.Builder
,HttpAuthenticationFeature.UniversalBuilder
- Enclosing class:
- HttpAuthenticationFeature
static class HttpAuthenticationFeature.BuilderImpl extends java.lang.Object implements HttpAuthenticationFeature.UniversalBuilder, HttpAuthenticationFeature.BasicBuilder
Implementation of all authentication builders.
-
-
Field Summary
Fields Modifier and Type Field Description private HttpAuthenticationFeature.Mode
mode
private byte[]
passwordBasic
private byte[]
passwordDigest
private java.lang.String
usernameBasic
private java.lang.String
usernameDigest
-
Constructor Summary
Constructors Constructor Description BuilderImpl(HttpAuthenticationFeature.Mode mode)
Create a new builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpAuthenticationFeature
build()
Build the feature.HttpAuthenticationFeature.Builder
credentials(java.lang.String username, byte[] password)
Set credentials.HttpAuthenticationFeature.Builder
credentials(java.lang.String username, java.lang.String password)
Set credentials.HttpAuthenticationFeature.UniversalBuilder
credentialsForBasic(java.lang.String username, byte[] password)
Set credentials that will be used for basic authentication only.HttpAuthenticationFeature.UniversalBuilder
credentialsForBasic(java.lang.String username, java.lang.String password)
Set credentials that will be used for basic authentication only.HttpAuthenticationFeature.UniversalBuilder
credentialsForDigest(java.lang.String username, byte[] password)
Set credentials that will be used for digest authentication only.HttpAuthenticationFeature.UniversalBuilder
credentialsForDigest(java.lang.String username, java.lang.String password)
Set credentials that will be used for digest authentication only.HttpAuthenticationFeature.BasicBuilder
nonPreemptive()
Configure the builder to create features in non-preemptive basic authentication mode.
-
-
-
Field Detail
-
usernameBasic
private java.lang.String usernameBasic
-
passwordBasic
private byte[] passwordBasic
-
usernameDigest
private java.lang.String usernameDigest
-
passwordDigest
private byte[] passwordDigest
-
mode
private HttpAuthenticationFeature.Mode mode
-
-
Constructor Detail
-
BuilderImpl
public BuilderImpl(HttpAuthenticationFeature.Mode mode)
Create a new builder.- Parameters:
mode
- Mode in which the final authentication feature should work.
-
-
Method Detail
-
credentials
public HttpAuthenticationFeature.Builder credentials(java.lang.String username, java.lang.String password)
Description copied from interface:HttpAuthenticationFeature.Builder
Set credentials.- Specified by:
credentials
in interfaceHttpAuthenticationFeature.Builder
- Parameters:
username
- Username.password
- Password asString
.- Returns:
- This builder.
-
credentials
public HttpAuthenticationFeature.Builder credentials(java.lang.String username, byte[] password)
Description copied from interface:HttpAuthenticationFeature.Builder
Set credentials.- Specified by:
credentials
in interfaceHttpAuthenticationFeature.Builder
- Parameters:
username
- Username.password
- Password as byte array.- Returns:
- This builder.
-
credentialsForBasic
public HttpAuthenticationFeature.UniversalBuilder credentialsForBasic(java.lang.String username, java.lang.String password)
Description copied from interface:HttpAuthenticationFeature.UniversalBuilder
Set credentials that will be used for basic authentication only.- Specified by:
credentialsForBasic
in interfaceHttpAuthenticationFeature.UniversalBuilder
- Parameters:
username
- Username.password
- Password asString
.- Returns:
- This builder.
-
credentialsForBasic
public HttpAuthenticationFeature.UniversalBuilder credentialsForBasic(java.lang.String username, byte[] password)
Description copied from interface:HttpAuthenticationFeature.UniversalBuilder
Set credentials that will be used for basic authentication only.- Specified by:
credentialsForBasic
in interfaceHttpAuthenticationFeature.UniversalBuilder
- Parameters:
username
- Username.password
- Password asbyte array
.- Returns:
- This builder.
-
credentialsForDigest
public HttpAuthenticationFeature.UniversalBuilder credentialsForDigest(java.lang.String username, java.lang.String password)
Description copied from interface:HttpAuthenticationFeature.UniversalBuilder
Set credentials that will be used for digest authentication only.- Specified by:
credentialsForDigest
in interfaceHttpAuthenticationFeature.UniversalBuilder
- Parameters:
username
- Username.password
- Password asString
.- Returns:
- This builder.
-
credentialsForDigest
public HttpAuthenticationFeature.UniversalBuilder credentialsForDigest(java.lang.String username, byte[] password)
Description copied from interface:HttpAuthenticationFeature.UniversalBuilder
Set credentials that will be used for digest authentication only.- Specified by:
credentialsForDigest
in interfaceHttpAuthenticationFeature.UniversalBuilder
- Parameters:
username
- Username.password
- Password asbyte array
.- Returns:
- This builder.
-
build
public HttpAuthenticationFeature build()
Description copied from interface:HttpAuthenticationFeature.Builder
Build the feature.- Specified by:
build
in interfaceHttpAuthenticationFeature.Builder
- Returns:
- Http authentication feature configured from this builder.
-
nonPreemptive
public HttpAuthenticationFeature.BasicBuilder nonPreemptive()
Description copied from interface:HttpAuthenticationFeature.BasicBuilder
Configure the builder to create features in non-preemptive basic authentication mode.- Specified by:
nonPreemptive
in interfaceHttpAuthenticationFeature.BasicBuilder
- Returns:
- This builder.
-
-