/*
 * @(#)MailDomain.java
 *
 * Copyright (c) 2001-2002 JScape
 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * JScape. ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with JScape.
 */

package com.jscape.inet.dns.record;


import com.jscape.inet.dns.DnsInputStream;

import java.io.IOException;


/**
 * MailDomain record represents a mail-destination.
 * Obsolete per RFC 1035 - use MailExchange record
 */
public class MailDomain
        extends DnsRecord {
    private String mailDestination;

    protected void decode(DnsInputStream dnsIn)
            throws IOException {
        mailDestination = dnsIn.readDomainName();
    }

    /**
     * Gets domain-name which specifies a host which has a mail agent for the domain
     * which should be able to deliver mail for the domain.
     *
     * @return domain-name
     */
    public String getMailDestination() {
        return mailDestination;
    }

    /**
     * Gets String representation of this record.
     *
     * @return String
     */
    public String toString() {
        return getRecordName() + "\tmail destination = " + mailDestination;
    }
}

