001    /*
002     * file StpMessageException.java
003     *
004     * IBM Confidential
005     * OCO Source Materials
006     * Rational ClearQuest
007     * (C) Copyright IBM Corp. 2008
008     *
009     * The source code for this program is not published or otherwise
010     * divested of its trade secrets, irrespective of what has been
011     * deposited with the U.S. Copyright Office.
012     */
013    
014    package com.ibm.rational.wvcm.stp;
015    
016    import javax.wvcm.Resource;
017    import javax.wvcm.ResourceList;
018    import javax.wvcm.WvcmException.ReasonCode;
019    
020    import com.ibm.rational.wvcm.stp.StpPartialResultsException.PartialResultsData;
021    import com.ibm.rational.wvcm.stp.StpPropertyException.PropertyData;
022    
023    /**
024     * An StpException used to pass an error message string generated by the domain
025     * application through the CM API without further adornment.
026     */
027    public abstract class StpErrorMessageException extends StpPropertyException
028    {
029        /**
030         * @return The message string exactly as generated by the domain application
031         *         without the additional context information provided by the server
032         *         or client libraries when forming the string returned by the
033         *         toString, getMessage or getLocalizedMessage methods of this
034         *         Throwable object.
035         */
036        public String errorMessage()
037        {
038            return ((ErrorMessageData)data()).errorMessage();
039        }
040    
041        /*
042         * @param resource
043         * @param reasonCode
044         * @param nestedExceptions
045         */
046        protected StpErrorMessageException(Resource resource,
047                                   ReasonCode reasonCode,
048                                   Throwable... nestedExceptions)
049        {
050            super(resource, reasonCode, nestedExceptions);
051        }
052    
053        /** 
054         * The interface for the data implementation object for this type of 
055         * exception
056         */
057        public interface ErrorMessageData extends PropertyData {
058            public String errorMessage();
059        }
060    }