/*
 * @(#)MailForwarder.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;


/**
 * MailForwarder record represents a mail forwarder domain.
 * Obsolete per RFC 1035 - use MailExchanger record
 */
public class MailForwarder
        extends DnsRecord {
    private String mailForwarder;

    protected void decode(DnsInputStream inputStream)
            throws IOException {
        mailForwarder = inputStream.readDomainName();
    }

    /**
     * Gets domain-name which specifies a host which has a mail agent for the domain
     * which will accept mail for forwarding to the domain.
     *
     * @return domain-name
     */
    public String getMailForwarder() {
        return mailForwarder;
    }

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

