|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ipworks.Pop
The POP class is used retrieve electronic mail from Internet Post Office servers (POP).
The POP class implements a standard internet post office (POP3) client as specified in RFC 1725.
The class is driven by a few key properties and the Action property. To connect to a MailServer first set the appropriate User and Password and then connect by setting Action to 'Connect'. Upon successful connection to the MailServer , the number of waiting messages is shown by the MessageCount property. A message is selected by setting the MessageNumber property to a number between 1 and MessageCount (inclusive). Then, message text and/or headers are received by setting Action to the appropriate value.
The message text is received through the Transfer event, whereas the message headers are received through the Header event. The body of the message is also saved in the file specified by the LocalFile property. StartTransfer and EndTransfer events are fired at the beginning and end of message transmission. The PITrail event provides a trace of the interaction between the client and server (excluding message transfers).
Field Summary | |
static int |
a_Connect
|
static int |
a_Delete
|
static int |
a_Disconnect
|
static int |
a_Idle
|
static int |
a_Reset
|
static int |
a_Retrieve
|
Constructor Summary | |
Pop()
|
Method Summary | |
void |
addPopEventListener(PopEventListener l)
|
void |
fireEndTransfer()
Fired when the message completes transferring. |
void |
fireError(int errorCode,
java.lang.String description)
Information about errors during data delivery. |
void |
fireHeader(java.lang.String field,
java.lang.String value)
Fired for every message header being retrieved. |
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 message starts transferring. |
void |
fireTransfer(int bytesTransferred,
byte[] text)
Fired while the message gets transferred from MailServer . |
int |
getAction()
An action code for the component. |
java.lang.String |
getLastReply()
The last reply from the server. |
java.lang.String |
getLocalFile()
The path to a local file for downloading the message body. |
java.lang.String |
getLocalHost()
The name of the local host. |
int |
getMailPort()
The server port for POP (default 110). |
java.lang.String |
getMailServer()
The name or address of a mail server (internet post office server). |
int |
getMaxLineLength()
The maximum expected length for message lines. |
int |
getMaxLines()
The maximum number of message lines beside headers to retrieve. |
int |
getMessageCount()
The number of messages waiting in the mailbox. |
int |
getMessageNumber()
Current (selected) message. |
int |
getMessageSize()
The size in bytes of the current message. |
java.lang.String |
getPassword()
The password for the mailbox user. |
int |
getTotalSize()
Cumulative size in bytes of messages in the mailbox (including headers). |
java.lang.String |
getUser()
The user id for the mailbox. |
void |
removePopEventListener(PopEventListener l)
|
void |
setAction(int action)
An action code for the component. |
void |
setCommand(java.lang.String command)
Can be used to send additional commands directly to the POP server. |
void |
setLocalFile(java.lang.String localFile)
The path to a local file for downloading the message body. |
void |
setMailPort(int mailPort)
The server port for POP (default 110). |
void |
setMailServer(java.lang.String mailServer)
The name or address of a mail server (internet post office server). |
void |
setMaxLineLength(int maxLineLength)
The maximum expected length for message lines. |
void |
setMaxLines(int maxLines)
The maximum number of message lines beside headers to retrieve. |
void |
setMessageNumber(int messageNumber)
Current (selected) message. |
void |
setPassword(java.lang.String password)
The password for the mailbox user. |
void |
setUser(java.lang.String user)
The user id for the mailbox. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int a_Idle
public static final int a_Connect
public static final int a_Disconnect
public static final int a_Retrieve
public static final int a_Delete
public static final int a_Reset
Constructor Detail |
public Pop()
Method Detail |
public int getAction()
The following are the possible values for the Action property and the corresponding descriptions:
public void setAction(int action) throws IPWorksException
The following are the possible values for the Action property and the corresponding descriptions:
public void setCommand(java.lang.String command) throws IPWorksException
public java.lang.String getLastReply()
public java.lang.String getLocalFile()
public void setLocalFile(java.lang.String localFile) throws IPWorksException
public java.lang.String getLocalHost()
If the class 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).
public int getMailPort()
public void setMailPort(int mailPort) throws IPWorksException
public java.lang.String getMailServer()
If the MailServer property is set to a Domain Name, a DNS request is initiated and upon successful termination of the request, the MailServer property is set to the corresponding address. If the search is not successful, an error is returned.
public void setMailServer(java.lang.String mailServer) throws IPWorksException
If the MailServer property is set to a Domain Name, a DNS request is initiated and upon successful termination of the request, the MailServer property is set to the corresponding address. If the search is not successful, an error is returned.
public int getMaxLineLength()
public void setMaxLineLength(int maxLineLength) throws IPWorksException
public int getMaxLines()
The value of the property is a positive integer. If 0, then the entire message will be retrieved, without interruptions.
public void setMaxLines(int maxLines) throws IPWorksException
The value of the property is a positive integer. If 0, then the entire message will be retrieved, without interruptions.
public int getMessageCount()
public int getMessageNumber()
public void setMessageNumber(int messageNumber) throws IPWorksException
public int getMessageSize()
The MailServer is asked about the size of the message only if the MessageNumber property has changed. If MessageNumber has not changed, the class returns a cached value.
public java.lang.String getPassword()
public void setPassword(java.lang.String password) throws IPWorksException
public int getTotalSize()
public java.lang.String getUser()
public void setUser(java.lang.String user) throws IPWorksException
public void fireEndTransfer()
PopEndTransferEvent
public void fireError(int errorCode, java.lang.String description)
PopErrorEvent
public void fireHeader(java.lang.String field, java.lang.String value)
PopHeaderEvent
public void firePITrail(int direction, java.lang.String message)
PopPITrailEvent
public void fireStartTransfer()
PopStartTransferEvent
public void fireTransfer(int bytesTransferred, byte[] text)
PopTransferEvent
public void addPopEventListener(PopEventListener l) throws java.util.TooManyListenersException
public void removePopEventListener(PopEventListener l)
|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |