TokenProvider

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.email.ITokenProvider

public class TokenProvider implements ITokenProvider

Class TokenProvider allows to retrieve access token for mail services.

Methods

Method Description
dispose() Performs releasing resources.
equals(Object arg0)
getAccessToken() Gets oAuth access token.
getAccessToken(boolean ignoreExistingToken) Gets oAuth access token.
getClass()
getClientId() The client ID obtained during application registration.
getClientSecret() The client secret obtained during application registration.
getExtraParameters() Gets extra parameters for request
getInstance(String requestUrl, String clientId, String clientSecret, String refreshToken) Gets an instance of the OutlookTokenProvider for defined parameters.
getLogin() Gets or sets login for basic authorization
getPassword() Gets or sets password for basic authorization
getRefreshToken() OAuth 2.0 refresh token
getRequestUrl() The url to obtain access token.
getUseBasicAuthorization() Gets or sets value which indicates whether basic authorization is used
hashCode()
notify()
notifyAll()
setLogin(String value) Gets or sets login for basic authorization
setPassword(String value) Gets or sets password for basic authorization
setUseBasicAuthorization(boolean value) Gets or sets value which indicates whether basic authorization is used
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

dispose()

public void dispose()

Performs releasing resources.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

Parameter Type Description
arg0 java.lang.Object

Returns: boolean

getAccessToken()

public OAuthToken getAccessToken()

Gets oAuth access token. If token exists and its expiration date is not expired returns current token, otherwise requests new token from a server.

Returns: OAuthToken - Returns oAuth access token

getAccessToken(boolean ignoreExistingToken)

public OAuthToken getAccessToken(boolean ignoreExistingToken)

Gets oAuth access token.

Parameters:

Parameter Type Description
ignoreExistingToken boolean If ignoreExistingToken is true, requests new token from a server. Otherwise behaviour is depended on whether token exists or not. If token exists and its expiration date is not expired returns current token, otherwise requests new token from a server.

Returns: OAuthToken - Returns oAuth access token

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getClientId()

public String getClientId()

The client ID obtained during application registration.

Returns: java.lang.String

getClientSecret()

public String getClientSecret()

The client secret obtained during application registration.

Returns: java.lang.String

getExtraParameters()

public System.Collections.Generic.KeyValuePair<String,String>[] getExtraParameters()

Gets extra parameters for request

Returns: com.aspose.ms.System.Collections.Generic.KeyValuePair<java.lang.String,java.lang.String>[]

getInstance(String requestUrl, String clientId, String clientSecret, String refreshToken)

public static TokenProvider getInstance(String requestUrl, String clientId, String clientSecret, String refreshToken)

Gets an instance of the OutlookTokenProvider for defined parameters.

Parameters:

Parameter Type Description
requestUrl java.lang.String The url to obtain access token.
clientId java.lang.String The client ID obtained from the Microsoft account Developer Center during application registration.
clientSecret java.lang.String The client secret obtained during application registration.
refreshToken java.lang.String OAuth 2.0 refresh token

Returns: TokenProvider - Returns an instance of the OutlookTokenProvider for defined parameters.

getLogin()

public String getLogin()

Gets or sets login for basic authorization

Returns: java.lang.String

getPassword()

public String getPassword()

Gets or sets password for basic authorization

Returns: java.lang.String

getRefreshToken()

public String getRefreshToken()

OAuth 2.0 refresh token

Returns: java.lang.String

getRequestUrl()

public String getRequestUrl()

The url to obtain access token.

Returns: java.lang.String

getUseBasicAuthorization()

public boolean getUseBasicAuthorization()

Gets or sets value which indicates whether basic authorization is used

Returns: boolean

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setLogin(String value)

public void setLogin(String value)

Gets or sets login for basic authorization

Parameters:

Parameter Type Description
value java.lang.String

setPassword(String value)

public void setPassword(String value)

Gets or sets password for basic authorization

Parameters:

Parameter Type Description
value java.lang.String

setUseBasicAuthorization(boolean value)

public void setUseBasicAuthorization(boolean value)

Gets or sets value which indicates whether basic authorization is used

Parameters:

Parameter Type Description
value boolean

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

Parameter Type Description
arg0 long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

Parameter Type Description
arg0 long
arg1 int