|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ipworks.Mx
The MX class enables querying of mail exchange (MX) records from a Domain Name Server (DNS). That is, it will find out the name(s) of the mail server(s) accepting email for a given email address or domain.
The class will try to find out automatically the name of a DNS server from the system's settings and set the DNSServer property.
The class operates in asynchronous mode: assigning an email address or domain name to EmailAddress property directs the class to query the DNSServer and fire the Response event for each server which handles the mail for the email address and fill out the MailServer property with the most preferred mail server and the Status event to "Ok" or an error message.
RequestId may be used to identify requests and is used in the Response event. The user may set its value before sending out requests.
Constructor Summary | |
Mx()
|
Method Summary | |
void |
addMxEventListener(MxEventListener l)
|
void |
fireError(int errorCode,
java.lang.String description)
Information about errors during data delivery. |
void |
fireResponse(int requestId,
java.lang.String domain,
java.lang.String mailServer,
int precedence,
int timeToLive,
int statusCode,
java.lang.String description)
Fired for each MailServer accepting email for the domain. |
int |
getDNSPort()
The port where the DNS server is listening. |
java.lang.String |
getDNSServer()
IP address (or name) of the DNS server to query. |
java.lang.String |
getEmailAddress()
Action property triggering a request to DNSServer . |
java.lang.String |
getLocalHost()
The name of the local host or user-assigned IP interface through which connections are accepted or initiated. |
java.lang.String |
getMailServer()
Mail server with lowest precedence value (lowest cost to reach). |
int |
getRequestId()
Identifies each request. |
java.lang.String |
getStatus()
Status of the request: empty while in progress, 'OK' or error message upon completition. |
void |
removeMxEventListener(MxEventListener l)
|
void |
setDNSPort(int DNSPort)
The port where the DNS server is listening. |
void |
setDNSServer(java.lang.String DNSServer)
IP address (or name) of the DNS server to query. |
void |
setEmailAddress(java.lang.String emailAddress)
Action property triggering a request to DNSServer . |
void |
setLocalHost(java.lang.String localHost)
The name of the local host or user-assigned IP interface through which connections are accepted or initiated. |
void |
setRequestId(int requestId)
Identifies each request. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Mx()
Method Detail |
public int getDNSPort()
public void setDNSPort(int DNSPort) throws IPWorksException
public java.lang.String getDNSServer()
If the class cannot determine the default DNS server address, the property value will be an empty string.
public void setDNSServer(java.lang.String DNSServer) throws IPWorksException
If the class cannot determine the default DNS server address, the property value will be an empty string.
public java.lang.String getEmailAddress()
After the query completes, the MailServer property is set to the best mail server and the Status property has the result description of the response.
Valid queries are email addresses like name@company.com or hostnames and domains like domain.com .
public void setEmailAddress(java.lang.String emailAddress) throws IPWorksException
After the query completes, the MailServer property is set to the best mail server and the Status property has the result description of the response.
Valid queries are email addresses like name@company.com or hostnames and domains like domain.com .
public java.lang.String getMailServer()
public int getRequestId()
If a custom value is needed for RequestId , the property must be set before setting EmailAddress . The class increments RequestId automatically after sending each request.
public void setRequestId(int requestId) throws IPWorksException
If a custom value is needed for RequestId , the property must be set before setting EmailAddress . The class increments RequestId automatically after sending each request.
public java.lang.String getStatus()
public java.lang.String getLocalHost()
In multihomed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the class accept connections only through that interface.
The value of LocalHost is not saved on the form.
public void setLocalHost(java.lang.String localHost) throws IPWorksException
In multihomed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the class accept connections only through that interface.
The value of LocalHost is not saved on the form.
public void fireResponse(int requestId, java.lang.String domain, java.lang.String mailServer, int precedence, int timeToLive, int statusCode, java.lang.String description)
MxResponseEvent
public void fireError(int errorCode, java.lang.String description)
MxErrorEvent
public void addMxEventListener(MxEventListener l) throws java.util.TooManyListenersException
public void removeMxEventListener(MxEventListener l)
|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |