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.*; 020 import java.util.Collection; 021 import java.math.BigDecimal; 022 import org.apache.geronimo.samples.daytrader.*; 023 024 public interface LocalQuote extends EJBLocalObject { 025 026 /* Container persisted attributes 027 * Note: Commented out methods are internal only and not exposed to EJB clients 028 * For example: The Primary Key value cannot be modified after creation 029 * Also, modification of other Entity attributes may be restricted to internal use 030 */ 031 032 public String getSymbol(); /* symbol */ 033 public void setSymbol(String symbol); 034 public String getCompanyName(); /* companyName */ 035 public void setCompanyName(String companyName); 036 public double getVolume(); /* volume */ 037 //public void setVolume(double volume); 038 public BigDecimal getPrice(); /* price */ 039 //public void setPrice(BigDecimal price); 040 public BigDecimal getOpen(); /* open price */ 041 //public void setOpen(BigDecimal price); 042 public BigDecimal getLow(); /* low price */ 043 /* setLow not exposed to client applications 044 public void setLow(BigDecimal price); 045 */ 046 047 /* high price */ 048 public BigDecimal getHigh(); 049 /* setHigh not exposed to client applications 050 public void setHigh(BigDecimal price); 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(); 058 /* setChange not exposed to client applications 059 public void setChange(double change); 060 */ 061 062 /* Relationshiop fields */ 063 public abstract Collection getOrders(); 064 public abstract void setOrders(Collection orders); 065 066 /* Business methods */ 067 068 public void updatePrice(BigDecimal price); 069 public void updatePrice(double price); 070 071 public void addToVolume(double quantity); 072 073 /* FUTURE This is the approach using ejbSelect methods 074 * using Trade Session EJB approach instead 075 076 077 public Collection getTopGainers(int count) 078 throws FinderException; 079 080 public Collection getTopLosers(int count) 081 throws FinderException; 082 083 public BigDecimal getTSIA() 084 throws FinderException; 085 086 public BigDecimal getOpenTSIA() 087 throws FinderException; 088 089 * 090 */ 091 092 public double getTotalVolume() 093 throws FinderException; 094 095 public QuoteDataBean getDataBean(); 096 public String toString(); 097 098 }