001    /**
002     *  Licensed to the Apache Software Foundation (ASF) under one or more
003     *  contributor license agreements.  See the NOTICE file distributed with
004     *  this work for additional information regarding copyright ownership.
005     *  The ASF licenses this file to You under the Apache License, Version 2.0
006     *  (the "License"); you may not use this file except in compliance with
007     *  the License.  You may obtain a copy of the License at
008     *
009     *     http://www.apache.org/licenses/LICENSE-2.0
010     *
011     *  Unless required by applicable law or agreed to in writing, software
012     *  distributed under the License is distributed on an "AS IS" BASIS,
013     *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     *  See the License for the specific language governing permissions and
015     *  limitations under the License.
016     */
017    package org.apache.geronimo.samples.daytrader.ejb;
018    
019    import javax.ejb.EJBObject;
020    import javax.ejb.FinderException;
021    import java.math.BigDecimal;
022    import org.apache.geronimo.samples.daytrader.*;
023    import java.rmi.Remote;
024    import java.rmi.RemoteException;
025    
026    public interface Quote extends EJBObject, Remote
027    {
028    
029        /* Container persisted attributes 
030         *        Note: Commented out methods are internal only and not exposed to EJB clients
031         *        For example: The Primary Key value cannot be modified after creation
032         *        Also, modification of other Entity attributes may be restricted to internal use
033         */
034         
035        public String                               getSymbol() throws RemoteException;    /* symbol */
036        public void                         setSymbol(String symbol) throws RemoteException;
037        public String                               getCompanyName() throws RemoteException;    /* companyName */
038        public void                         setCompanyName(String companyName) throws RemoteException;
039        public double                               getVolume() throws RemoteException;    /* volume */
040        //public void                               setVolume(double volume) throws RemoteException;
041        public BigDecimal                   getPrice() throws RemoteException;    /* price */
042        //public void                               setPrice(BigDecimal price) throws RemoteException;
043        public BigDecimal                   getOpen() throws RemoteException;    /* open price */
044        //public void                               setOpen(BigDecimal price) throws RemoteException;
045        public BigDecimal                   getLow() throws RemoteException;    /* low price */
046        //public void                                       setLow(BigDecimal price) throws RemoteException;
047    
048        /* high price */
049        public BigDecimal                   getHigh() throws RemoteException;
050        //public void              setHigh(BigDecimal price) throws RemoteException;
051    
052         
053        /* Change in price */
054        /* Note: this can be computed by "current-open"
055           but is added here for convenience
056         */
057        public double       getChange() throws RemoteException;
058        //public void              setChange(double change) throws RemoteException;
059    
060    
061        /* Relationshiop fields */
062        // Cannot be exposed on Remote I/F
063        //public abstract Collection                getOrders() throws RemoteException;
064        //public abstract void                              setOrders(Collection orders) throws RemoteException;
065    
066    
067        /* Business methods */
068        
069        public void updatePrice(BigDecimal price) throws RemoteException;
070        public void updatePrice(double price) throws RemoteException;
071        
072        public void addToVolume(double quantity) throws RemoteException;    
073    
074           /* FUTURE This is the approach using ejbSelect methods
075            * using Trade Session EJB approach instead
076    
077    
078        public Collection getTopGainers(int count)
079           throws FinderException throws RemoteException;
080    
081        public Collection getTopLosers(int count) 
082           throws FinderException throws RemoteException;
083    
084        public BigDecimal getTSIA() 
085           throws FinderException throws RemoteException;
086    
087        public BigDecimal getOpenTSIA() 
088           throws FinderException throws RemoteException;
089           
090            *
091            */
092           
093            public double getTotalVolume()       
094                    throws FinderException, RemoteException;       
095    
096            public QuoteDataBean getDataBean() throws RemoteException;
097    //      public String toString() throws RemoteException;    
098    }