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 |
bindIPEndPoint(BindIPEndPointHandler handler)
Associates a Socket with a local endpoint.
|
void |
cancelAsyncOperation(com.aspose.ms.System.IAsyncResult asyncResult)
Cancels asynchronous operation.
|
IConnection |
createConnection()
Creates new connection object for operations in current thread.
|
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.
|
String |
getLogFileName()
Gets or sets log file name
|
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 |
getUseDateInLogFileName()
Gets or sets value which indicates if date has to be used in log file name.
|
boolean |
getUseDefaultCredentials()
Gets or sets a Boolean value that controls whether the DefaultCredentials are sent with requests.
|
PipeliningStatus |
getUsePipelining()
Gets or sets object which indicates whether the pipelining mode is enabled.
|
String |
getUsername()
Gets or sets the username.
|
abstract void |
noop()
'No operation' command
|
void |
resetLogSettings()
Resets logging settings to default.
|
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 |
setLogFileName(String value)
Gets or sets log file name
|
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 |
setUseDateInLogFileName(boolean value)
Gets or sets value which indicates if date has to be used in log file name.
|
void |
setUseDefaultCredentials(boolean value)
Gets or sets a Boolean value that controls whether the DefaultCredentials are sent with requests.
|
void |
setUsePipelining(PipeliningStatus value)
Gets or sets object 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
- public void resetLogSettings()
Resets logging settings to default.
public String getLogFileName()
Gets or sets log file name
public void setLogFileName(String value)
Gets or sets log file name
public boolean getUseDateInLogFileName()
Gets or sets value which indicates if date has to be used in log file name.
public void setUseDateInLogFileName(boolean value)
Gets or sets value which indicates if date has to be used in log file name.
public PipeliningStatus getUsePipelining()
Gets or sets object which indicates whether the pipelining mode is enabled.
public void setUsePipelining(PipeliningStatus value)
Gets or sets object which indicates whether the pipelining mode is enabled.
public String getHost()
Gets or sets the host name.
Value: The host name.public void setHost(String value)
Gets or sets the host name.
Value: The host name.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.public int getSecurityOptions()
Security mode for a mail client
public void setSecurityOptions(int value)
Security mode for a mail client
public boolean getUseAuthentication()
Indicates whether authentication is used.
public void setUseAuthentication(boolean value)
Indicates whether authentication is used.
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.
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.
public SocksProxy getSocksProxy()
Gets or sets SOCKS proxy for the client
public void setSocksProxy(SocksProxy value)
Gets or sets SOCKS proxy for the client
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 millisecondspublic 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 millisecondspublic String getPassword()
Gets or sets the password.
Value: The string that represents the password.public void setPassword(String value)
Gets or sets the password.
Value: The string that represents the password.public String getAccessToken()
Gets or sets the access token.
Value: The string that represents access token.public void setAccessToken(String value)
Gets or sets the access token.
Value: The string that represents access token.public ITokenProvider getTokenProvider()
Gets or sets TokenProvider allowing to retrieve access token.
public void setTokenProvider(ITokenProvider value)
Gets or sets TokenProvider allowing to retrieve access token.
public String getUsername()
Gets or sets the username.
Value: The username string.public void setUsername(String value)
Gets or sets the username.
Value: The username string.public String[] getCapabilities()
getCapabilities.
public int getConnectionState()
Gets the current state of the connection.
public void bindIPEndPoint(BindIPEndPointHandler handler)
Associates a Socket with a local endpoint.
public void cancelAsyncOperation(com.aspose.ms.System.IAsyncResult asyncResult)
Cancels asynchronous operation.
asyncResult
- Defines asynchronous operation to cancel.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
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.Copyright (c) 2008-2017 Aspose Pty Ltd. All Rights Reserved.