|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ipworks.Nntp
The NNTP control is used to read and post articles on Usenet news servers.
The NNTP control 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 control operates mainly by calling methods. Setting action codes to
the Action
property will achieve identical results. The CurrentGroup
property sets the current newsgroup. From then on, news articles from that
group can be read by setting the article number in CurrentArticle
and
then setting the appropriate method or Action
code. Properties such as ArticleCount
, FirstArticle
, LastArticle
provide information about
the current state.
The headers and text of the articles are received respectively through the Header
and Transfer
events. Additionally, up to MaxLines
from the article body are provided
in the ArticleText
property. The GroupOverview
event returns
information about a range of articles ( OverviewRange
) in CurrentGroup
,
and the GroupList
event is used when listing newsgroup names. The PITrail
event provides a trace of the interaction with the server.
The control supports posting of articles through the ArticleText
and AttachedFile
properties. The article text is specified in one or both
of the above, and then the PostArticle
method is called or the appropriate Action
code is sent. Article headers are given in a series of properties
like From
, Subject
, Organization
, etc. that map directly to the
USENET article header with the same name.
Field Summary | |
static int |
fwNone
|
static int |
fwSOCKS4
|
static int |
fwSOCKS5
|
static int |
fwTunnel
|
static int |
nntpConnect
|
static int |
nntpDisconnect
|
static int |
nntpGetArticle
|
static int |
nntpGetArticleBody
|
static int |
nntpGetArticleHeaders
|
static int |
nntpGroupOverview
|
static int |
nntpGroupSearch
|
static int |
nntpIdle
|
static int |
nntpListGroups
|
static int |
nntpListNewGroups
|
static int |
nntpPostArticle
|
static int |
nntpResetHeaders
|
Constructor Summary | |
Nntp()
|
Method Summary | |
void |
addNntpEventListener(NntpEventListener l)
|
void |
connect()
Connect to the news server. |
void |
disconnect()
Disconnect from the news server. |
void |
fetchArticle()
Get the headers and body of an article specified in CurrentArticle . |
void |
fetchArticleBody()
Get only the body of an article specified in CurrentArticle . |
void |
fetchArticleHeaders()
Get only the headers of an article specified in CurrentArticle . |
void |
fireEndTransfer()
Fired when the article text completes transferring. |
void |
fireError(int errorCode,
java.lang.String description)
Information about errors during data delivery. |
void |
fireGroupList(java.lang.String group,
int firstArticle,
int lastArticle,
boolean canPost)
Fired while group data transfers (during group listings). |
void |
fireGroupOverview(int articleNumber,
java.lang.String subject,
java.lang.String from,
java.lang.String articleDate,
java.lang.String messageId,
java.lang.String references,
int articleSize,
int articleLines,
java.lang.String otherHeaders)
Fired for each line of article overview data (during group overviews). |
void |
fireGroupSearch(int articleNumber,
java.lang.String header)
Fired for each line of group search data (during group searches). |
void |
fireHeader(java.lang.String field,
java.lang.String value)
Fired for every article header being retrieved during article retrieval. |
void |
firePITrail(int direction,
java.lang.String message)
Traces the commands sent to the mail server, and the respective replies. |
void |
fireStartTransfer()
Fired when the article text starts transferring. |
void |
fireTransfer(int bytesTransferred,
byte[] text,
boolean EOL)
Fired while the article text gets transferred (to or from the NewsServer ). |
int |
getAction()
An action code for the component. |
int |
getArticleCount()
The estimated number of articles in CurrentGroup . |
java.lang.String |
getArticleHeaders()
The full headers of the article as retrieved from the server. |
java.lang.String |
getArticleText()
The full text of the article (without the headers). |
java.lang.String |
getAttachedFile()
A file name which contents to append to ArticleText when posting articles. |
java.lang.String |
getCheckDate()
The date (format YYMMDD HHMMSS) since when to check for creation of new groups. |
java.lang.String |
getCurrentArticle()
The number or message-id of the current article. |
java.lang.String |
getCurrentGroup()
The name of the current group (action property). |
byte[] |
getFirewallData()
Used to send other data to firewall. |
java.lang.String |
getFirewallHost()
Name or IP address of firewall (optional). |
java.lang.String |
getFirewallPassword()
A password if authentication is to be used 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. |
int |
getFirstArticle()
The number of the first article in CurrentGroup. |
java.lang.String |
getFrom()
The email address of the author (for posting articles). |
int |
getLastArticle()
The number of the last article in CurrentGroup . |
java.lang.String |
getLastReply()
The last reply from the server. |
java.lang.String |
getLocalHost()
The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
int |
getMaxHeaderLength()
Maximum length for headers to avoid line folding (default 80). |
int |
getMaxLines()
The maximum number of message lines beside headers to retrieve. |
java.lang.String |
getNewsgroups()
A comma separated list of newsgroups where to post the article. |
int |
getNewsPort()
The server port for NNTP (default 119). |
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 nntpGroupOverview action (first-last). |
java.lang.String |
getPassword()
A login password to login with in the NewsServer . |
java.lang.String |
getReferences()
Articles the posted article follows up to. |
java.lang.String |
getReplyTo()
The address to reply to (for posting articles). |
java.lang.String |
getSearchHeader()
A header for the nntpGroupSearch action. |
java.lang.String |
getSearchPattern()
A search pattern for the nntpGroupSearch action. |
java.lang.String |
getSearchRange()
A range for the nntpGroupSearch action (first-last). |
java.lang.String |
getSubject()
The article subject (for posted articles). |
int |
getTimeout()
A timeout for the component. |
java.lang.String |
getUser()
A user id to login as in the NewsServer . |
void |
groupOverview()
Receive an overview for the articles in range OverviewRange in the CurrentGroup . |
void |
groupSearch()
Receive an overview for the articles in range OverviewRange in the CurrentGroup . |
void |
interrupt()
Interrupt the Action in progress (if any). |
boolean |
isConnected()
Shows whether the component is connected. |
void |
listGroups()
List all groups on the server. |
void |
listNewGroups()
List all new groups on the server. |
void |
postArticle()
Post the current article and attached file. |
void |
removeNntpEventListener(NntpEventListener l)
|
void |
resetHeaders()
Reset all of the article headers. |
void |
setAction(int action)
An action code for the component. |
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 contents to append to ArticleText when posting articles. |
void |
setCheckDate(java.lang.String checkDate)
The date (format YYMMDD HHMMSS) since when to check for creation of new groups. |
void |
setCommand(java.lang.String command)
Can be used to send additional commands directly to the NNTP server. |
void |
setCurrentArticle(java.lang.String currentArticle)
The number or message-id of the current article. |
void |
setCurrentGroup(java.lang.String currentGroup)
The name of the current group (action property). |
void |
setFirewallData(byte[] firewallData)
Used to send other data to firewall. |
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 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 |
setFrom(java.lang.String from)
The email address of the author (for posting articles). |
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 |
setMaxHeaderLength(int maxHeaderLength)
Maximum length for headers to avoid line folding (default 80). |
void |
setMaxLines(int maxLines)
The maximum number of message lines beside headers to retrieve. |
void |
setNewsgroups(java.lang.String newsgroups)
A comma separated list of newsgroups where to post the article. |
void |
setNewsPort(int newsPort)
The server port for NNTP (default 119). |
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 nntpGroupOverview action (first-last). |
void |
setPassword(java.lang.String password)
A login password to login with in the NewsServer . |
void |
setReferences(java.lang.String references)
Articles the posted article follows up to. |
void |
setReplyTo(java.lang.String replyTo)
The address to reply to (for posting articles). |
void |
setSearchHeader(java.lang.String searchHeader)
A header for the nntpGroupSearch action. |
void |
setSearchPattern(java.lang.String searchPattern)
A search pattern for the nntpGroupSearch action. |
void |
setSearchRange(java.lang.String searchRange)
A range for the nntpGroupSearch action (first-last). |
void |
setSubject(java.lang.String subject)
The article subject (for posted articles). |
void |
setTimeout(int timeout)
A timeout for the component. |
void |
setUser(java.lang.String user)
A user id 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 nntpIdle
public static final int nntpConnect
public static final int nntpDisconnect
public static final int nntpListGroups
public static final int nntpListNewGroups
public static final int nntpGroupOverview
public static final int nntpGetArticle
public static final int nntpGetArticleHeaders
public static final int nntpGetArticleBody
public static final int nntpPostArticle
public static final int nntpResetHeaders
public static final int nntpGroupSearch
public static final int fwNone
public static final int fwTunnel
public static final int fwSOCKS4
public static final int fwSOCKS5
Constructor Detail |
public Nntp()
Method Detail |
public int getAction()
Action
property to a valid action code makes
the control perform the associated action. If the action completes
successfully, execution continues normally, and Action
is
reset to 0 (Idle). If an error happens, then
an IPWorksException exception is raised.
The following are the possible values for the Action
property
and the corresponding descriptions:
User
and/or Password
are set,
then corresponding AUTHINFO commands are sent to the NewsServer
as well.
NewsServer
. First the control attempts to send
a QUIT command, and if that fails, the connection is broken.
GroupList
event.
If a connection
to the NewsServer
doesn't already exist, a new one is created.
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.
OverviewRange
in the CurrentGroup
. The overview data are delivered via the GroupOverview
event.
If a connection to the NewsServer
doesn't already exist, a new
one is created.
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.
CurrentArticle
.
The headers are delivered via the Header
event.
If a connection to
the NewsServer
doesn't already exist, a new one is created.
CurrentArticle
.
The body via the Transfer
event.
If a connection to the NewsServer
doesn't already exist, a new one is created.
NewsServer
doesn't already exist, a new one is created.
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.
public void setAction(int action) throws IPWorksException
Action
property to a valid action code makes
the control perform the associated action. If the action completes
successfully, execution continues normally, and Action
is
reset to 0 (Idle). If an error happens, then
an IPWorksException exception is raised.
The following are the possible values for the Action
property
and the corresponding descriptions:
User
and/or Password
are set,
then corresponding AUTHINFO commands are sent to the NewsServer
as well.
NewsServer
. First the control attempts to send
a QUIT command, and if that fails, the connection is broken.
GroupList
event.
If a connection
to the NewsServer
doesn't already exist, a new one is created.
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.
OverviewRange
in the CurrentGroup
. The overview data are delivered via the GroupOverview
event.
If a connection to the NewsServer
doesn't already exist, a new
one is created.
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.
CurrentArticle
.
The headers are delivered via the Header
event.
If a connection to
the NewsServer
doesn't already exist, a new one is created.
CurrentArticle
.
The body via the Transfer
event.
If a connection to the NewsServer
doesn't already exist, a new one is created.
NewsServer
doesn't already exist, a new one is created.
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.
public int getArticleCount()
CurrentGroup
is ""). Otherwise, it is the
number of articles in the group as shown by the news
server when CurrentGroup
is set. For most
news servers, this is an estimated value of the
number of the articles, rather than the exact value.
public java.lang.String getArticleHeaders()
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 control returns a cached value.
public java.lang.String getArticleText()
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 control returns a cached value.
When posting articles, the ArticleText
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 control 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 setArticleText(java.lang.String articleText) throws IPWorksException
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 control returns a cached value.
When posting articles, the ArticleText
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 control 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 java.lang.String getAttachedFile()
AttachedFile
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 control 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 IPWorksException
AttachedFile
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 control 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 java.lang.String getCheckDate()
Action
property for more information.
public void setCheckDate(java.lang.String checkDate) throws IPWorksException
Action
property for more information.
public void setCommand(java.lang.String command) throws IPWorksException
LastReply
property and/or trap the PITrail
events
comming from the server to get the response.
public boolean isConnected()
public java.lang.String getCurrentArticle()
CurrentArticle
property specifies either
a message id or an article number uniquely identifying
a particular article. It is then used as an argument
to actions like nntpGetArticle . Please refer to
the description of the Action
property for more
information.
public void setCurrentArticle(java.lang.String currentArticle) throws IPWorksException
CurrentArticle
property specifies either
a message id or an article number uniquely identifying
a particular article. It is then used as an argument
to actions like nntpGetArticle . Please refer to
the description of the Action
property for more
information.
public java.lang.String getCurrentGroup()
CurrentGroup
property is set to a valid
group name, the control sends an NNTP GROUP commands to the NewsServer
and enters the specified
group. If this action is successful, then FirstArticle
, LastArticle
, and ArticleCount
are set to the
reported values for the group. CurrentGroup
is then
used for all references to articles (until changed to
another group).
public void setCurrentGroup(java.lang.String currentGroup) throws IPWorksException
CurrentGroup
property is set to a valid
group name, the control sends an NNTP GROUP commands to the NewsServer
and enters the specified
group. If this action is successful, then FirstArticle
, LastArticle
, and ArticleCount
are set to the
reported values for the group. CurrentGroup
is then
used for all references to articles (until changed to
another group).
public byte[] getFirewallData()
public void setFirewallData(byte[] firewallData) throws IPWorksException
public java.lang.String getFirewallHost()
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 and 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 IPWorksException
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 and 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 java.lang.String getFirewallPassword()
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 IPWorksException
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 int getFirewallPort()
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 IPWorksException
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 int getFirewallType()
FirewallPort
is set to 80.
FirewallPort
is set to 1080.
FirewallPort
is set to 1080.
public void setFirewallType(int firewallType) throws IPWorksException
FirewallPort
is set to 80.
FirewallPort
is set to 1080.
FirewallPort
is set to 1080.
public java.lang.String getFirewallUser()
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 IPWorksException
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 int getFirstArticle()
CurrentGroup
is "").
public java.lang.String getFrom()
From
is posted with a From article header to the news server.
If the resulting From header is longer than MaxHeaderLength
, then it is folded according to
RFC 850 specifications.
public void setFrom(java.lang.String from) throws IPWorksException
From
is posted with a From article header to the news server.
If the resulting From header is longer than MaxHeaderLength
, then it is folded according to
RFC 850 specifications.
public int getLastArticle()
CurrentGroup
is "").
public java.lang.String getLastReply()
PITrail
event.
public java.lang.String getLocalHost()
LocalHost
property contains the name of the local host
as obtained by the gethostname() Winsock 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 control initiate connections (or accept in the case of server controls) only through that interface.
If the control 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 IPWorksException
LocalHost
property contains the name of the local host
as obtained by the gethostname() Winsock 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 control initiate connections (or accept in the case of server controls) only through that interface.
If the control 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 int getMaxHeaderLength()
MaxHeaderLength
specifies the maximum line length
supported by the news delivery system. Any headers longer
than MaxHeaderLength
are folded as specified in RFC 850.
It is generally a good idea to use a MaxHeaderLength
of less than 100 bytes, although different news servers
have different requirements for header lengths.
public void setMaxHeaderLength(int maxHeaderLength) throws IPWorksException
MaxHeaderLength
specifies the maximum line length
supported by the news delivery system. Any headers longer
than MaxHeaderLength
are folded as specified in RFC 850.
It is generally a good idea to use a MaxHeaderLength
of less than 100 bytes, although different news servers
have different requirements for header lengths.
public int getMaxLines()
MaxLines
property is used to limit the number
of text lines besides 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 IPWorksException
MaxLines
property is used to limit the number
of text lines besides 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 java.lang.String getNewsgroups()
Newsgroups
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 the Newsgroups
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 Newsgroups header is longer than MaxHeaderLength
, then it is folded according to
RFC 850 specifications.
public void setNewsgroups(java.lang.String newsgroups) throws IPWorksException
Newsgroups
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 the Newsgroups
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 Newsgroups header is longer than MaxHeaderLength
, then it is folded according to
RFC 850 specifications.
public int getNewsPort()
NewsPort
while
connected will fail with an error.
public void setNewsPort(int newsPort) throws IPWorksException
NewsPort
while
connected will fail with an error.
public java.lang.String getNewsServer()
NewsServer
property specifies the IP address (IP number in
dotted internet format) or 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 the NewsServer
property is set to a Domain Name, a DNS request
is initiated and upon successful termination of the request, the NewsServer
property is set to the corresponding address. If the
search is not successful, an error is returned.
public void setNewsServer(java.lang.String newsServer) throws IPWorksException
NewsServer
property specifies the IP address (IP number in
dotted internet format) or 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 the NewsServer
property is set to a Domain Name, a DNS request
is initiated and upon successful termination of the request, the NewsServer
property is set to the corresponding address. If the
search is not successful, an error is returned.
public java.lang.String getOrganization()
Organization
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 Organization header is longer than MaxHeaderLength
, then it is folded according to RFC 850
specifications.
public void setOrganization(java.lang.String organization) throws IPWorksException
Organization
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 Organization header is longer than MaxHeaderLength
, then it is folded according to RFC 850
specifications.
public java.lang.String getOtherHeaders()
OtherHeaders
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 OtherHeaders
contains
invalid headers, article posting might not be successful.
The OtherHeaders
property is useful for extending the
functionality of the control. A good example is posting of
MIME attachments.
SPECIAL CASE: if OtherHeaders
starts with an empty line (CRLF),
then the value of OtherHeaders
is used instead of the normally
computed article headers.
public void setOtherHeaders(java.lang.String otherHeaders) throws IPWorksException
OtherHeaders
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 OtherHeaders
contains
invalid headers, article posting might not be successful.
The OtherHeaders
property is useful for extending the
functionality of the control. A good example is posting of
MIME attachments.
SPECIAL CASE: if OtherHeaders
starts with an empty line (CRLF),
then the value of OtherHeaders
is used instead of the normally
computed article headers.
public java.lang.String getOverviewRange()
OverviewRange
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 the property is '-', meaning 'all articles in the group' .
public void setOverviewRange(java.lang.String overviewRange) throws IPWorksException
OverviewRange
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 the property is '-', meaning 'all articles in the group' .
public java.lang.String getPassword()
Password
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 IPWorksException
Password
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 java.lang.String getReferences()
References
property contains a non-empty string,
a References article header is created for the article.
This header shows the article-ids the posted article refers
to.
The references must be separated by commas with no spaces in between.
If the resulting References header is longer than MaxHeaderLength
, then it is folded according to RFC 850
specifications.
public void setReferences(java.lang.String references) throws IPWorksException
References
property contains a non-empty string,
a References article header is created for the article.
This header shows the article-ids the posted article refers
to.
The references must be separated by commas with no spaces in between.
If the resulting References header is longer than MaxHeaderLength
, then it is folded according to RFC 850
specifications.
public java.lang.String getReplyTo()
ReplyTo
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 From
).
If the resulting Reply-To header is longer than MaxHeaderLength
, then it is folded according to RFC 850
specifications.
public void setReplyTo(java.lang.String replyTo) throws IPWorksException
ReplyTo
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 From
).
If the resulting Reply-To header is longer than MaxHeaderLength
, then it is folded according to RFC 850
specifications.
public java.lang.String getSearchHeader()
SearchHeader
property specifies the header to search
for SearchPattern
(e.g. "Subject").
public void setSearchHeader(java.lang.String searchHeader) throws IPWorksException
SearchHeader
property specifies the header to search
for SearchPattern
(e.g. "Subject").
public java.lang.String getSearchPattern()
As an example, "* new *" will match all headers that contain the word "new".
public void setSearchPattern(java.lang.String searchPattern) throws IPWorksException
As an example, "* new *" will match all headers that contain the word "new".
public java.lang.String getSearchRange()
OverviewRange
specifies a range of articles
for which to 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 IPWorksException
OverviewRange
specifies a range of articles
for which to 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 java.lang.String getSubject()
Subject
is posted with a Subject article header to the news server.
If the resulting Subject header is longer than MaxHeaderLength
, then it is folded according to
RFC 850 specifications.
public void setSubject(java.lang.String subject) throws IPWorksException
Subject
is posted with a Subject article header to the news server.
If the resulting Subject header is longer than MaxHeaderLength
, then it is folded according to
RFC 850 specifications.
public int getTimeout()
Timeout
property is set to 0 (default value) all actions
will run uninterrupted until succesful completion, or an error condition
is encountered.
If Timeout
is set to a positive value, and any action does not
complete within Timeout
seconds, the action is aborted, and a 'Timeout' error is fired..
The control 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 always remains responsive.
public void setTimeout(int timeout) throws IPWorksException
Timeout
property is set to 0 (default value) all actions
will run uninterrupted until succesful completion, or an error condition
is encountered.
If Timeout
is set to a positive value, and any action does not
complete within Timeout
seconds, the action is aborted, and a 'Timeout' error is fired..
The control 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 always remains responsive.
public java.lang.String getUser()
User
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 IPWorksException
User
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 fireEndTransfer()
NntpEndTransferEvent
public void fireError(int errorCode, java.lang.String description)
NntpErrorEvent
public void fireGroupList(java.lang.String group, int firstArticle, int lastArticle, boolean canPost)
NntpGroupListEvent
public void fireGroupOverview(int articleNumber, java.lang.String subject, java.lang.String from, java.lang.String articleDate, java.lang.String messageId, java.lang.String references, int articleSize, int articleLines, java.lang.String otherHeaders)
NntpGroupOverviewEvent
public void fireGroupSearch(int articleNumber, java.lang.String header)
NntpGroupSearchEvent
public void fireHeader(java.lang.String field, java.lang.String value)
NntpHeaderEvent
public void firePITrail(int direction, java.lang.String message)
NntpPITrailEvent
public void fireStartTransfer()
NntpStartTransferEvent
public void fireTransfer(int bytesTransferred, byte[] text, boolean EOL)
NntpTransferEvent
public void connect() throws IPWorksException
User
and/or Password
are set,
then corresponding AUTHINFO commands are sent to the NewsServer
as well.
Calling this method is equivalent to setting the Action
property
to nntpConnect .
public void disconnect() throws IPWorksException
NewsServer
. First the control attempts to send
a QUIT command, and if that fails, the connection is broken.
Calling this method is equivalent to setting the Action
property
to nntpDisconnect .
public void fetchArticle() throws IPWorksException
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.
Calling this method is equivalent to setting the Action
property
to nntpGetArticle .
public void fetchArticleBody() throws IPWorksException
CurrentArticle
.
The body via the Transfer
event.
If a connection to the NewsServer
doesn't already exist, a new one is created.
Calling this method is equivalent to setting the Action
property
to nntpGetArticleBody .
public void fetchArticleHeaders() throws IPWorksException
CurrentArticle
.
The headers are delivered via the Header
event.
If a connection to
the NewsServer
doesn't already exist, a new one is created.
Calling this method is equivalent to setting the Action
property
to nntpGetArticleHeaders .
public void groupOverview() throws IPWorksException
OverviewRange
in the CurrentGroup
. The overview data are delivered via the GroupOverview
event.
If a connection to the NewsServer
doesn't already exist, a new
one is created.
Calling this method is equivalent to setting the Action
property
to nntpGroupOverview .
public void groupSearch() throws IPWorksException
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.
Calling this method is equivalent to setting the Action
property
to nntpSearchGroup .
public void interrupt() throws IPWorksException
Action
property
to Idle (0) .
public void listGroups() throws IPWorksException
GroupList
event.
If a connection
to the NewsServer
doesn't already exist, a new one is created.
Calling this method is equivalent to setting the Action
property
to nntpListGroups .
public void listNewGroups() throws IPWorksException
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.
Calling this method is equivalent to setting the Action
property
to nntpListNewGroups .
public void postArticle() throws IPWorksException
NewsServer
doesn't already exist, a new one is created.
Calling this method is equivalent to setting the Action
property
to nntpPostArticle .
public void resetHeaders() throws IPWorksException
Calling this method is equivalent to setting the Action
property
to nntpResetHeaders .
public void addNntpEventListener(NntpEventListener l) throws java.util.TooManyListenersException
public void removeNntpEventListener(NntpEventListener l)
|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |