|
IP*Works! SSL V9 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectipworksssl.Nntps
public class Nntps
The NNTPS Bean is used to read, search, and post articles on Usenet news servers.
The NNTPS Bean is the SSL-enabled equivalent of the IP*Works! NNTP Bean. The main difference is the introduction of a set of new configuration settings, properties and events that deal with SSL security. The ipworksssl.Nntps#config and {@link ipworksssl.Nntps#config configuration settings determine which protocols are enabled and at what security level. The {@link ipworksssl.Nntps#getSSLCert SSLCert} property is used to select a client certificate if the server is requesting client authentication. The {@link ipworksssl.Nntps#config configuration setting, together with the {@link ipworksssl.NntpsSSLServerAuthenticationEvent SSLServerAuthentication} event allow you to check the server identity and other security attributes. Finally, the {@link ipworksssl.NntpsSSLStatusEvent SSLStatus} event provides information about the SSL handshake.
The NNTPS Bean implements a standard Usenet news reader as specified in RFC 977. It can be used to browse Usenet news groups and read and post articles.
The {@link ipworksssl.Nntps#getCurrentGroup CurrentGroup} property sets the current newsgroup. From then on, news articles from that group can be read by setting the article number in {@link ipworksssl.Nntps#getCurrentArticle CurrentArticle} and then calling the appropriate method. Properties such as {@link ipworksssl.Nntps#getArticleCount ArticleCount} , {@link ipworksssl.Nntps#getFirstArticle FirstArticle} , {@link ipworksssl.Nntps#getLastArticle LastArticle} provide information about the current state.
The headers and text of the articles are received respectively through the {@link ipworksssl.NntpsHeaderEvent Header} and {@link ipworksssl.NntpsTransferEvent Transfer} events. Additionally, up to {@link ipworksssl.Nntps#getMaxLines MaxLines} from the article body are provided in the {@link ipworksssl.Nntps#getArticleText ArticleText} property. The {@link ipworksssl.NntpsGroupOverviewEvent GroupOverview} event returns information about a range of articles ( {@link ipworksssl.Nntps#getOverviewRange OverviewRange} ) in {@link ipworksssl.Nntps#getCurrentGroup CurrentGroup} , and the {@link ipworksssl.NntpsGroupListEvent GroupList} event is used when listing newsgroup names. The {@link ipworksssl.NntpsPITrailEvent PITrail} event provides a trace of the interaction with the server.
The bean supports posting of articles through the {@link ipworksssl.Nntps#getArticleText ArticleText} and {@link ipworksssl.Nntps#getAttachedFile AttachedFile} properties. The article text is specified in one or both of the above, and then the {@link ipworksssl.Nntps#postArticle PostArticle} method is called. Article headers are given in a series of properties like {@link ipworksssl.Nntps#getArticleFrom ArticleFrom} , {@link ipworksssl.Nntps#getArticleSubject ArticleSubject} , {@link ipworksssl.Nntps#getOrganization Organization} , etc. that map directly to the USENET article header with the same name.
| Field Summary | |
|---|---|
static int |
sslAutomatic
|
static int |
sslExplicit
|
static int |
sslImplicit
|
static int |
sslNone
|
| Constructor Summary | |
|---|---|
Nntps()
Creates an instance of Nntps Bean. |
|
Nntps(java.lang.String runtimeLicense)
Creates an instance of Nntps Bean with specified run-time license. |
|
| Method Summary | |
|---|---|
void |
addNntpsEventListener(NntpsEventListener l)
|
java.lang.String |
config(java.lang.String configurationString)
Sets or retrieves a {@link ipworksssl.Nntps#config configuration setting. |
void |
connect()
Connects to the news server. |
void |
disconnect()
Disconnects from the news server. |
void |
doEvents()
Processes events from the internal message queue. |
void |
fetchArticle()
Get the headers and body of an article specified in CurrentArticle . |
void |
fetchArticleBody()
Gets only the body of an article specified in CurrentArticle . |
void |
fetchArticleHeaders()
Gets only the headers of an article specified in CurrentArticle . |
int |
getArticleCount()
The estimated number of articles in CurrentGroup . |
java.lang.String |
getArticleDate()
The date of the current article. |
java.lang.String |
getArticleFrom()
The email address of the author (for posting articles). |
java.lang.String |
getArticleHeaders()
The full headers of the article as retrieved from the server. |
java.lang.String |
getArticleId()
The message identifier of the current article. |
ArticleInfoList |
getArticleList()
Collection of articles collected through GroupOverview or GroupSearch . |
java.lang.String |
getArticleReferences()
Articles to which the posted article follows up. |
java.lang.String |
getArticleReplyTo()
The address to reply to (for posting articles). |
java.lang.String |
getArticleSubject()
The article subject (for posted articles). |
java.lang.String |
getArticleText()
The full text of the article (without the headers). |
java.lang.String |
getAttachedFile()
A file name which the contents of will be appended to the ArticleText when posting articles. |
java.lang.String |
getCheckDate()
The date (format YYMMDD HHMMSS) to check for creation of new groups. |
java.lang.String |
getCurrentArticle()
The number or message identifier of the current article. |
java.lang.String |
getCurrentGroup()
The name of the current group. |
Firewall |
getFirewall()
A set of properties related to firewall access. |
int |
getFirstArticle()
The number of the first article in CurrentGroup . |
GroupInfoList |
getGroupList()
Collection of newsgroups listed by ListGroups or ListNewGroups . |
int |
getLastArticle()
The number of the last article in CurrentGroup . |
java.lang.String |
getLastReply()
The last reply from the server. |
java.lang.String |
getLocalFile()
The path to a local file for downloading the article body. |
java.lang.String |
getLocalHost()
The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
int |
getMaxLines()
The maximum number of message lines aside from headers to retrieve. |
java.lang.String |
getNewsgroups()
A comma separated list of newsgroups in which to post the article. |
int |
getNewsPort()
The server port for secure NNTP (default 563). |
java.lang.String |
getNewsServer()
The name or address of a news server. |
java.lang.String |
getOrganization()
The organization of the author (for posting articles). |
java.lang.String |
getOtherHeaders()
An RFC850 compliant string consisting of extra headers (for posting articles). |
java.lang.String |
getOverviewRange()
A range for the GroupOverview method (first-last). |
HeaderList |
getParsedHeaders()
A collection of headers returned from the last article retrieval. |
java.lang.String |
getPassword()
A logon password for the NewsServer . |
java.lang.String |
getSearchHeader()
A header for the GroupSearch method. |
java.lang.String |
getSearchPattern()
A search pattern for the GroupSearch method. |
java.lang.String |
getSearchRange()
A range for the GroupSearch method (first-last). |
Certificate |
getSSLAcceptServerCert()
Instructs the bean to unconditionally accept the server certificate that matches the supplied certificate. |
Certificate |
getSSLCert()
The certificate to be used during SSL negotiation. |
Certificate |
getSSLServerCert()
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. |
java.lang.String |
getUser()
A user identifier to login as in the NewsServer . |
void |
groupOverview()
Receives an overview for the articles in range OverviewRange in the CurrentGroup . |
void |
groupSearch()
Receives an overview for the articles in range SearchRange in the CurrentGroup . |
void |
interrupt()
Interrupt the current method. |
boolean |
isConnected()
Shows whether the bean is connected. |
boolean |
isIdle()
The current status of the component. |
void |
listGroups()
Lists all groups on the server. |
void |
listNewGroups()
Lists all new groups on the server. |
java.lang.String |
localizeDate(java.lang.String dateTime)
Converts a valid RFC 822 message date to local date and time. |
void |
postArticle()
Posts the current article and attached file. |
void |
removeNntpsEventListener(NntpsEventListener l)
|
void |
resetHeaders()
Resets all of the article headers. |
void |
setArticleFrom(java.lang.String articleFrom)
The email address of the author (for posting articles). |
void |
setArticleReferences(java.lang.String articleReferences)
Articles to which the posted article follows up. |
void |
setArticleReplyTo(java.lang.String articleReplyTo)
The address to reply to (for posting articles). |
void |
setArticleStream(java.io.OutputStream articleStream)
Sets the stream to which the article downloaded from the server will be written. |
void |
setArticleSubject(java.lang.String articleSubject)
The article subject (for posted articles). |
void |
setArticleText(java.lang.String articleText)
The full text of the article (without the headers). |
void |
setAttachedFile(java.lang.String attachedFile)
A file name which the contents of will be appended to the ArticleText when posting articles. |
void |
setCheckDate(java.lang.String checkDate)
The date (format YYMMDD HHMMSS) to check for creation of new groups. |
void |
setCommand(java.lang.String command)
Used to send additional commands directly to the server. |
void |
setConnected(boolean connected)
Shows whether the bean is connected. |
void |
setCurrentArticle(java.lang.String currentArticle)
The number or message identifier of the current article. |
void |
setCurrentGroup(java.lang.String currentGroup)
The name of the current group. |
void |
setFirewall(Firewall firewall)
A set of properties related to firewall access. |
void |
setLocalFile(java.lang.String localFile)
The path to a local file for downloading the article 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 |
setMaxLines(int maxLines)
The maximum number of message lines aside from headers to retrieve. |
void |
setNewsgroups(java.lang.String newsgroups)
A comma separated list of newsgroups in which to post the article. |
void |
setNewsPort(int newsPort)
The server port for secure NNTP (default 563). |
void |
setNewsServer(java.lang.String newsServer)
The name or address of a news server. |
void |
setOrganization(java.lang.String organization)
The organization of the author (for posting articles). |
void |
setOtherHeaders(java.lang.String otherHeaders)
An RFC850 compliant string consisting of extra headers (for posting articles). |
void |
setOverviewRange(java.lang.String overviewRange)
A range for the GroupOverview method (first-last). |
void |
setPassword(java.lang.String password)
A logon password for the NewsServer . |
void |
setSearchHeader(java.lang.String searchHeader)
A header for the GroupSearch method. |
void |
setSearchPattern(java.lang.String searchPattern)
A search pattern for the GroupSearch method. |
void |
setSearchRange(java.lang.String searchRange)
A range for the GroupSearch method (first-last). |
void |
setSSLAcceptServerCert(Certificate SSLAcceptServerCert)
Instructs the bean to unconditionally accept the server certificate that matches the supplied certificate. |
void |
setSSLCert(Certificate SSLCert)
The certificate to be used during SSL negotiation. |
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)
A user identifier to login as in the NewsServer . |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int sslAutomatic
public static final int sslImplicit
public static final int sslExplicit
public static final int sslNone
| Constructor Detail |
|---|
public Nntps()
public Nntps(java.lang.String runtimeLicense)
| Method Detail |
|---|
public int getArticleCount()
CurrentGroup .
This property contains the estimated number of articles in CurrentGroup The value of this property is 0 if there is no current
group ( CurrentGroup is ""). Otherwise, when CurrentGroup is set it is the
number of articles in the group as shown by the news
server. For most
news servers, this is an estimated value of the
number of the articles, rather than the exact value.
public java.lang.String getArticleDate()
This property contains the date of the current article. If the bean is not connected or CurrentArticle is empty, the value of this property is an
empty string. Otherwise, it contains the date of the article as reported by the server.
The NewsServer is asked about the headers of the article only if the CurrentArticle property has
changed. If CurrentArticle has not changed, the bean returns a cached value.
public java.lang.String getArticleFrom()
This property contains the email address of the author (for posting articles). The string in this property is posted with a From article header to the news server.
If the resulting header is longer than {@link ipworksssl.Nntps#config , then it is folded according to RFC 850 specifications.
public void setArticleFrom(java.lang.String articleFrom)
throws IPWorksSSLException
This property contains the email address of the author (for posting articles). The string in this property is posted with a From article header to the news server.
If the resulting header is longer than {@link ipworksssl.Nntps#config , then it is folded according to RFC 850 specifications.
IPWorksSSLExceptionpublic java.lang.String getArticleHeaders()
This property contains the full headers of the article as retrieved from the server. If the bean is not connected or the CurrentArticle is empty,
the value of this property is an
empty string. Otherwise, it contains the full headers of the article
as reported by the server.
The NewsServer is asked about the headers of the article only
if the CurrentArticle property has changed. If CurrentArticle has not changed, the bean returns a cached value.
public java.lang.String getArticleId()
This property contains the message identifier of the current article. If the bean is not connected or the CurrentArticle is empty, the value of this property is an
empty string. Otherwise, it contains the message identifier of the article as reported by the server.
The NewsServer is asked about the headers of the article only if the CurrentArticle property has
changed. If the CurrentArticle has not changed, the bean returns a cached value.
public ArticleInfoList getArticleList()
GroupOverview or GroupSearch .
This property contains a collection of articles collected through GroupOverview or GroupSearch . This collection consists of a list of articleinfo objects. The returned list contains information
about each article in the OverviewRange or SearchRange when
either GroupOverview or GroupSearch is
called.
{@link ipworksssl.Nntps#config can be used to control the number of articles saved.
This collection is indexed from 0 to size - 1.
public java.lang.String getArticleReferences()
This property contains articles to which the posted article follows up. If this property contains a non-empty string, a References article header is created for the article. This header shows the article identifiers for the posted article to which it refers.
The references must be separated by space characters.
If the resulting header is longer than {@link ipworksssl.Nntps#config , then it is folded according to RFC 850 specifications.
public void setArticleReferences(java.lang.String articleReferences)
throws IPWorksSSLException
This property contains articles to which the posted article follows up. If this property contains a non-empty string, a References article header is created for the article. This header shows the article identifiers for the posted article to which it refers.
The references must be separated by space characters.
If the resulting header is longer than {@link ipworksssl.Nntps#config , then it is folded according to RFC 850 specifications.
IPWorksSSLExceptionpublic java.lang.String getArticleReplyTo()
This property contains the address to reply to (for posting articles). If this property contains a non-empty string,
a Reply-To article header is created for the article.
This header shows the address to use for replies (useful
if this address is different from the one in ArticleFrom ).
If the resulting header is longer than {@link ipworksssl.Nntps#config , then it is folded according to RFC 850 specifications.
public void setArticleReplyTo(java.lang.String articleReplyTo)
throws IPWorksSSLException
This property contains the address to reply to (for posting articles). If this property contains a non-empty string,
a Reply-To article header is created for the article.
This header shows the address to use for replies (useful
if this address is different from the one in ArticleFrom ).
If the resulting header is longer than {@link ipworksssl.Nntps#config , then it is folded according to RFC 850 specifications.
IPWorksSSLExceptionpublic java.lang.String getArticleSubject()
The string in this property is posted with a Subject article header to the news server.
If the resulting header is longer than {@link ipworksssl.Nntps#config , then it is folded according to RFC 850 specifications.
public void setArticleSubject(java.lang.String articleSubject)
throws IPWorksSSLException
The string in this property is posted with a Subject article header to the news server.
If the resulting header is longer than {@link ipworksssl.Nntps#config , then it is folded according to RFC 850 specifications.
IPWorksSSLExceptionpublic java.lang.String getArticleText()
This property contains the full text of the article (without the headers). If the bean is not connected or CurrentArticle is empty,
the value of this property is an
empty string. Otherwise, it contains the full text of the article
as reported by the server.
The NewsServer is asked about the text of the article only
if the CurrentArticle property has changed. If CurrentArticle has not changed, the bean returns a cached value.
When posting articles, this property contains the full text of the article to post.
It is advisable that the text contained in this property be a collection of lines with lengths less than or equal to 80 bytes separated by CRLF ("\r\ n") . The text in the article lines must contain 7-bit characters so that the article can be successfully transferred through the various Usenet news servers on the Internet.
The bean automatically escapes lines that start with a "." by adding another "." as specified in RFC 977. The article text is unescaped by the news server, so the process is fully transparent.
public void setArticleText(java.lang.String articleText)
throws IPWorksSSLException
This property contains the full text of the article (without the headers). If the bean is not connected or CurrentArticle is empty,
the value of this property is an
empty string. Otherwise, it contains the full text of the article
as reported by the server.
The NewsServer is asked about the text of the article only
if the CurrentArticle property has changed. If CurrentArticle has not changed, the bean returns a cached value.
When posting articles, this property contains the full text of the article to post.
It is advisable that the text contained in this property be a collection of lines with lengths less than or equal to 80 bytes separated by CRLF ("\r\ n") . The text in the article lines must contain 7-bit characters so that the article can be successfully transferred through the various Usenet news servers on the Internet.
The bean automatically escapes lines that start with a "." by adding another "." as specified in RFC 977. The article text is unescaped by the news server, so the process is fully transparent.
IPWorksSSLExceptionpublic java.lang.String getAttachedFile()
The content of this property is appended to the text
in ArticleText (if any) and sent to the news server.
This property is useful for posting arbitrarily large
articles and/or sending MIME attachments.
It is advisable that the text contained in the file be a collection of lines with lengths less than or equal to 80 bytes separated by CRLF ("\r\ n") . The text in the message lines must contain only 7-bit characters so that the message may be successfully sent through the various Usenet news servers on the Internet.
The bean automatically escapes lines that start with a "." by adding another as specified in RFC 822. The article text is unescaped by the news server, so the process is fully transparent.
public void setAttachedFile(java.lang.String attachedFile)
throws IPWorksSSLException
The content of this property is appended to the text
in ArticleText (if any) and sent to the news server.
This property is useful for posting arbitrarily large
articles and/or sending MIME attachments.
It is advisable that the text contained in the file be a collection of lines with lengths less than or equal to 80 bytes separated by CRLF ("\r\ n") . The text in the message lines must contain only 7-bit characters so that the message may be successfully sent through the various Usenet news servers on the Internet.
The bean automatically escapes lines that start with a "." by adding another as specified in RFC 822. The article text is unescaped by the news server, so the process is fully transparent.
IPWorksSSLExceptionpublic java.lang.String getCheckDate()
This property contains the date (format YYMMDD HHMMSS) to check for creation of new groups. If the group was
created after the date specified, it is considered new. The value of this property is used as an argument for
the ListNewGroups method.
public void setCheckDate(java.lang.String checkDate)
throws IPWorksSSLException
This property contains the date (format YYMMDD HHMMSS) to check for creation of new groups. If the group was
created after the date specified, it is considered new. The value of this property is used as an argument for
the ListNewGroups method.
IPWorksSSLException
public void setCommand(java.lang.String command)
throws IPWorksSSLException
This property can be used to send additional commands directly to the server. Check the LastReply property and/or trap the PITrail events
coming from the server to get the response.
IPWorksSSLExceptionpublic boolean isConnected()
This property is used to determine whether or not the bean is connected to the remote host.
public void setConnected(boolean connected)
throws IPWorksSSLException
This property is used to determine whether or not the bean is connected to the remote host.
IPWorksSSLExceptionpublic java.lang.String getCurrentArticle()
This property specifies either
a message identifier or an article number uniquely identifying
a particular article. It is then used as an argument
to methods such as FetchArticle .
public void setCurrentArticle(java.lang.String currentArticle)
throws IPWorksSSLException
This property specifies either
a message identifier or an article number uniquely identifying
a particular article. It is then used as an argument
to methods such as FetchArticle .
IPWorksSSLExceptionpublic java.lang.String getCurrentGroup()
This property contains the name of the current group. When this property is set to a valid
group name, the bean sends an NNTP GROUP command to the NewsServer and enters the specified
group. If the command is successful, FirstArticle , LastArticle , and ArticleCount are set to the
reported values for the group. This property is then
used for all references to articles (until changed to
another group).
public void setCurrentGroup(java.lang.String currentGroup)
throws IPWorksSSLException
This property contains the name of the current group. When this property is set to a valid
group name, the bean sends an NNTP GROUP command to the NewsServer and enters the specified
group. If the command is successful, FirstArticle , LastArticle , and ArticleCount are set to the
reported values for the group. This property is then
used for all references to articles (until changed to
another group).
IPWorksSSLExceptionpublic Firewall getFirewall()
This is a Firewall type property which
contains fields describing the firewall
through which the bean will attempt to connect.
public void setFirewall(Firewall firewall)
throws IPWorksSSLException
This is a Firewall type property which
contains fields describing the firewall
through which the bean will attempt to connect.
IPWorksSSLExceptionpublic int getFirstArticle()
CurrentGroup .
This property contains the number of the first article in CurrentGroup . The value of this property is 0 if there is no current
group ( CurrentGroup is "").
public GroupInfoList getGroupList()
ListGroups or ListNewGroups .
This property contains a collection of newsgroups listed by ListGroups or ListNewGroups . This collection consists of a list of groupinfo objects. These objects contain information
about each group such as the name, first and last
article, and whether or not you can post to the group.
{@link ipworksssl.Nntps#config can be used to control the number of groups saved.
This collection is indexed from 0 to size - 1.
public 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 int getLastArticle()
CurrentGroup .
This property contains the number of the last article in CurrentGroup . The value of this property is 0 if there is no current
group ( CurrentGroup is "").
public java.lang.String getLastReply()
This property indicates the last reply received from the server. It
can be used for informational purposes. The same information
and more can also be retrieved through the PITrail event.
public java.lang.String getLocalFile()
This property is used when retrieving an article.
If this property is empty then the received data is provided through
the parameters of the Transfer event
public void setLocalFile(java.lang.String localFile)
throws IPWorksSSLException
This property is used when retrieving an article.
If this property 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 multi-homed 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 multi-homed
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 multi-homed 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 multi-homed
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 getMaxLines()
This property is used to limit the number
of text lines aside from headers retrieved for messages.
This property is used in conjunction with the ArticleText property. Please note that due to NNTP protocol limitations,
the full text of the article
is always retrieved from the server, but only MaxLines will be stored in ArticleText .
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
This property is used to limit the number
of text lines aside from headers retrieved for messages.
This property is used in conjunction with the ArticleText property. Please note that due to NNTP protocol limitations,
the full text of the article
is always retrieved from the server, but only MaxLines will be stored in ArticleText .
The default value of the property is 0. In this case the entire message will be retrieved, without interruptions.
IPWorksSSLExceptionpublic java.lang.String getNewsgroups()
The string in this property is posted with a Newsgroups article header to the news server. It specifies the list of groups where the article is posted (comma separated).
If this property contains "" (empty string), then
the value of the CurrentGroup property is used to specify
the target newsgroup for the posted article.
If the resulting header is longer than {@link ipworksssl.Nntps#config , then it is folded according to RFC 850 specifications.
public void setNewsgroups(java.lang.String newsgroups)
throws IPWorksSSLException
The string in this property is posted with a Newsgroups article header to the news server. It specifies the list of groups where the article is posted (comma separated).
If this property contains "" (empty string), then
the value of the CurrentGroup property is used to specify
the target newsgroup for the posted article.
If the resulting header is longer than {@link ipworksssl.Nntps#config , then it is folded according to RFC 850 specifications.
IPWorksSSLExceptionpublic int getNewsPort()
This property contains the server port for NNTP (default 119). 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.
public void setNewsPort(int newsPort)
throws IPWorksSSLException
This property contains the server port for NNTP (default 119). 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.
IPWorksSSLExceptionpublic java.lang.String getNewsServer()
This property specifies the IP address (IP number in dotted internet format) or the Domain Name for the news server. It is set before a connection is attempted and cannot be changed once a connection is in progress.
If this property is set to a Domain Name, a DNS request is initiated and upon successful termination of the request, this property is set to the corresponding address. If the search is not successful, an error is returned.
If the bean is configured to use a SOCKS firewall, the value assigned to this property may be preceded with an "*". If this is the case, the host name is passed to the firewall unresolved and the firewall performs the DNS resolution.
public void setNewsServer(java.lang.String newsServer)
throws IPWorksSSLException
This property specifies the IP address (IP number in dotted internet format) or the Domain Name for the news server. It is set before a connection is attempted and cannot be changed once a connection is in progress.
If this property is set to a Domain Name, a DNS request is initiated and upon successful termination of the request, this property is set to the corresponding address. If the search is not successful, an error is returned.
If the bean is configured to use a SOCKS firewall, the value assigned to this property may be preceded with an "*". If this is the case, the host name is passed to the firewall unresolved and the firewall performs the DNS resolution.
IPWorksSSLExceptionpublic java.lang.String getOrganization()
This property contains the organization of the article's author. If this property contains a non-empty string, an Organization article header is created for the article. This header shows the organization of the author and is used for information purposes only.
If the resulting header is longer than {@link ipworksssl.Nntps#config , then it is folded according to RFC 850 specifications.
public void setOrganization(java.lang.String organization)
throws IPWorksSSLException
This property contains the organization of the article's author. If this property contains a non-empty string, an Organization article header is created for the article. This header shows the organization of the author and is used for information purposes only.
If the resulting header is longer than {@link ipworksssl.Nntps#config , then it is folded according to RFC 850 specifications.
IPWorksSSLExceptionpublic java.lang.String getOtherHeaders()
This property contains a string of headers
to be appended to the message headers created from other
properties like From , Subject , etc.
The headers must be of the format "header: value" as specified in RFC 850. [Header lines should be separated by CRLF ("\r\ n") .
Use this property with caution. If this property contains invalid headers, article posting might not be successful.
This property is useful for extending the functionality of the bean. A good example is posting of MIME attachments.
SPECIAL CASE: if this property starts with an empty line (CRLF), then the value of this property is used instead of the normally computed article headers.
public void setOtherHeaders(java.lang.String otherHeaders)
throws IPWorksSSLException
This property contains a string of headers
to be appended to the message headers created from other
properties like From , Subject , etc.
The headers must be of the format "header: value" as specified in RFC 850. [Header lines should be separated by CRLF ("\r\ n") .
Use this property with caution. If this property contains invalid headers, article posting might not be successful.
This property is useful for extending the functionality of the bean. A good example is posting of MIME attachments.
SPECIAL CASE: if this property starts with an empty line (CRLF), then the value of this property is used instead of the normally computed article headers.
IPWorksSSLExceptionpublic java.lang.String getOverviewRange()
GroupOverview method (first-last).
This property specifies a range of articles for which to retrieve article overviews from the server. The format is 'first-last' where first is "" (empty string) or a positive number, and last is "" (empty string), a positive number, or the token end .
The default value of this property is '-', meaning 'all articles in the group' .
public void setOverviewRange(java.lang.String overviewRange)
throws IPWorksSSLException
GroupOverview method (first-last).
This property specifies a range of articles for which to retrieve article overviews from the server. The format is 'first-last' where first is "" (empty string) or a positive number, and last is "" (empty string), a positive number, or the token end .
The default value of this property is '-', meaning 'all articles in the group' .
IPWorksSSLExceptionpublic HeaderList getParsedHeaders()
This property contains a collection of headers returned from the last article retrieval. This property is populated when either FetchArticle or FetchArticleHeaders is called, and contains a list of all of the headers from
the article fetched.
If the header line being retrieved is a continuation header line, then the Field parameter contains "" (empty string).
{@link ipworksssl.Nntps#config can be used to control the number of headers saved.
This collection is indexed from 0 to size - 1.
public java.lang.String getPassword()
NewsServer .
This property contains a logon password for the NewsServer . If this property is set to a non-empty string,
then when connecting to the NewsServer an AUTHINFO PASS
command is sent in order to provide authentication
information for the user. This command is not part
of the NNTP protocol, but it is widely used by popular
news servers.
public void setPassword(java.lang.String password)
throws IPWorksSSLException
NewsServer .
This property contains a logon password for the NewsServer . If this property is set to a non-empty string,
then when connecting to the NewsServer an AUTHINFO PASS
command is sent in order to provide authentication
information for the user. This command is not part
of the NNTP protocol, but it is widely used by popular
news servers.
IPWorksSSLExceptionpublic java.lang.String getSearchHeader()
GroupSearch method.
This property specifies the header to search
for SearchPattern (e.g. "Subject").
public void setSearchHeader(java.lang.String searchHeader)
throws IPWorksSSLException
GroupSearch method.
This property specifies the header to search
for SearchPattern (e.g. "Subject").
IPWorksSSLExceptionpublic java.lang.String getSearchPattern()
GroupSearch method.
This property contains a search pattern for the GroupSearch method. The format of the pattern is the same as the patterns used
by the UNIX 'find' command.
As an example, "* new *" will match all headers that contain the word "new".
public void setSearchPattern(java.lang.String searchPattern)
throws IPWorksSSLException
GroupSearch method.
This property contains a search pattern for the GroupSearch method. The format of the pattern is the same as the patterns used
by the UNIX 'find' command.
As an example, "* new *" will match all headers that contain the word "new".
IPWorksSSLExceptionpublic java.lang.String getSearchRange()
GroupSearch method (first-last).
This property specifies a range of articles for which to do a search on the server. The format is 'first-last' where first is "" (empty string) or a positive number, and last is "" (empty string), a positive number, or the token end .
The default value of the property is '-', meaning 'search all articles in the group' .
public void setSearchRange(java.lang.String searchRange)
throws IPWorksSSLException
GroupSearch method (first-last).
This property specifies a range of articles for which to do a search on the server. The format is 'first-last' where first is "" (empty string) or a positive number, and last is "" (empty string), a positive number, or the token end .
The default value of the property is '-', meaning 'search all articles in the group' .
IPWorksSSLExceptionpublic Certificate 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, this property may create a security breach. Use it at your own risk.
public void setSSLAcceptServerCert(Certificate 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, this property may create a security breach. Use it at your own risk.
IPWorksSSLExceptionpublic Certificate getSSLCert()
The digital certificate that the bean will use
during SSL negotiation. Set this property to a valid
certificate before starting SSL negotiation. To set
a certificate, you may set the Encoded field to
the encoded certificate. To select a certificate, use
the store and subject fields.
public void setSSLCert(Certificate SSLCert)
throws IPWorksSSLException
The digital certificate that the bean will use
during SSL negotiation. Set this property to a valid
certificate before starting SSL negotiation. To set
a certificate, you may set the Encoded field to
the encoded certificate. To select a certificate, use
the store and subject fields.
IPWorksSSLExceptionpublic Certificate getSSLServerCert()
SSLServerCert contains the server certificate for the
last established connection.
SSLServerCert is reset 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 exception.
Please note that by default, all timeouts are inactivity timeouts ,
i.e. the timeout period is extended by Timeout seconds when
any amount of 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 the ipworksssl.Nntps#config configuration setting.
The default value for the {@link ipworksssl.Nntps#getTimeout 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 exception.
Please note that by default, all timeouts are inactivity timeouts ,
i.e. the timeout period is extended by Timeout seconds when
any amount of 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 the ipworksssl.Nntps#config configuration setting.
The default value for the {@link ipworksssl.Nntps#getTimeout Timeout} property is 60 (seconds).
IPWorksSSLExceptionpublic java.lang.String getUser()
NewsServer .
This property contains a user identifier to login as in the NewsServer . If this property is set to a non-empty string,
then when connecting to the NewsServer an AUTHINFO USER
command is sent in order to provide authentication
information for the user. Although this command is not part
of the NNTP protocol, it is widely used by news servers for
authentication purposes.
public void setUser(java.lang.String user)
throws IPWorksSSLException
NewsServer .
This property contains a user identifier to login as in the NewsServer . If this property is set to a non-empty string,
then when connecting to the NewsServer an AUTHINFO USER
command is sent in order to provide authentication
information for the user. Although this command is not part
of the NNTP protocol, it is widely used by news servers for
authentication purposes.
IPWorksSSLException
public java.lang.String config(java.lang.String configurationString)
throws IPWorksSSLException
{@link ipworksssl.Nntps#config Config} is a generic method available in every bean. It is used to set and retrieve {@link ipworksssl.Nntps#config configuration settingsfor the bean.
These 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 {@link ipworksssl.Nntps#config 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 {@link ipworksssl.Nntps#config configuration setting, you must call Config("PROPERTY") . The value will be returned as a string.
The bean accepts one or more of the following configuration settings . 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 {@link ipworksssl.Nntps#config Config} method.
NOTE: This is the same as Host . This setting is provided for use by beans that do not directly expose Firewall properties.
{@link ipworksssl.Nntps#getRemotePort RemotePort} is the port in which the firewall will listen to. If set to 0, the firewall will select a random port. The binding (address and port) is provided through the {@link ipworksssl.NntpsConnectionStatusEvent ConnectionStatus} event.
The connection to the firewall is made by calling the {@link ipworksssl.Nntps#connect Connect} method.
In the second scenario, {@link ipworksssl.Nntps#config is a positive value, the system will attempt to send pending data until the specified {@link ipworksssl.Nntps#config is reached. If this attempt fails, then the system will reset the connection.
The default behavior (which is also the default mode for stream sockets) might result in a long delay in closing the connection. Although the bean returns control immediately, the system could hold system resources until all pending data is sent (even after your application closes).
Setting this property to False forces an immediate disconnection. If you know that the other side has received all the data you sent (by a client acknowledgment, for example), setting this property to False might be the appropriate course of action.
If the bean is connected, the {@link ipworksssl.Nntps#getLocalHost LocalHost} setting 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 multi-homed hosts (machines with more than one IP interface).
{@link ipworksssl.Nntps#getLocalPort LocalPort} cannot be changed once a connection is made. Any attempt to set this when a connection is active will generate an error.
This; setting is useful when trying to connect to services that require a trusted port in the client side. An example is the remote shell (rsh) service in UNIX systems.
If no {@link ipworksssl.Nntps#getEOL EOL} is found, and {@link ipworksssl.Nntps#config bytes are accumulated in the buffer, the {@link ipworksssl.NntpsDataInEvent DataIn} event is fired with the EOL parameter set to False, and the buffer is reset.
The minimum value for {@link ipworksssl.Nntps#config is 256 bytes. The default value is 2048 bytes. The maximum value is 65536 bytes.
Use this setting with caution. Requesting a lower cipher strength than necessary could potentially cause serious security vulnerabilities in your application.
When the provider is OpenSSL, SSLCipherStrength is currently not supported. This functionality is instead made available through the {@link ipworksssl.Nntps#config config setting.
When the provider is OpenSSL, SSLCipherStrength is currently not supported. This functionality is instead made available through the {@link ipworksssl.Nntps#config config setting.
TLS 1.1 and TLS1.2 support are only available starting with Windows 7.
The special value "*" (default) picks the default SSL provider defined in the system.
Note: On Windows systems, the default SSL Provider is "Microsoft Unified Security Protocol Provider" and cannot be changed.
The special value "*" means that the component will pick all of the supported cipher suites. If SSLEnabledCipherSuites is set to any other value, only the specified cipher suites will be considered.
Multiple cipher suites are separated by semicolons.
Example values:
obj.config("SSLEnabledCipherSuites=*");
obj.config("SSLEnabledCipherSuites=SSL_RSA_WITH_RC4_128_SHA");
obj.config("SSLEnabledCipherSuites=SSL_RSA_WITH_RC4_128_SHA; SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA"); Possible values include:
SSLEnabledCipherSuites is used together with SSLCipherStrength .
Note: This configuration setting is available only in .NET and Java.
obj.Config("SSLEnabledProtocols=3072"); // TLS1.2 (supports SHA_256)
obj.Config("SSLAlgorithmList=CALG_SHA_256;CALG_MD5"); Possible values include:
This option is only valid in Windows.
IPWorksSSLException
public void connect()
throws IPWorksSSLException
This method is used to connect to the news server. If the User and/or Password are set,
then corresponding AUTHINFO commands are sent to the NewsServer as well.
IPWorksSSLException
public void disconnect()
throws IPWorksSSLException
This method is used to disconnect from the NewsServer . First the bean attempts to send
a QUIT command, and if that fails, the connection is broken.
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 fetchArticle()
throws IPWorksSSLException
CurrentArticle .
This method gets the headers and body of the article specified in CurrentArticle .
The headers are delivered via the Header event, and the article body
via the Transfer event.
If a connection to the NewsServer doesn't
already exist, a new one is created.
IPWorksSSLException
public void fetchArticleBody()
throws IPWorksSSLException
CurrentArticle .
This method gets only the body of the article specified in CurrentArticle .
The body via the Transfer event.
If a connection to the NewsServer doesn't already exist, a new one is created.
IPWorksSSLException
public void fetchArticleHeaders()
throws IPWorksSSLException
CurrentArticle .
This method gets only the headers of the article specified in CurrentArticle .
The headers are delivered via the Header event.
If a connection to the NewsServer doesn't already exist, a new
one is created.
IPWorksSSLException
public void groupOverview()
throws IPWorksSSLException
OverviewRange in the CurrentGroup .
This method receives an overview for the articles in range OverviewRange in the CurrentGroup . The overview data is delivered via the GroupOverview event.
If a connection to the NewsServer doesn't already exist, a new
one is created.
IPWorksSSLException
public void groupSearch()
throws IPWorksSSLException
SearchRange in the CurrentGroup .
This method searches the current newsgroup for articles in range SearchRange in the CurrentGroup , where SearchHeader matches SearchPattern . The results
are delivered via the GroupSearch event.
If a connection to the NewsServer doesn't already exist, a new
one is created.
IPWorksSSLException
public void interrupt()
throws IPWorksSSLException
If there is no method in progress, Interrupt simply returns, doing nothing.
IPWorksSSLException
public void listGroups()
throws IPWorksSSLException
This method asks the server to list all its newsgroups. Use this method with
caution as listing groups may take quite a long over slow links. The group names and
other information are returned via the GroupList event.
If a connection to the NewsServer doesn't already exist, a new one
is created.
IPWorksSSLException
public void listNewGroups()
throws IPWorksSSLException
This method asks the server to list all the newsgroups created since CheckDate .
The group names (if any) and other information are returned via the GroupList event.
If a connection to the NewsServer doesn't already exist,
a new one is created.
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 postArticle()
throws IPWorksSSLException
This method posts the current article and attached file (if any). If a connection to the NewsServer doesn't already exist, a new one is created.
IPWorksSSLException
public void resetHeaders()
throws IPWorksSSLException
This method resets all the article headers to "" (empty string). Use this method before posting a new article, so that headers from the previous article are not carried over to the next one.
IPWorksSSLException
public void setArticleStream(java.io.OutputStream articleStream)
throws IPWorksSSLException
This method sets the stream to which the article downloaded from the server will be written. If a download stream is set before the FetchArticle or FetchArticleBody methods are called, the downloaded data will be written to the stream. The stream should be open and normally set to position 0.
The bean will automatically close this stream if ipworksssl.Nntps#config is set to true (default). If the stream is closed, you will need to call {@link ipworksssl.Nntps#setArticleStream SetArticleStream} again before calling {@link ipworksssl.Nntps#fetchArticle FetchArticle} or {@link ipworksssl.Nntps#fetchArticleBody FetchArticleBody} again.
The downloaded content will be written starting at the current position in the stream.
Note: {@link ipworksssl.Nntps#setArticleStream SetArticleStream} and {@link ipworksssl.Nntps#getLocalFile LocalFile} will reset the other.
IPWorksSSLException
public void addNntpsEventListener(NntpsEventListener l)
throws java.util.TooManyListenersException
java.util.TooManyListenersExceptionpublic void removeNntpsEventListener(NntpsEventListener l)
|
IP*Works! SSL V9 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||