Dela via


AbstractApplicationBase.Builder<T> Class

  • java.lang.Object
    • com.microsoft.aad.msal4j.AbstractApplicationBase.Builder<T>

Type Parameters

T

public abstract static class AbstractApplicationBase.Builder

Constructor Summary

Constructor Description
Builder()
Builder(String clientId)

Method Summary

Modifier and Type Method and Description
T connectTimeoutForDefaultHttpClient(Integer val)

Sets the connect timeout value used in HttpsURLConnection connections made by DefaultHttpClient, and is not needed if using a custom HTTP client

T correlationId(String val)

Set optional correlation id to be used by the API.

T executorService(ExecutorService val)

Sets ExecutorService to be used to execute the requests.

T httpClient(IHttpClient val)

Sets HTTP client to be used by the client application for all HTTP requests.

T logPii(boolean val)

Set logPii - boolean value, which determines whether Pii (personally identifiable information) will be logged in.

T proxy(Proxy val)

Sets Proxy configuration to be used by the client application (MSAL4J by default uses javax.net.ssl.HttpsURLConnection) for all network communication.

T readTimeoutForDefaultHttpClient(Integer val)

Sets the read timeout value used in HttpsURLConnection connections made by DefaultHttpClient, and is not needed if using a custom HTTP client

T sslSocketFactory(SSLSocketFactory val)

Sets SSLSocketFactory to be used by the client application for all network communication.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

Builder

public Builder()

Builder

public Builder(String clientId)

Parameters:

clientId

Method Details

connectTimeoutForDefaultHttpClient

public T connectTimeoutForDefaultHttpClient(Integer val)

Sets the connect timeout value used in HttpsURLConnection connections made by DefaultHttpClient, and is not needed if using a custom HTTP client

Parameters:

val - timeout value in milliseconds

Returns:

instance of the Builder on which method was called

correlationId

public T correlationId(String val)

Set optional correlation id to be used by the API. If not provided, the API generates a random UUID.

Parameters:

val - a string value of correlation id

Returns:

instance of the Builder on which method was called

executorService

public T executorService(ExecutorService val)

Sets ExecutorService to be used to execute the requests. Developer is responsible for maintaining the lifecycle of the ExecutorService.

Parameters:

val - an instance of ExecutorService

Returns:

instance of the Builder on which method was called

httpClient

public T httpClient(IHttpClient val)

Sets HTTP client to be used by the client application for all HTTP requests. Allows for fine grained configuration of HTTP client.

Parameters:

val - Implementation of IHttpClient

Returns:

instance of the Builder on which method was called

logPii

public T logPii(boolean val)

Set logPii - boolean value, which determines whether Pii (personally identifiable information) will be logged in. The default value is false.

Parameters:

val - a boolean value for logPii

Returns:

instance of the Builder on which method was called

proxy

public T proxy(Proxy val)

Sets Proxy configuration to be used by the client application (MSAL4J by default uses javax.net.ssl.HttpsURLConnection) for all network communication. If no proxy value is passed in, system defined properties are used. If HTTP client is set on the client application (via ClientApplication.builder().httpClient()), proxy configuration should be done on the HTTP client object being passed in, and not through this method.

Parameters:

val - an instance of Proxy

Returns:

instance of the Builder on which method was called

readTimeoutForDefaultHttpClient

public T readTimeoutForDefaultHttpClient(Integer val)

Sets the read timeout value used in HttpsURLConnection connections made by DefaultHttpClient, and is not needed if using a custom HTTP client

Parameters:

val - timeout value in milliseconds

Returns:

instance of the Builder on which method was called

sslSocketFactory

public T sslSocketFactory(SSLSocketFactory val)

Sets SSLSocketFactory to be used by the client application for all network communication. If HTTP client is set on the client application (via ClientApplication.builder().httpClient()), any configuration of SSL should be done on the HTTP client and not through this method.

Parameters:

val - an instance of SSLSocketFactory

Returns:

instance of the Builder on which method was called

Applies to