//
// CannotCreateSocketException.java
//
// The contents of this file are subject to the SNIA Public License Version 1.0
// (the "License"); you may not use this file except in compliance with the
// License. You may obtain a copy of the License at
//
//     http://www.snia.org/resources/openSource.html
//
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 
// License for the specific language governing rights and limitations
// under the License.
//
// The Original Code is CannotCreateSocketException.java
// 
// The Initial Developer of the Original Code is Hewlett-Packard Company.
// (c) Copyright 2000 Hewlett-Packard Company 
//
// Contributor(s): Nag Boranna
//

package org.snia.wbemcmd.xml;

import org.snia.wbem.cim.CIMException;


/**
 * Exception class for errors involving socket creation.
 *
 * @author Nag Boranna, Hewlett-Packard Company
 */
public class CannotCreateSocketException extends Exception
{
    private String exceptionID =  null; 

    private Object exceptionMessage = null;

    /**
     * Constructor that sets the exception message.
     *
     * @param messageID The String to use as the exception message ID.
     *
     * @param message The object represeting the exception message.
     */
    public CannotCreateSocketException(String messageID, Object message)
    {
        
        if (messageID == null)
        {
            throw new NullPointerException();
        }

        exceptionID = messageID;
        if (message != null)
        {
            exceptionMessage = message.toString();
        }
    }

    /** 
     * Gets the exception ID.
     */
    public String getID()
    {
        return(exceptionID);
    }

    /** 
     * Gets the exception message.
     */
    public String getMessage()
    {
        return(exceptionMessage.toString());
    }

    /** 
     * Gets the exception message in string format.
     */
    public String toString()
    {
        return(exceptionMessage.toString());
    }
}
