001    /*
002    * file CcAttribute.java
003    *
004    * Licensed Materials - Property of IBM
005    * Restricted Materials of IBM
006    * 
007    * com.ibm.rational.wvcm.stp.cc.CcAttribute
008    *
009    * (C) Copyright IBM Corporation 2007, 2008.  All Rights Reserved. 
010    * Note to U.S. Government Users Restricted Rights:  Use, duplication or  
011    * disclosure restricted by GSA ADP  Schedule Contract with IBM Corp. 
012    */
013    
014    package com.ibm.rational.wvcm.stp.cc;
015    
016    import java.util.Date;
017    
018    import javax.wvcm.WvcmException;
019    
020    import com.ibm.rational.wvcm.stp.cc.CcAttributeType.ValueType;
021    
022    /**
023     * <p>The ClearCase attribute mechanism lets you associate arbitrary
024     * name/value pairs with particular ClearCase versions or elements.
025     * </p>
026     * <p>
027     * This interface provides an aggregate object for handling these name/value 
028     * pairs.
029     * </p>
030     */
031    public interface CcAttribute {
032        
033        /** Get the attribute's name. */
034        public String getName() throws WvcmException;
035        
036        /** Get the type of the attribute's value data. */ 
037        public CcAttributeType.ValueType getValueType();
038        
039        /** 
040         * Get the attribute's value.
041         * This call is valid for all value types where a string representation 
042         * of the data is desired.
043         */
044        public String getValue();
045        
046        /** 
047         * If the attribute's value type is INTEGER, retrieve it as such.
048         * @throws Exception if value type is not INTEGER.
049         */
050        public int getIntegerValue() throws Exception;
051        
052        /** 
053         * If the attribute's value type is REAL, retrieve it as such.
054         * @throws Exception if value type is not REAL.
055         */
056        public double getRealValue() throws Exception;
057     
058        /** 
059         * If the attribute's value type is TIME, retrieve it as such.
060         * @throws Exception if value type is not TIME.
061         */
062        public Date getTimeValue() throws Exception;
063    
064        /** 
065         * If the attribute's value type is STRING, retrieve it as such.
066         * @throws Exception if value type is not STRING.
067         */
068        public String getStringValue() throws Exception;
069    
070        /** 
071         * If the attribute's value type is OPAQUE, retrieve it as such.
072         * @throws Exception if value type is not OPAQUE.
073         */
074        public byte [] getOpaqueValue() throws Exception;
075        
076    }