/*
Copyright 2002-2005 The Members of the OSS through Java(TM) Initiative.
All rights reserved. Use is subject to license terms.
*/
package javax.oss;


/**
 * This exception is thrown for operations affecting
 * unsupported attributes. It is unchecked.
 *
 * <p>
 * Note: This exception replaces the deprecated javax.oss.UnsupportedAttributeException
 * 
 * @author OSS through Java Initiative, Vincent Perrot Sun Microsystems Inc.
 * @version 1.2
 * @since August 2005
 * @ossj:exception
 */
//AB decision 2005-08-12: Use OSS prefix for all OSSJ exception and respect the Exception inheritence
public class OssUnsupportedAttributeException extends RuntimeException {
//public class OssUnsupportedAttributeException extends UnsupportedAttributeException {
    private String attributeName = "UNKNOWN_ATTRIBUTE_NAME";

    /**
     * Constructs an instance of UnsupportedAttributeException with no message.
     */
    public OssUnsupportedAttributeException() {
        super();
    }

    /**
     * Constructs an instance of UnsupportedAttributeException with the specified detail message.
     * A detail message is an instance of String that describes this particular exception.
     * @param message the description of the problem.
     */
    public OssUnsupportedAttributeException(String message) {
        super(message);
    }

    /**
     * Constructs an instance of UnsupportedAttributeException with the specified
     * unsupported attribute name and additional detail message.
     * A detail message is an instance of String that describes this particular exception.
     * @param unsupportedAttributeName a string representation of the unsupported attribute name
     * @param message the description of the problem.
     */
    public OssUnsupportedAttributeException(String unsupportedAttributeName, String message) {
        //Bug Id 5037431	
        //super(message); 
        super("Unsupported Attribute Name [" + unsupportedAttributeName + "]," + message);
        attributeName = unsupportedAttributeName;
    }

    /**
     * Returns the unsupported attribute name that caused the exception.
     * @return the unsupported attribute name as string.
     */
    public String getAttributeName() {
        return attributeName;
    }
}
