public abstract class CredentialsByHostClient extends Object implements com.aspose.ms.System.IDisposable
Represents the client that creates server connection by using the host credentials.
Modifier and Type | Field and Description |
---|---|
com.aspose.ms.lang.Event<com.aspose.ms.System.EventHandler> |
OnConnect
The OnConnect event occurs when the clent establishes connection.
|
Modifier | Constructor and Description |
---|---|
protected |
CredentialsByHostClient()
Initializes a new instance of the
CredentialsByHostClient class. |
protected |
CredentialsByHostClient(String host,
int port)
Initializes a new instance of the
CredentialsByHostClient class. |
protected |
CredentialsByHostClient(String host,
int port,
int securityOptions)
Initializes a new instance of the
CredentialsByHostClient class. |
protected |
CredentialsByHostClient(String host,
int port,
String username,
ITokenProvider tokenProvider)
Initializes a new instance of the
CredentialsByHostClient class. |
protected |
CredentialsByHostClient(String host,
int port,
String username,
ITokenProvider tokenProvider,
int securityOptions)
Initializes a new instance of the
CredentialsByHostClient class. |
protected |
CredentialsByHostClient(String host,
int port,
String username,
String password)
Initializes a new instance of the
CredentialsByHostClient class. |
protected |
CredentialsByHostClient(String host,
int port,
String username,
String authInfo,
boolean useOAuth)
Initializes a new instance of the
CredentialsByHostClient class. |
protected |
CredentialsByHostClient(String host,
int port,
String username,
String authInfo,
boolean useOAuth,
int securityOptions)
Initializes a new instance of the
CredentialsByHostClient class. |
protected |
CredentialsByHostClient(String host,
int port,
String username,
String password,
int securityOptions)
Initializes a new instance of the
CredentialsByHostClient class. |
Modifier and Type | Method and Description |
---|---|
void |
cancelAsyncOperation(com.aspose.ms.System.IAsyncResult asyncResult)
Cancels asynchronous operation.
|
void |
cancelAsyncOperations()
Cancels all asynchronous operations.
|
IConnection |
createConnection()
Creates new connection object for operations in current thread.
|
void |
disconnect()
Deprecated.
|
void |
dispose()
Finalizes all operations with a server.
|
protected void |
dispose(boolean disposing)
Finalizes all operations with a server.
|
protected void |
finalize()
Releases unmanaged resources and performs other cleanup operations before the
CredentialsByHostClient is reclaimed by garbage collection. |
String |
getAccessToken()
Gets or sets the access token.
|
String[] |
getCapabilities()
getCapabilities.
|
int |
getConnectionCheckupPeriod()
Period of connection checking up in milliseconds.
|
int |
getConnectionState()
Gets the current state of the connection.
|
int |
getConnectionTimeout()
Gets or sets the connection timeout
Please note:
If connection consists of several server requests, for every request will assigned this timeout value.
|
int |
getDefaultPort()
Gets default port for client
|
String |
getHost()
Gets or sets the host name.
|
int |
getMaxConnectionsPerServer()
Deprecated.
|
String |
getPassword()
Gets or sets the password.
|
int |
getPort()
Gets or sets the port.
|
int |
getSecurityOptions()
Security mode for a mail client
|
SocksProxy |
getSocksProxy()
Gets or sets SOCKS proxy for the client
|
int |
getTimeout()
Gets or sets the timeout for mail operations (except connection operation, see ConnectionTimeout)
Please note:
If an operation consists of several server requests, for every request will assigned this timeout value.
|
ITokenProvider |
getTokenProvider()
Gets or sets TokenProvider allowing to retrieve access token.
|
boolean |
getUseAuthentication()
Indicates whether authentication is used.
|
boolean |
getUseDefaultCredentials()
Gets or sets a Boolean value that controls whether the DefaultCredentials are sent with requests.
|
boolean |
getUsePipelining()
Gets or sets value which indicates whether the pipelining mode is enabled.
|
String |
getUsername()
Gets or sets the username.
|
abstract void |
noop()
'No operation' command
|
void |
setAccessToken(String value)
Gets or sets the access token.
|
void |
setConnectionCheckupPeriod(int value)
Period of connection checking up in milliseconds.
|
void |
setConnectionTimeout(int value)
Gets or sets the connection timeout
Please note:
If connection consists of several server requests, for every request will assigned this timeout value.
|
void |
setHost(String value)
Gets or sets the host name.
|
void |
setMaxConnectionsPerServer(int value)
Deprecated.
|
void |
setPassword(String value)
Gets or sets the password.
|
void |
setPort(int value)
Gets or sets the port.
|
void |
setSecurityOptions(int value)
Security mode for a mail client
|
void |
setSocksProxy(SocksProxy value)
Gets or sets SOCKS proxy for the client
|
void |
setTimeout(int value)
Gets or sets the timeout for mail operations (except connection operation, see ConnectionTimeout)
Please note:
If an operation consists of several server requests, for every request will assigned this timeout value.
|
void |
setTokenProvider(ITokenProvider value)
Gets or sets TokenProvider allowing to retrieve access token.
|
void |
setUseAuthentication(boolean value)
Indicates whether authentication is used.
|
void |
setUseDefaultCredentials(boolean value)
Gets or sets a Boolean value that controls whether the DefaultCredentials are sent with requests.
|
void |
setUsePipelining(boolean value)
Gets or sets value which indicates whether the pipelining mode is enabled.
|
void |
setUsername(String value)
Gets or sets the username.
|
public final com.aspose.ms.lang.Event<com.aspose.ms.System.EventHandler> OnConnect
The OnConnect event occurs when the clent establishes connection.
protected CredentialsByHostClient()
Initializes a new instance of the CredentialsByHostClient
class.
protected CredentialsByHostClient(String host, int port)
Initializes a new instance of the CredentialsByHostClient
class.
host
- The host name.port
- The port number.protected CredentialsByHostClient(String host, int port, int securityOptions)
Initializes a new instance of the CredentialsByHostClient
class.
host
- The host name.port
- The port number.securityOptions
- Security mode for a mail clientprotected CredentialsByHostClient(String host, int port, String username, String password)
Initializes a new instance of the CredentialsByHostClient
class.
host
- The host name.port
- The port number.username
- The username.password
- The password.protected CredentialsByHostClient(String host, int port, String username, String password, int securityOptions)
Initializes a new instance of the CredentialsByHostClient
class.
host
- The host name.port
- The port number.username
- The username.password
- The password.securityOptions
- Security mode for a mail clientprotected CredentialsByHostClient(String host, int port, String username, String authInfo, boolean useOAuth)
Initializes a new instance of the CredentialsByHostClient
class.
host
- The host.port
- The port.username
- The username.authInfo
- A string representation of the user password or the access token.useOAuth
- Defines whether OAuth is used to login to the serverprotected CredentialsByHostClient(String host, int port, String username, String authInfo, boolean useOAuth, int securityOptions)
Initializes a new instance of the CredentialsByHostClient
class.
host
- The host.port
- The port.username
- The username.authInfo
- A string representation of the user password or the access token.useOAuth
- Defines whether OAuth is used to login to the serversecurityOptions
- Security mode for a mail clientprotected CredentialsByHostClient(String host, int port, String username, ITokenProvider tokenProvider)
Initializes a new instance of the CredentialsByHostClient
class.
host
- The host.port
- The port.username
- The username.tokenProvider
- TokenProvider allowing to retrieve access token.protected CredentialsByHostClient(String host, int port, String username, ITokenProvider tokenProvider, int securityOptions)
Initializes a new instance of the CredentialsByHostClient
class.
host
- The host.port
- The port.username
- The username.tokenProvider
- TokenProvider allowing to retrieve access token.securityOptions
- a int.@Deprecated public int getMaxConnectionsPerServer()
Gets or sets maximum number of connections which can be opened at once.
@Deprecated public void setMaxConnectionsPerServer(int value)
Gets or sets maximum number of connections which can be opened at once.
value
- a int.public boolean getUsePipelining()
Gets or sets value which indicates whether the pipelining mode is enabled.
public void setUsePipelining(boolean value)
Gets or sets value which indicates whether the pipelining mode is enabled.
value
- a boolean.public String getHost()
Gets or sets the host name.
Value: The host name.String
object.public void setHost(String value)
Gets or sets the host name.
Value: The host name.value
- a String
object.public int getDefaultPort()
Gets default port for client
public int getPort()
Gets or sets the port.
Value: The port number.public void setPort(int value)
Gets or sets the port.
Value: The port number.value
- a int.public int getSecurityOptions()
Security mode for a mail client
public void setSecurityOptions(int value)
Security mode for a mail client
value
- a int.public boolean getUseAuthentication()
Indicates whether authentication is used.
public void setUseAuthentication(boolean value)
Indicates whether authentication is used.
value
- a boolean.public int getConnectionCheckupPeriod()
Period of connection checking up in milliseconds. Default value is 5 min.
public void setConnectionCheckupPeriod(int value)
Period of connection checking up in milliseconds. Default value is 5 min.
value
- a int.public boolean getUseDefaultCredentials()
Gets or sets a Boolean value that controls whether the DefaultCredentials are sent with requests.
public void setUseDefaultCredentials(boolean value)
Gets or sets a Boolean value that controls whether the DefaultCredentials are sent with requests.
value
- a boolean.public SocksProxy getSocksProxy()
Gets or sets SOCKS proxy for the client
SocksProxy
object.public void setSocksProxy(SocksProxy value)
Gets or sets SOCKS proxy for the client
value
- a SocksProxy
object.public int getConnectionTimeout()
Gets or sets the connection timeout Please note: If connection consists of several server requests, for every request will assigned this timeout value.
Value: The timeout in millisecondspublic void setConnectionTimeout(int value)
Gets or sets the connection timeout Please note: If connection consists of several server requests, for every request will assigned this timeout value.
Value: The timeout in millisecondsvalue
- a int.public int getTimeout()
Gets or sets the timeout for mail operations (except connection operation, see ConnectionTimeout) Please note: If an operation consists of several server requests, for every request will assigned this timeout value.
Value: The timeout in millisecondspublic void setTimeout(int value)
Gets or sets the timeout for mail operations (except connection operation, see ConnectionTimeout) Please note: If an operation consists of several server requests, for every request will assigned this timeout value.
Value: The timeout in millisecondsvalue
- a int.public String getPassword()
Gets or sets the password.
Value: The string that represents the password.String
object.public void setPassword(String value)
Gets or sets the password.
Value: The string that represents the password.value
- a String
object.public String getAccessToken()
Gets or sets the access token.
Value: The string that represents access token.String
object.public void setAccessToken(String value)
Gets or sets the access token.
Value: The string that represents access token.value
- a String
object.public ITokenProvider getTokenProvider()
Gets or sets TokenProvider allowing to retrieve access token.
ITokenProvider
object.public void setTokenProvider(ITokenProvider value)
Gets or sets TokenProvider allowing to retrieve access token.
value
- a ITokenProvider
object.public String getUsername()
Gets or sets the username.
Value: The username string.String
object.public void setUsername(String value)
Gets or sets the username.
Value: The username string.value
- a String
object.public String[] getCapabilities()
getCapabilities.
String
objects.public int getConnectionState()
Gets the current state of the connection.
public void cancelAsyncOperation(com.aspose.ms.System.IAsyncResult asyncResult)
Cancels asynchronous operation.
asyncResult
- Defines asynchronous operation to cancel.public void cancelAsyncOperations()
Cancels all asynchronous operations.
@Deprecated public void disconnect()
Finalizes connection with server for current thread.
protected void dispose(boolean disposing)
Finalizes all operations with a server.
disposing
- true
to release both managed and unmanaged resources; false
to release only unmanaged resources.public abstract void noop()
'No operation' command
public IConnection createConnection()
Creates new connection object for operations in current thread. Please note: New connection can not be created in thread where mail client has been instantiated. New connection can not be created when MaxConnectionsPerServer = 1. In this case max number of connections has to be increased. When all operations for current thread are finished, connection object must be disposed.
public void dispose()
Finalizes all operations with a server.
dispose
in interface com.aspose.ms.System.IDisposable
Copyright (c) 2008-2015 Aspose Pty Ltd. All Rights Reserved.