|
IP*Works! SSL V6 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--ipworksssl.Pops
The POPS bean is used retrieve electronic mail from Internet Post Office servers (POP).
The POPS bean is the SSL-enabled equivalent (RFC 2595) of the
IP*Works! POP bean. The main difference is the introduction of a set of
new configuration settings, properties and events that deal
with SSL security. TheSSLProviderconfiguration setting chooses a security
provider subsystem. TheSSLEnabledProtocolsandSSLCipherStrengthconfiguration settings determine which protocols are enabled and at what security level.
The SSLCertStore , SSLCertSubject , and SSLCertEncoded properties are
used to select a
client certificate if the server is requesting client authentication.
TheSSLSecurityFlagsconfiguration setting, together with the SSLServerAuthentication event
allow you to check the server identity and other security attributes.
Finally, the SSLStatus event provides information about the SSL handshake.
The POPS bean implements a standard internet post office (POP3) client as specified in RFC 1725.
To connect to a MailServer first set the
appropriate User and Password and then connect by calling the Connect method. Upon successful
connection to the MailServer , the number of waiting messages is shown
by the MessageCount property. A message is selected by setting the MessageNumber property to a number between 1 and MessageCount (inclusive). Then, message text and/or headers are received by calling the Retrieve method.
The message text is received through the Transfer event,
whereas the message headers are received through the Header event.
Additionally, up to MaxLines from the message body are provided
in the MessageText property. The
body of the message is also saved in the file specified by the LocalFile property. StartTransfer and EndTransfer events are fired at the
beginning and end of message transmission. The PITrail event provides a
trace of the interaction between the client and server (excluding message
transfers).
| Field Summary | |
static int |
amAPOP
|
static int |
amCRAMMD5
|
static int |
amUserPassword
|
static int |
fwNone
|
static int |
fwSOCKS4
|
static int |
fwSOCKS5
|
static int |
fwTunnel
|
static int |
sslAutomatic
|
static int |
sslExplicit
|
static int |
sslImplicit
|
static int |
sslNone
|
static int |
sstMachine
|
static int |
sstPEMKey
|
static int |
sstPFXBlob
|
static int |
sstPFXFile
|
static int |
sstUser
|
| Constructor Summary | |
Pops()
|
|
| Method Summary | |
void |
addPopsEventListener(PopsEventListener l)
|
java.lang.String |
config(java.lang.String configurationString)
Sets or retrieves a beanconfiguration setting. |
void |
connect()
Connects to the mail server and attempts to login. |
void |
delete()
Delete a message specified by MessageNumber on the server. |
void |
disconnect()
Disconnects from the mail server. |
void |
doEvents()
Processes events from the internal message queue. |
int |
getAuthMechanism()
The authentication mechanism to be used when connecting to the mail server. |
java.lang.String |
getFirewallHost()
Name or IP address of firewall (optional). |
java.lang.String |
getFirewallPassword()
A password if authentication is to be used when connecting through the firewall. |
int |
getFirewallPort()
Port of the firewall to connect to. |
int |
getFirewallType()
Determines the type of firewall to connect through. |
java.lang.String |
getFirewallUser()
A user name if authentication is to be used connecting through a firewall. |
java.lang.String |
getLastReply()
The last reply from the server. |
java.lang.String |
getLocalFile()
The path to a local file for downloading the message body. |
java.lang.String |
getLocalHost()
The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
int |
getMailPort()
The server port for POP (default 110). |
java.lang.String |
getMailServer()
The name or address of a mail server (internet post office server). |
int |
getMaxLines()
The maximum number of message lines besides headers to retrieve. |
java.lang.String |
getMessageCc()
The value of the Cc header of the last retrieved message. |
int |
getMessageCount()
The number of messages waiting in the mailbox. |
java.lang.String |
getMessageDate()
The value of the Date: header of the last retrieved message. |
java.lang.String |
getMessageFrom()
The value of the From header of the last retrieved message. |
java.lang.String |
getMessageHeaders()
The full headers of the message as retrieved from the server. |
int |
getMessageNumber()
Current (selected) message. |
java.lang.String |
getMessageReplyTo()
The value of the Reply-To header of the last retrieved message. |
int |
getMessageSize()
The size in bytes of the current message. |
java.lang.String |
getMessageSubject()
The value of the Subject header of the last retrieved message. |
java.lang.String |
getMessageText()
The full text of the message as retrieved from the server. |
java.lang.String |
getMessageTo()
The value of the To header of the last retrieved message. |
java.lang.String |
getMessageUID()
The unique id of the message as specified by the server. |
java.lang.String |
getPassword()
The password for the mailbox user. |
byte[] |
getSSLAcceptServerCert()
Instructs the bean to unconditionally accept the server certificate that matches the supplied certificate. |
byte[] |
getSSLCertEncoded()
The SSL certificate (PEM/base64 encoded). |
byte[] |
getSSLCertStore()
The name of the certificate store for the client certificate. |
java.lang.String |
getSSLCertStorePassword()
The password for the certificate store (if any). |
int |
getSSLCertStoreType()
The type of certificate store for the client certificate. |
java.lang.String |
getSSLCertSubject()
The subject of the certificate used for client authentication. |
byte[] |
getSSLServerCert()
The server certificate for the last established connection. |
java.lang.String |
getSSLServerCertStatus()
The verification status of the server certificate for the last established connection. |
int |
getSSLStartMode()
Determines how the bean starts the SSL negotiation. |
int |
getTimeout()
A timeout for the bean. |
int |
getTotalSize()
Cumulative size in bytes of messages in the mailbox (including headers). |
java.lang.String |
getUser()
The user id for the mailbox. |
void |
interrupt()
Interrupt the current method. |
boolean |
isConnected()
Shows whether the bean is connected. |
boolean |
isIdle()
The current status of the component. |
void |
listMessageSizes()
Retrieves a list of all message sizes from the server. |
void |
listMessageUIDs()
Retrieves a list of all message UID-s from the server. |
java.lang.String |
localizeDate(java.lang.String dateTime)
Converts a valid RFC 822 message date to local date and time. |
void |
removePopsEventListener(PopsEventListener l)
|
void |
reset()
Reset all changes and revert back to the state when the user first connected. |
void |
retrieve()
Retrieve a message specified by MessageNumber from the server. |
void |
retrieveHeaders()
Retrieve headers for a message specified by MessageNumber . |
void |
setAuthMechanism(int authMechanism)
The authentication mechanism to be used when connecting to the mail server. |
void |
setCommand(java.lang.String command)
Can be used to send additional commands directly to the server. |
void |
setConnected(boolean connected)
Shows whether the bean is connected. |
void |
setFirewallHost(java.lang.String firewallHost)
Name or IP address of firewall (optional). |
void |
setFirewallPassword(java.lang.String firewallPassword)
A password if authentication is to be used when connecting through the firewall. |
void |
setFirewallPort(int firewallPort)
Port of the firewall to connect to. |
void |
setFirewallType(int firewallType)
Determines the type of firewall to connect through. |
void |
setFirewallUser(java.lang.String firewallUser)
A user name if authentication is to be used connecting through a firewall. |
void |
setLocalFile(java.lang.String localFile)
The path to a local file for downloading the message body. |
void |
setLocalHost(java.lang.String localHost)
The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
void |
setMailPort(int mailPort)
The server port for POP (default 110). |
void |
setMailServer(java.lang.String mailServer)
The name or address of a mail server (internet post office server). |
void |
setMaxLines(int maxLines)
The maximum number of message lines besides headers to retrieve. |
void |
setMessageNumber(int messageNumber)
Current (selected) message. |
void |
setPassword(java.lang.String password)
The password for the mailbox user. |
void |
setSSLAcceptServerCert(byte[] SSLAcceptServerCert)
Instructs the bean to unconditionally accept the server certificate that matches the supplied certificate. |
void |
setSSLCertEncoded(byte[] SSLCertEncoded)
The SSL certificate (PEM/base64 encoded). |
void |
setSSLCertStore(byte[] SSLCertStore)
The name of the certificate store for the client certificate. |
void |
setSSLCertStorePassword(java.lang.String SSLCertStorePassword)
The password for the certificate store (if any). |
void |
setSSLCertStoreType(int SSLCertStoreType)
The type of certificate store for the client certificate. |
void |
setSSLCertSubject(java.lang.String SSLCertSubject)
The subject of the certificate used for client authentication. |
void |
setSSLStartMode(int SSLStartMode)
Determines how the bean starts the SSL negotiation. |
void |
setTimeout(int timeout)
A timeout for the bean. |
void |
setUser(java.lang.String user)
The user id for the mailbox. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int amUserPassword
public static final int amCRAMMD5
public static final int amAPOP
public static final int fwNone
public static final int fwTunnel
public static final int fwSOCKS4
public static final int fwSOCKS5
public static final int sstUser
public static final int sstMachine
public static final int sstPFXFile
public static final int sstPFXBlob
public static final int sstPEMKey
public static final int sslAutomatic
public static final int sslImplicit
public static final int sslExplicit
public static final int sslNone
| Constructor Detail |
public Pops()
| Method Detail |
public int getAuthMechanism()
By default, AuthMechanism is amUserPassword (0), and default plaintext
authentication is used to login to the server. Other, more secure, options
include amCRAMMD5 (1) for CRAM-MD5, and amAPOP (2) for APOP authentication.
public void setAuthMechanism(int authMechanism)
throws IPWorksSSLException
By default, AuthMechanism is amUserPassword (0), and default plaintext
authentication is used to login to the server. Other, more secure, options
include amCRAMMD5 (1) for CRAM-MD5, and amAPOP (2) for APOP authentication.
IPWorksSSLException
public void setCommand(java.lang.String command)
throws IPWorksSSLException
Check the LastReply property and/or trap the PITrail events
coming from the server to get the response.
IPWorksSSLExceptionpublic boolean isConnected()
Use this property to determine whether the bean is connected to the remote host or not.
public void setConnected(boolean connected)
throws IPWorksSSLException
Use this property to determine whether the bean is connected to the remote host or not.
IPWorksSSLExceptionpublic java.lang.String getFirewallHost()
If a FirewallHost is given, requested connections will be
authenticated through the specified firewall when connecting.
If the FirewallHost property is set to a Domain Name, a DNS request
is initiated. Upon successful termination of the request, the FirewallHost property is set to the corresponding address. If the
search is not successful, an error is returned.
public void setFirewallHost(java.lang.String firewallHost)
throws IPWorksSSLException
If a FirewallHost is given, requested connections will be
authenticated through the specified firewall when connecting.
If the FirewallHost property is set to a Domain Name, a DNS request
is initiated. Upon successful termination of the request, the FirewallHost property is set to the corresponding address. If the
search is not successful, an error is returned.
IPWorksSSLExceptionpublic java.lang.String getFirewallPassword()
if FirewallHost is specified, the FirewallUser and FirewallPassword properties are used to connect and authenticate
to the given firewall. If the authentication fails, a trappable error is fired.
public void setFirewallPassword(java.lang.String firewallPassword)
throws IPWorksSSLException
if FirewallHost is specified, the FirewallUser and FirewallPassword properties are used to connect and authenticate
to the given firewall. If the authentication fails, a trappable error is fired.
IPWorksSSLExceptionpublic int getFirewallPort()
The TCP port for the FirewallHost . See the
description of the FirewallHost property for
details.
Note that the FirewallPort is set automatically
when FirewallType is set to a valid value. See the
description of the FirewallType property for
details.
public void setFirewallPort(int firewallPort)
throws IPWorksSSLException
The TCP port for the FirewallHost . See the
description of the FirewallHost property for
details.
Note that the FirewallPort is set automatically
when FirewallType is set to a valid value. See the
description of the FirewallType property for
details.
IPWorksSSLExceptionpublic int getFirewallType()
The applicable values are the following:
FirewallPort is set to 80.
FirewallPort is set to 1080.
FirewallPort is set to 1080.
public void setFirewallType(int firewallType)
throws IPWorksSSLException
The applicable values are the following:
FirewallPort is set to 80.
FirewallPort is set to 1080.
FirewallPort is set to 1080.
IPWorksSSLExceptionpublic java.lang.String getFirewallUser()
if FirewallHost is specified, the FirewallUser and FirewallPassword properties are used to connect and authenticate
to the given firewall. If the authentication fails, a trappable error is fired.
public void setFirewallUser(java.lang.String firewallUser)
throws IPWorksSSLException
if FirewallHost is specified, the FirewallUser and FirewallPassword properties are used to connect and authenticate
to the given firewall. If the authentication fails, a trappable error is fired.
IPWorksSSLExceptionpublic boolean isIdle()
Idle will be False if the component is currently busy (communicating
and/or waiting for an answer), and True at all other times.
public java.lang.String getLastReply()
This is the last reply received from the server. It
can be used for information purposes. The same information
and more can also be retrieved through the PITrail event.
public java.lang.String getLocalFile()
The LocalFile property is used when retrieving a message.
If LocalFile is empty then
the received data is provided through the parameters of the Transfer event
public void setLocalFile(java.lang.String localFile)
throws IPWorksSSLException
The LocalFile property is used when retrieving a message.
If LocalFile is empty then
the received data is provided through the parameters of the Transfer event
IPWorksSSLExceptionpublic java.lang.String getLocalHost()
The LocalHost property contains the name of the local host
as obtained by the gethostname() system call, or if the
user has assigned an IP address, the value of that address.
In multihomed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.
If the bean is connected, the LocalHost property shows
the IP address of the interface through which the connection
is made in internet dotted format (aaa.bbb.ccc.ddd). In most
cases, this is the address of the local host, except for multihomed
hosts (machines with more than one IP interface).
NOTE: LocalHost is not persistent. You must always set it in
code, and never in the property window.
public void setLocalHost(java.lang.String localHost)
throws IPWorksSSLException
The LocalHost property contains the name of the local host
as obtained by the gethostname() system call, or if the
user has assigned an IP address, the value of that address.
In multihomed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.
If the bean is connected, the LocalHost property shows
the IP address of the interface through which the connection
is made in internet dotted format (aaa.bbb.ccc.ddd). In most
cases, this is the address of the local host, except for multihomed
hosts (machines with more than one IP interface).
NOTE: LocalHost is not persistent. You must always set it in
code, and never in the property window.
IPWorksSSLExceptionpublic int getMailPort()
A valid port number (a value between 1 and 65535) is required for the connection to take place. The property must be set before a connection is attempted and cannot be changed once a connection is established. Any attempt to change this property while connected will fail with an error.
For implicit SSL, use port 995 (please refer to the SSLStartMode property
for more information).
public void setMailPort(int mailPort)
throws IPWorksSSLException
A valid port number (a value between 1 and 65535) is required for the connection to take place. The property must be set before a connection is attempted and cannot be changed once a connection is established. Any attempt to change this property while connected will fail with an error.
For implicit SSL, use port 995 (please refer to the SSLStartMode property
for more information).
IPWorksSSLExceptionpublic java.lang.String getMailServer()
The MailServer property specifies the IP address (IP number in
dotted internet format) or Domain Name of the mail server.
It is set before a connection is attempted and cannot be changed
once a connection is in progress.
If the MailServer property is set to a Domain Name, a DNS request
is initiated and upon successful termination of the request, the MailServer property is set to the corresponding address. If the
search is not successful the bean throws an IPWorksException
raises an IPWorksException exception
.
If the bean is configured to use a SOCKS firewall, the value assigned to this property may be preceded with a "*". If this is the case, the host name is passed to the firewall unresolved and the firewall performs the DNS resolution.
public void setMailServer(java.lang.String mailServer)
throws IPWorksSSLException
The MailServer property specifies the IP address (IP number in
dotted internet format) or Domain Name of the mail server.
It is set before a connection is attempted and cannot be changed
once a connection is in progress.
If the MailServer property is set to a Domain Name, a DNS request
is initiated and upon successful termination of the request, the MailServer property is set to the corresponding address. If the
search is not successful the bean throws an IPWorksException
raises an IPWorksException exception
.
If the bean is configured to use a SOCKS firewall, the value assigned to this property may be preceded with a "*". If this is the case, the host name is passed to the firewall unresolved and the firewall performs the DNS resolution.
IPWorksSSLExceptionpublic int getMaxLines()
The MaxLines property is to limit the number
of text lines besides headers retrieved for messages.
It can be used
to preview message headers and a portion of
their contents, without incurring the overhead of
downloading the entire message.
The default value of the property is 0. In this case the entire message will be retrieved, without interruptions.
public void setMaxLines(int maxLines)
throws IPWorksSSLException
The MaxLines property is to limit the number
of text lines besides headers retrieved for messages.
It can be used
to preview message headers and a portion of
their contents, without incurring the overhead of
downloading the entire message.
The default value of the property is 0. In this case the entire message will be retrieved, without interruptions.
IPWorksSSLExceptionpublic java.lang.String getMessageCc()
The same information may also be retrieved through the Header event.
public int getMessageCount()
When the bean is not connected to the server, the value of
the MessageCount property is 0. When connected, it contains
the number of messages in the mail box as reported by the POP server.
public java.lang.String getMessageDate()
The same information may also be retrieved through the Header event.
public java.lang.String getMessageFrom()
The same information may also be retrieved through the Header event.
public java.lang.String getMessageHeaders()
If the bean is not connected, or MessageNumber does not
contain a valid message number, the value of this property is an
empty string. Otherwise, it contains the full headers of the mail message
as reported by the server.
The MailServer is asked about the headers of the message only
if the MessageNumber property has changed. If MessageNumber has not changed, the bean returns a cached value.
Example (Connect and Retrieve Message)
POPControl.MailServer = "MyPOPServer"
POPControl.User = "username"
POPControl.Password = "password"
POPControl.Connect()
POPControl.MessageNumber = 1
MessageText = POPControl.MessageText
MessageHeaders = POPControl.MessageHeaders
public int getMessageNumber()
The MessageNumber property specifies a message number in between
1 and MessageCount . The various bean methods related to
single messages use this property as a message pointer (see method
descriptions and the MessageSize property).
public void setMessageNumber(int messageNumber)
throws IPWorksSSLException
The MessageNumber property specifies a message number in between
1 and MessageCount . The various bean methods related to
single messages use this property as a message pointer (see method
descriptions and the MessageSize property).
IPWorksSSLExceptionpublic java.lang.String getMessageReplyTo()
The same information may also be retrieved through the Header event.
public int getMessageSize()
If the bean is not connected, or MessageNumber does not
contain a valid message number, the value of this property is 0.
Otherwise, it contains the size of the mail message (including
headers) as reported by the server.
The MailServer is asked about the size of the message only
if the MessageNumber property has changed. If MessageNumber has not changed, the bean returns a cached value.
public java.lang.String getMessageSubject()
The same information may also be retrieved through the Header event.
public java.lang.String getMessageText()
If the bean is not connected, or MessageNumber does not
contain a valid message number, the value of this property is an
empty string. Otherwise, it contains the text of the mail message
as reported by the server (a maximum of MaxLines ).
The MailServer is asked about the text of the message only
if the MessageNumber property has changed. If MessageNumber has not changed, the bean returns a cached value.
Example (Connect and Retrieve Message)
POPControl.MailServer = "MyPOPServer"
POPControl.User = "username"
POPControl.Password = "password"
POPControl.Connect()
POPControl.MessageNumber = 1
MessageText = POPControl.MessageText
MessageHeaders = POPControl.MessageHeaders
public java.lang.String getMessageTo()
The same information may also be retrieved through the Header event.
public java.lang.String getMessageUID()
If the bean is not connected, or MessageNumber does not
contain a valid message number, the value of this property is an
empty string. Otherwise, it contains the UID of the mail message
as reported by the server.
The MailServer is asked about the UID of the message only
if the MessageNumber property has changed. If MessageNumber has not changed, the bean returns a cached value.
public java.lang.String getPassword()
This property must be set before the bean connects to the MailServer .
public void setPassword(java.lang.String password)
throws IPWorksSSLException
This property must be set before the bean connects to the MailServer .
IPWorksSSLExceptionpublic byte[] getSSLAcceptServerCert()
If it finds any issues with the certificate presented by the server, the bean will normally terminate the connection with an error.
You may override this behavior by supplying a value for SSLAcceptServerCert .
If the certificate supplied in SSLAcceptServerCert is the same as the
certificate presented by the server, then the server
certificate is accepted unconditionally, and the connection will continue
normally.
Please note that this functionality is provided only for cases where you otherwise know that you are communicating with the right server. If used improperly, these property will create a security breach. Use it at your own risk.
public void setSSLAcceptServerCert(byte[] SSLAcceptServerCert)
throws IPWorksSSLException
If it finds any issues with the certificate presented by the server, the bean will normally terminate the connection with an error.
You may override this behavior by supplying a value for SSLAcceptServerCert .
If the certificate supplied in SSLAcceptServerCert is the same as the
certificate presented by the server, then the server
certificate is accepted unconditionally, and the connection will continue
normally.
Please note that this functionality is provided only for cases where you otherwise know that you are communicating with the right server. If used improperly, these property will create a security breach. Use it at your own risk.
IPWorksSSLExceptionpublic byte[] getSSLCertEncoded()
This property is used to assign a specific certificate for
SSL client authentication (SSL server authentication in
the case of the IPDaemonS bean).
The SSLCertStore and SSLCertSubject properties may also be used to specify a certificate.
When SSLCertEncoded is set, a search is initiated in the current SSLCertStore for the private key of the certificate. If the key
is found, SSLCertSubject is updated to reflect the full subject
of the selected certificate, otherwise SSLCertSubject is set
to empty string.
public void setSSLCertEncoded(byte[] SSLCertEncoded)
throws IPWorksSSLException
This property is used to assign a specific certificate for
SSL client authentication (SSL server authentication in
the case of the IPDaemonS bean).
The SSLCertStore and SSLCertSubject properties may also be used to specify a certificate.
When SSLCertEncoded is set, a search is initiated in the current SSLCertStore for the private key of the certificate. If the key
is found, SSLCertSubject is updated to reflect the full subject
of the selected certificate, otherwise SSLCertSubject is set
to empty string.
IPWorksSSLExceptionpublic byte[] getSSLCertStore()
The SSLCertStoreType property specifies the type of the
certificate store specified by SSLCertStore . If the store
is password protected, specify the password in SSLCertStorePassword .
SSLCertStore is used in conjunction with the SSLCertSubject property in order to specify client certificates. If SSLCertStore has a value, and SSLCertSubject or SSLCertEncoded is set, a search for a certificate is initiated. Please refer to the SSLCertSubject property for details.
Designations of certificate stores are platform-dependent.
The following are designations of the most common User and Machine certificate stores in Windows:
In Java, the certificate store normally is a file containing certificates and optional private keys.
When the certificate store type is PFXFile, this property must be set to the name of the file. When the type is PFXBlob, the property must be set to the binary contents of a PFX file (i.e. PKCS12 certificate store).
If the provider is OpenSSL, the certificate store is a file containing a certificate and a private key. This property must be set to the name of the file.
public void setSSLCertStore(byte[] SSLCertStore)
throws IPWorksSSLException
The SSLCertStoreType property specifies the type of the
certificate store specified by SSLCertStore . If the store
is password protected, specify the password in SSLCertStorePassword .
SSLCertStore is used in conjunction with the SSLCertSubject property in order to specify client certificates. If SSLCertStore has a value, and SSLCertSubject or SSLCertEncoded is set, a search for a certificate is initiated. Please refer to the SSLCertSubject property for details.
Designations of certificate stores are platform-dependent.
The following are designations of the most common User and Machine certificate stores in Windows:
In Java, the certificate store normally is a file containing certificates and optional private keys.
When the certificate store type is PFXFile, this property must be set to the name of the file. When the type is PFXBlob, the property must be set to the binary contents of a PFX file (i.e. PKCS12 certificate store).
If the provider is OpenSSL, the certificate store is a file containing a certificate and a private key. This property must be set to the name of the file.
IPWorksSSLExceptionpublic java.lang.String getSSLCertStorePassword()
If the certificate store is of a type that requires a password, the value of this property is used to open the certificate store.
public void setSSLCertStorePassword(java.lang.String SSLCertStorePassword)
throws IPWorksSSLException
If the certificate store is of a type that requires a password, the value of this property is used to open the certificate store.
IPWorksSSLExceptionpublic int getSSLCertStoreType()
This property can take one of the following values:
public void setSSLCertStoreType(int SSLCertStoreType)
throws IPWorksSSLException
This property can take one of the following values:
IPWorksSSLExceptionpublic java.lang.String getSSLCertSubject()
When this property is set, a search is performed in the current certificate store certificate with matching subject.
If an exact match is not found, the store is searched for subjects containing the value of the property.
When setting the property to a partial subject, CN= should be omitted. For example, the following code would find the certificate with subject CN=Test Certificate, OU=People, C=US
Example (Searching with partial subject)
Control.CertSubject = "Test"
If a match is not found, the property is set to an empty string, and no certificate is selected.
The special value "*" picks a random certificate in the certificate store.
If a matching certificate is found, the SSLCertSubject property
is set to the full subject of the matching certificate.
public void setSSLCertSubject(java.lang.String SSLCertSubject)
throws IPWorksSSLException
When this property is set, a search is performed in the current certificate store certificate with matching subject.
If an exact match is not found, the store is searched for subjects containing the value of the property.
When setting the property to a partial subject, CN= should be omitted. For example, the following code would find the certificate with subject CN=Test Certificate, OU=People, C=US
Example (Searching with partial subject)
Control.CertSubject = "Test"
If a match is not found, the property is set to an empty string, and no certificate is selected.
The special value "*" picks a random certificate in the certificate store.
If a matching certificate is found, the SSLCertSubject property
is set to the full subject of the matching certificate.
IPWorksSSLExceptionpublic byte[] getSSLServerCert()
SSLServerCert contains the server certificate for the
last established connection.
SSLServerCert is reset every time a new connection is attempted.
public java.lang.String getSSLServerCertStatus()
When the verification fails, SSLServerCertStatus contains
a string that indicates the reason(s) why, otherwise, it
contains the string "OK".
Please note that the value of SSLServerCertStatus must
be considered as only a suggestion as to the validity of the
certificate. Application software must use its own logic
to determine whether to accept the certificate or not, by using
the SSLServerCert to access other certificate
properties, or other application-specific information.
SSLServerCertStatus is reset an empty string every time a new
connection is attempted.
public int getSSLStartMode()
The SSLStartMode property may have one of the following values:
SSLStartMode is set to sslExplicit . In all other cases, SSL negotiation will be implicit
( sslImplicit ).
public void setSSLStartMode(int SSLStartMode)
throws IPWorksSSLException
The SSLStartMode property may have one of the following values:
SSLStartMode is set to sslExplicit . In all other cases, SSL negotiation will be implicit
( sslImplicit ).
IPWorksSSLExceptionpublic int getTimeout()
If the Timeout property is set to 0, all operations
will run uninterrupted until successful completion, or an error condition
is encountered.
If Timeout is set to a positive value, the bean will
wait for the operation to complete before returning control.
The bean will use DoEvents to enter an efficient wait loop
during any potential waiting period, making sure that all system events
are processed immediately as they arrive. This ensures that the host
application does not "freeze" and remains responsive.
If Timeout expires, and the operation is not yet complete,
the bean throws an IPWorksException
raises an IPWorksException exception
.
Please note that by default, all timeouts are inactivity timeouts ,
i.e. the timeout period is extended by Timeout seconds when
data is successfully sent or received.
Optionally, the behavior of the bean may be changed to absolute timeouts , i.e. the bean will wait for a maximum
of Timeout seconds since the beginning of the operation, without
extending the timeout period during communications.
This behavior is controlled by theAbsoluteTimeoutconfiguration setting.
The default value for the Timeout property is 60 (seconds).
public void setTimeout(int timeout)
throws IPWorksSSLException
If the Timeout property is set to 0, all operations
will run uninterrupted until successful completion, or an error condition
is encountered.
If Timeout is set to a positive value, the bean will
wait for the operation to complete before returning control.
The bean will use DoEvents to enter an efficient wait loop
during any potential waiting period, making sure that all system events
are processed immediately as they arrive. This ensures that the host
application does not "freeze" and remains responsive.
If Timeout expires, and the operation is not yet complete,
the bean throws an IPWorksException
raises an IPWorksException exception
.
Please note that by default, all timeouts are inactivity timeouts ,
i.e. the timeout period is extended by Timeout seconds when
data is successfully sent or received.
Optionally, the behavior of the bean may be changed to absolute timeouts , i.e. the bean will wait for a maximum
of Timeout seconds since the beginning of the operation, without
extending the timeout period during communications.
This behavior is controlled by theAbsoluteTimeoutconfiguration setting.
The default value for the Timeout property is 60 (seconds).
IPWorksSSLExceptionpublic int getTotalSize()
When the bean is not connected to the server, the value of
the TotalSize property is 0. When connected, it contains
the cumulative size of all the messages in the mail box as reported
by the POP server.
public java.lang.String getUser()
This property must be set before the bean connects to the MailServer .
public void setUser(java.lang.String user)
throws IPWorksSSLException
This property must be set before the bean connects to the MailServer .
IPWorksSSLException
public java.lang.String config(java.lang.String configurationString)
throws IPWorksSSLException
Config is a generic method available in every bean.
It is used to set and retrieveconfiguration settingsfor the
bean.
Configuration settings are similar in functionality to properties,
but they are rarely used. In order to avoid "polluting" the property
namespace of the bean, access to these internal properties is provided through the Config method.
To set a configuration setting named PROPERTY , you must call Config("PROPERTY=VALUE") , where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).
To read (query) the value of a configuration setting, you must call Config("PROPERTY") . The value will be returned as a string.
IPWorksSSLException
public void connect()
throws IPWorksSSLException
Connects to the mail server and attempts to login using the current User and Password . Then it retrieves initial statistics about
the mailbox contents ( MessageCount and TotalSize ).
Example (Connect to POP Mailbox)
POPControl.MailServer = "MyPOPServer"
POPControl.User = "username"
POPControl.Password = "password"
POPControl.Connect()
POPControl.MessageNumber = 1
POPControl.Retrieve()
MessageText = POPControl.MessageText
MessageHeaders = POPControl.MessageHeaders
IPWorksSSLException
public void delete()
throws IPWorksSSLException
MessageNumber on the server.
Asks the MailServer to delete the message specified by MessageNumber . The message will not
actually be deleted from the server until the connection is closed. In order to cancel a previous
Delete, use the Reset method.
IPWorksSSLException
public void disconnect()
throws IPWorksSSLException
Makes the bean disconnect from the MailServer by sending the QUIT
command. If successful, all changes to the mailbox are committed by the server.
Otherwise, changes are rolled back to the initial state that the server was in before
the connection.
IPWorksSSLException
public void doEvents()
throws IPWorksSSLException
When DoEvents is called, the bean processes any
available events. If no events are available, it waits for a
preset period of time, and then returns.
IPWorksSSLException
public void interrupt()
throws IPWorksSSLException
If there is no method in progress, Interrupt simply returns doing nothing.
IPWorksSSLException
public void listMessageSizes()
throws IPWorksSSLException
For each message listed, a MessageList event will fire containing the number and size of the message.
IPWorksSSLException
public void listMessageUIDs()
throws IPWorksSSLException
For each message listed, a MessageList event will fire containing the number and UID of the message.
IPWorksSSLException
public java.lang.String localizeDate(java.lang.String dateTime)
throws IPWorksSSLException
This method can be used to convert an RFC 822 date/time string to the corresponding local date and time.
Dates will be returned in the format: "MM/dd/yyyy hh:mm:ss".
IPWorksSSLException
public void reset()
throws IPWorksSSLException
Asks the MailServer to reset all changes and revert back to the state
it was when connected.
IPWorksSSLException
public void retrieve()
throws IPWorksSSLException
MessageNumber from the server.
Asks the MailServer to retrieve the message specified by MessageNumber .
The message headers will arrive in the Header event, and the message text will
arrive in the Transfer event.
The MaxLines property defines the number of lines retrieved.
Example (Connect and Retrieve Message)
POPControl.MailServer = "MyPOPServer"
POPControl.User = "username"
POPControl.Password = "password"
POPControl.Connect()
POPControl.MessageNumber = 1
POPControl.retrieve()
IPWorksSSLException
public void retrieveHeaders()
throws IPWorksSSLException
MessageNumber .
Calling this method will retrieve the headers for the message specified
by the MessageNumber property. The message headers
will be provided by the Header event and also stored in the MessageHeaders property.
Example (Connect and Retrieve Message Headers)
POPControl.MailServer = "MyPOPServer"
POPControl.User = "username"
POPControl.Password = "password"
POPControl.Connect()
POPControl.MessageNumber = 1
POPControl.retrieveHeaders()
IPWorksSSLException
public void addPopsEventListener(PopsEventListener l)
throws java.util.TooManyListenersException
java.util.TooManyListenersExceptionpublic void removePopsEventListener(PopsEventListener l)
|
IP*Works! SSL V6 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||