AXL MXLookup DNS API

com.theorem.smtp
Class SplitAddr

Object
  extended bySplitAddr

public class SplitAddr
extends Object

A class to extract the three parts of an email address. The parts are the name, address, and port number. A full email address looks like mick@company.com:25, although it's more commonly used without the port number. If the port is missing and will default to 25. If there is only a "name" a default local domain name will be appended.

Version:
1.0 Jan 29, 1998 - Initial coding
Author:
Michael Lecuyer (mjl@theorem.com)

Field Summary
 String domain
          Email domain name.
 String name
          Email name.
 String port
          Email port number.
 int portNumber
          Email port number.
 
Constructor Summary
SplitAddr(String fulladdr)
          Split the full address.
SplitAddr(String defaultDomain, int defaultPortNumber)
          Set up the email splitter with some default values.
 
Method Summary
 String getDomain()
          Get the domain portion of the email address.
 String getEmailAddr()
          Get the entire email address without the port number.
 String getFullEmailAddr()
          Get the entire email address with the port number.
 String getName()
          Get the name portion of the email address.
 String getPort()
          Get the port number of the address.
 int getPortNumber()
          Get the port number of the address.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public String name
Email name.


domain

public String domain
Email domain name.


port

public String port
Email port number.


portNumber

public int portNumber
Email port number.

Constructor Detail

SplitAddr

public SplitAddr(String defaultDomain,
                 int defaultPortNumber)
Set up the email splitter with some default values. These defaults may be null, in which case the default domain is null and the port number is 25. The default domain is meant for mail servers that may allow local email to be sent just to a name. The formal name will be added here. eg mail to "michael" may be sent to "michael@theorem.com".

Parameters:
defaultDomain - - domain name if not is supplied, eg only a email name is given.
defaultPortNumber - - port number for smtp server, if not given 25 is assumed.

SplitAddr

public SplitAddr(String fulladdr)
Split the full address. This may be anything from "michael", "michael@theroem.com", or "michael@theorem.com:25". Uses default information - no default domain, port number is 25.

Parameters:
fulladdr - - full email address, possibly with a domain name and perhaps a port number.
Method Detail

getName

public String getName()
Get the name portion of the email address.

Returns:
the name

getDomain

public String getDomain()
Get the domain portion of the email address.

Returns:
the domain name

getEmailAddr

public String getEmailAddr()
Get the entire email address without the port number.

Returns:
email address

getFullEmailAddr

public String getFullEmailAddr()
Get the entire email address with the port number.

Returns:
email address with port number

getPort

public String getPort()
Get the port number of the address.

Returns:
SMTP port number as a string

getPortNumber

public int getPortNumber()
Get the port number of the address.

Returns:
SMTP port number as an integer

AXL MXLookup DNS API

Submit a bug report or feature request

Copyright 1998-2001 AXL Software. PO Box 97, Viola, Delaware 19979, U.S.A. All Rights Reserved.