Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 21289 invoked from network); 20 Sep 2005 16:09:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Sep 2005 16:09:43 -0000 Received: (qmail 3272 invoked by uid 500); 20 Sep 2005 16:09:29 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 3111 invoked by uid 500); 20 Sep 2005 16:09:28 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 2874 invoked by uid 99); 20 Sep 2005 16:09:26 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Sep 2005 09:09:26 -0700 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 20 Sep 2005 09:09:27 -0700 Received: (qmail 20986 invoked by uid 65534); 20 Sep 2005 16:09:07 -0000 Message-ID: <20050920160907.20983.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r290479 [2/16] - in /geronimo/trunk/sandbox/daytrader: ./ bin/ derby/ modules/ modules/core/ modules/core/src/ modules/core/src/conf/ modules/core/src/java/ modules/core/src/java/org/ modules/core/src/java/org/apache/ modules/core/src/java/... Date: Tue, 20 Sep 2005 16:08:17 -0000 To: scm@geronimo.apache.org From: geirm@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Added: geronimo/trunk/sandbox/daytrader/modules/core/src/test/org/apache/geronimo/samples/daytrader/NaughtyTest.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/core/src/test/org/apache/geronimo/samples/daytrader/NaughtyTest.java?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/core/src/test/org/apache/geronimo/samples/daytrader/NaughtyTest.java (added) +++ geronimo/trunk/sandbox/daytrader/modules/core/src/test/org/apache/geronimo/samples/daytrader/NaughtyTest.java Tue Sep 20 09:07:08 2005 @@ -0,0 +1,40 @@ +package org.apache.geronimo.samples.daytrader; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + * + * @author Jason van Zyl + */ +public class NaughtyTest + extends AbstractTestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public NaughtyTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( NaughtyTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + // Crash and burn! + } +} Added: geronimo/trunk/sandbox/daytrader/modules/ear/maven.xml URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ear/maven.xml?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ear/maven.xml (added) +++ geronimo/trunk/sandbox/daytrader/modules/ear/maven.xml Tue Sep 20 09:07:08 2005 @@ -0,0 +1,6 @@ + + + + + + Added: geronimo/trunk/sandbox/daytrader/modules/ear/project.properties URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ear/project.properties?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ear/project.properties (added) +++ geronimo/trunk/sandbox/daytrader/modules/ear/project.properties Tue Sep 20 09:07:08 2005 @@ -0,0 +1,11 @@ +maven.xdoc.date=left +maven.ejb.src=${maven.build.dir}/xdoclet/ejb +maven.eclipse.classpath.include=${maven.build.dir}/xdoclet/ejbdoclet,src/test-cactus +maven.xdoclet.ejbdoclet.utilobject.0.cacheHomes=true +maven.xdoclet.ejbdoclet.utilobject.0.includeGUID=true +maven.xdoclet.ejbdoclet.dataobject.0=true +maven.xdoclet.ejbdoclet.entityfacade.0=true +maven.xdoclet.ejbdoclet.valueobject.0=true +maven.xdoclet.ejbdoclet.deploymentdescriptor.0.validateXML=true +cactus.src.mergewebxml = src/conf/cactus-web.xml +cactus.is.ear=true Added: geronimo/trunk/sandbox/daytrader/modules/ear/project.xml URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ear/project.xml?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ear/project.xml (added) +++ geronimo/trunk/sandbox/daytrader/modules/ear/project.xml Tue Sep 20 09:07:08 2005 @@ -0,0 +1,82 @@ + + + + ../../project.xml + 3 + daytrader-ear + DayTrader Enterprise Application + 1.0-SNAPSHOT + org.apache.geronimo.samples.daytrader.ejb + Day Trader Enterprise Archive + + + daytrader + daytrader-core + 1.0-SNAPSHOT + + true + + + + daytrader + daytrader-wsappclient + 1.0-SNAPSHOT + + true + + + + daytrader + daytrader-web + 1.0-SNAPSHOT + war + + true + /daytrader + + + + daytrader + daytrader-ejb + 1.0-SNAPSHOT + ejb + + true + + + + daytrader + daytrader-streamer + 1.0-SNAPSHOT + + true + + + + + + + src/java + src/test + + + **/*Test.java + + + **/NaughtyTest.java + + + + + src/conf + + *.properties + + + + + Added: geronimo/trunk/sandbox/daytrader/modules/ear/src/application/META-INF/application.xml URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ear/src/application/META-INF/application.xml?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ear/src/application/META-INF/application.xml (added) +++ geronimo/trunk/sandbox/daytrader/modules/ear/src/application/META-INF/application.xml Tue Sep 20 09:07:08 2005 @@ -0,0 +1,22 @@ + + + Application description + Trade + + daytrader-streamer-1.0-SNAPSHOT.jar + + + daytrader-wsappclient-1.0-SNAPSHOT.jar + + + + daytrader-web-1.0-SNAPSHOT.war + /daytrader + + + + daytrader-ejb-1.0-SNAPSHOT.jar + + Added: geronimo/trunk/sandbox/daytrader/modules/ear/src/conf/app.properties URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ear/src/conf/app.properties?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ear/src/conf/app.properties (added) +++ geronimo/trunk/sandbox/daytrader/modules/ear/src/conf/app.properties Tue Sep 20 09:07:08 2005 @@ -0,0 +1,2 @@ +# Sample app properties. +foo=bar Added: geronimo/trunk/sandbox/daytrader/modules/ear/src/test-cactus/example/ear/HttpUnitTest.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ear/src/test-cactus/example/ear/HttpUnitTest.java?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ear/src/test-cactus/example/ear/HttpUnitTest.java (added) +++ geronimo/trunk/sandbox/daytrader/modules/ear/src/test-cactus/example/ear/HttpUnitTest.java Tue Sep 20 09:07:08 2005 @@ -0,0 +1,59 @@ +package example.ear; + +import org.apache.cactus.ServletTestCase; + +import com.meterware.httpunit.WebConversation; + +public class HttpUnitTest extends ServletTestCase { + + /** + * This tests if the EJB Connection works + * + * @throws Exception + * thrown when there is a problem with the test + */ + public void testEjbConnection() throws Exception { + WebConversation wc = new WebConversation(); + wc.getResponse(requestUrl("/ejb")); + assertTrue(wc.getCurrentPage().getText().startsWith("Got ID ")); + } + + /** + * This tests if the Hello World servlet provides the correct output + * + * @throws Exception + * thrown when there is a problem with the test + */ + public void testHelloWorldServlet() throws Exception { + WebConversation wc = new WebConversation(); + wc.getResponse(requestUrl("/HelloWorld")); + assertTrue(wc.getCurrentPage().getText().startsWith("Hello world on")); + } + + /** + * This tests if the Hello World JSP provides the correct output + * + * @throws Exception + * thrown when there is a problem with the test + */ + public void testHelloWorldJsp() throws Exception { + WebConversation wc = new WebConversation(); + wc.getResponse(requestUrl("/sample.jsp")); + assertTrue(wc.getCurrentPage().getText().indexOf("Hello world JSP on") != -1); + } + + /** + * This is a helper method to create the URL string for the initial web + * conversation request + * + * @param relativeUrl + * the relative URL including the leading"/" + * @return the context url with the relative URL appended to it + */ + private String requestUrl(String relativeUrl) { + StringBuffer url = request.getRequestURL(); + url.delete(url.lastIndexOf("/"), url.length()); + url.append(relativeUrl); + return url.toString(); + } +} Added: geronimo/trunk/sandbox/daytrader/modules/ear/src/test/example/ear/AbstractTestCase.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ear/src/test/example/ear/AbstractTestCase.java?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ear/src/test/example/ear/AbstractTestCase.java (added) +++ geronimo/trunk/sandbox/daytrader/modules/ear/src/test/example/ear/AbstractTestCase.java Tue Sep 20 09:07:08 2005 @@ -0,0 +1,40 @@ +package example.ear; + +import java.io.File; + +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Abstract base class for test cases. + * + * @author Jason van Zyl + */ +public abstract class AbstractTestCase + extends TestCase +{ + /** + * Basedir for all file I/O. Important when running tests from + * the reactor. + */ + public String basedir = System.getProperty("basedir"); + + /** + * Constructor. + */ + public AbstractTestCase(String testName) + { + super(testName); + } + + /** + * Get test input file. + * + * @param path Path to test input file. + */ + public String getTestFile(String path) + { + return new File(basedir,path).getAbsolutePath(); + } +} + Added: geronimo/trunk/sandbox/daytrader/modules/ear/src/test/example/ear/AppTest.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ear/src/test/example/ear/AppTest.java?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ear/src/test/example/ear/AppTest.java (added) +++ geronimo/trunk/sandbox/daytrader/modules/ear/src/test/example/ear/AppTest.java Tue Sep 20 09:07:08 2005 @@ -0,0 +1,40 @@ +package example.ear; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + * + * @author Jason van Zyl + */ +public class AppTest + extends AbstractTestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertEquals( "maven kicks ass", "maven kicks ass" ); + } +} Added: geronimo/trunk/sandbox/daytrader/modules/ear/src/test/example/ear/NaughtyTest.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ear/src/test/example/ear/NaughtyTest.java?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ear/src/test/example/ear/NaughtyTest.java (added) +++ geronimo/trunk/sandbox/daytrader/modules/ear/src/test/example/ear/NaughtyTest.java Tue Sep 20 09:07:08 2005 @@ -0,0 +1,40 @@ +package example.ear; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + * + * @author Jason van Zyl + */ +public class NaughtyTest + extends AbstractTestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public NaughtyTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( NaughtyTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + // Crash and burn! + } +} Added: geronimo/trunk/sandbox/daytrader/modules/ear/src/webapp2/WEB-INF/web.xml URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ear/src/webapp2/WEB-INF/web.xml?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ear/src/webapp2/WEB-INF/web.xml (added) +++ geronimo/trunk/sandbox/daytrader/modules/ear/src/webapp2/WEB-INF/web.xml Tue Sep 20 09:07:08 2005 @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file Added: geronimo/trunk/sandbox/daytrader/modules/ejb/maven.xml URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ejb/maven.xml?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ejb/maven.xml (added) +++ geronimo/trunk/sandbox/daytrader/modules/ejb/maven.xml Tue Sep 20 09:07:08 2005 @@ -0,0 +1,6 @@ + + + + + + Added: geronimo/trunk/sandbox/daytrader/modules/ejb/project.properties URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ejb/project.properties?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ejb/project.properties (added) +++ geronimo/trunk/sandbox/daytrader/modules/ejb/project.properties Tue Sep 20 09:07:08 2005 @@ -0,0 +1,11 @@ +maven.xdoc.date=left +maven.ejb.src=${maven.build.dir}/xdoclet/ejb +maven.eclipse.classpath.include=${maven.build.dir}/xdoclet/ejbdoclet,src/test-cactus +maven.xdoclet.ejbdoclet.utilobject.0.cacheHomes=true +maven.xdoclet.ejbdoclet.utilobject.0.includeGUID=true +maven.xdoclet.ejbdoclet.dataobject.0=true +maven.xdoclet.ejbdoclet.entityfacade.0=true +maven.xdoclet.ejbdoclet.valueobject.0=true +maven.xdoclet.ejbdoclet.deploymentdescriptor.0.validateXML=true +cactus.src.mergewebxml = src/conf/cactus-web.xml +cactus.is.ear=true Added: geronimo/trunk/sandbox/daytrader/modules/ejb/project.xml URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ejb/project.xml?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ejb/project.xml (added) +++ geronimo/trunk/sandbox/daytrader/modules/ejb/project.xml Tue Sep 20 09:07:08 2005 @@ -0,0 +1,57 @@ + + + + ../../project.xml + 3 + daytrader-ejb + DayTrader EJBs + 1.0-SNAPSHOT + org.apache.geronimo.samples.daytrader.ejb + Day Trader EJBs + + + daytrader + daytrader-core + 1.0-SNAPSHOT + + + daytrader + daytrader-wsappclient + 1.0-SNAPSHOT + + + geronimo-spec + geronimo-spec-j2ee + 1.4-rc4 + + + commons-logging + commons-logging + 1.0.3 + + true + + + + + + src/java + src/test + + + **/*Test.java + + + **/NaughtyTest.java + + + + + src/conf + + *.properties + + + + + Added: geronimo/trunk/sandbox/daytrader/modules/ejb/src/conf/app.properties URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ejb/src/conf/app.properties?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ejb/src/conf/app.properties (added) +++ geronimo/trunk/sandbox/daytrader/modules/ejb/src/conf/app.properties Tue Sep 20 09:07:08 2005 @@ -0,0 +1,2 @@ +# Sample app properties. +foo=bar Added: geronimo/trunk/sandbox/daytrader/modules/ejb/src/conf/cactus-web.xml URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ejb/src/conf/cactus-web.xml?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ejb/src/conf/cactus-web.xml (added) +++ geronimo/trunk/sandbox/daytrader/modules/ejb/src/conf/cactus-web.xml Tue Sep 20 09:07:08 2005 @@ -0,0 +1,12 @@ + + + + + + ejb/ExampleFacadeLocal + Session + example.ejb.ExampleFacadeLocalHome + + ExampleFacade + + Added: geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/example/ejb/ExampleBean.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/example/ejb/ExampleBean.java?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/example/ejb/ExampleBean.java (added) +++ geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/example/ejb/ExampleBean.java Tue Sep 20 09:07:08 2005 @@ -0,0 +1,70 @@ +package example.ejb; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +/** + * This is a example of a CMP entity bean. + * @ejb.bean + * name="Example" + * cmp-version="2.x" + * primkey-field="id" + * @ejb.transaction + * type="Required" + * @ejb.finder + * signature="Example findByName(java.lang.String name)" + * query="SELECT DISTINCT e.id FROM Example AS e WHERE e.name = ?1" + * + * @author Archimedes Trajano + * @version $Id: ExampleBean.java,v 1.1 2004/03/07 00:21:19 evenisse Exp $ + */ +public abstract class ExampleBean implements EntityBean { + /** + * The primary key of the table is a number which the developer has to + * guarantee to be unique. + * @ejb.pk-field + * @ejb.interface-method + * @ejb.persistence + * + * @return an integer representing an ID on the keys table + */ + public abstract Integer getId(); + + /** + * This sets the primary key value. Not an actual interface method, but + * needed during bean creation. + * @param id the new primary key value + */ + public abstract void setId(final Integer id); + + /** + * Name is a field value, you can change or add on more fields as needed. + * @ejb.persistence + * @ejb.interface-method + * @return the name + */ + public abstract String getName(); + + /** + * Sets the name field + * @ejb.interface-method + * @param name new name + */ + public abstract void setName(final String name); + + /** + * The required EJB Creation method + * @ejb.create-method + * @param id a unique ID for the primary key + * @param name the value associated with the key + * @throws CreateException thrown when there is a problem creating + * @return the primary key + */ + public Integer ejbCreate(final Integer id, final String name) + throws CreateException { + setName(name); + setId(id); + + return getId(); + } +} Added: geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/AccountDataBean.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/AccountDataBean.java?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/AccountDataBean.java (added) +++ geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/AccountDataBean.java Tue Sep 20 09:07:08 2005 @@ -0,0 +1,237 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.geronimo.samples.daytrader; + +import java.math.BigDecimal; +import java.util.Date; +import java.io.Serializable; + +import org.apache.geronimo.samples.daytrader.util.*; + +public class AccountDataBean implements Serializable +{ + + /* Accessor methods for persistent fields */ + + private Integer accountID; /* accountID */ + private int loginCount; /* loginCount */ + private int logoutCount; /* logoutCount */ + private Date lastLogin; /* lastLogin Date */ + private Date creationDate; /* creationDate */ + private BigDecimal balance; /* balance */ + private BigDecimal openBalance; /* open balance */ + + /* Accessor methods for relationship fields are only included for the AccountProfile profileID */ + + private String profileID; + public AccountDataBean(){ } + public AccountDataBean(Integer accountID, + int loginCount, + int logoutCount, + Date lastLogin, + Date creationDate, + BigDecimal balance, + BigDecimal openBalance, + String profileID) + { + setAccountID(accountID); + setLoginCount(loginCount); + setLogoutCount(logoutCount); + setLastLogin(lastLogin); + setCreationDate(creationDate); + setBalance(balance); + setOpenBalance(openBalance); + setProfileID(profileID); } + + public static AccountDataBean getRandomInstance() { + return new AccountDataBean(new Integer(TradeConfig.rndInt(100000)), //accountID + TradeConfig.rndInt(10000), //loginCount + TradeConfig.rndInt(10000), //logoutCount + new java.util.Date(), //lastLogin + new java.util.Date(TradeConfig.rndInt(Integer.MAX_VALUE)), //creationDate + TradeConfig.rndBigDecimal(1000000.0f), //balance + TradeConfig.rndBigDecimal(1000000.0f), //openBalance + TradeConfig.rndUserID() //profileID + ); + } + + public String toString() + { + return "\n\tAccount Data for account: " + getAccountID() + + "\n\t\t loginCount:" + getLoginCount() + + "\n\t\t logoutCount:" + getLogoutCount() + + "\n\t\t lastLogin:" + getLastLogin() + + "\n\t\t creationDate:" + getCreationDate() + + "\n\t\t balance:" + getBalance() + + "\n\t\t openBalance:" + getOpenBalance() + + "\n\t\t profileID:" + getProfileID() + ; + } + public String toHTML() + { + return "
Account Data for account: " + getAccountID() + "" + + "
  • loginCount:" + getLoginCount() + "
  • " + + "
  • logoutCount:" + getLogoutCount() + "
  • " + + "
  • lastLogin:" + getLastLogin() + "
  • " + + "
  • creationDate:" + getCreationDate() + "
  • " + + "
  • balance:" + getBalance() + "
  • " + + "
  • openBalance:" + getOpenBalance() + "
  • " + + "
  • profileID:" + getProfileID() + "
  • " + ; + } + public void print() + { + Log.log( this.toString() ); + } + + /** + * Gets the accountID + * @return Returns a Integer + */ + public Integer getAccountID() { + return accountID; + } + /** + * Sets the accountID + * @param accountID The accountID to set + */ + public void setAccountID(Integer accountID) + { + this.accountID = accountID; + } + /** + * Gets the loginCount + * @return Returns a int + */ + public int getLoginCount() { + return loginCount; + } + /** + * Sets the loginCount + * @param loginCount The loginCount to set + */ + public void setLoginCount(int loginCount) + { + this.loginCount = loginCount; + } + + /** + * Gets the logoutCount + * @return Returns a int + */ + public int getLogoutCount() { + return logoutCount; + } + /** + * Sets the logoutCount + * @param logoutCount The logoutCount to set + */ + public void setLogoutCount(int logoutCount) + { + this.logoutCount = logoutCount; + } + + /** + * Gets the lastLogin + * @return Returns a Date + */ + public Date getLastLogin() { + return lastLogin; + } + /** + * Sets the lastLogin + * @param lastLogin The lastLogin to set + */ + public void setLastLogin(Date lastLogin) + { + this.lastLogin = lastLogin; + } + + /** + * Gets the creationDate + * @return Returns a Date + */ + public Date getCreationDate() { + return creationDate; + } + /** + * Sets the creationDate + * @param creationDate The creationDate to set + */ + public void setCreationDate(Date creationDate) + { + this.creationDate = creationDate; + } + + /** + * Gets the balance + * @return Returns a BigDecimal + */ + public BigDecimal getBalance() { + return balance; + } + /** + * Sets the balance + * @param balance The balance to set + */ + public void setBalance(BigDecimal balance) + { + this.balance = balance; + } + + /** + * Gets the openBalance + * @return Returns a BigDecimal + */ + public BigDecimal getOpenBalance() { + return openBalance; + } + /** + * Sets the openBalance + * @param openBalance The openBalance to set + */ + public void setOpenBalance(BigDecimal openBalance) + { + this.openBalance = openBalance; + } + + /** + * Gets the profileID + * @return Returns a String + */ + public String getProfileID() { + return profileID; + } + /** + * Sets the profileID + * @param profileID The profileID to set + */ + public void setProfileID(String profileID) { + this.profileID = profileID; + } + /** + * Gets the profileID + * @return Returns a String + */ + /* Disabled for D185273 + public String getUserID() { + return getProfileID(); + } + */ + +} \ No newline at end of file Added: geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/AccountProfileDataBean.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/AccountProfileDataBean.java?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/AccountProfileDataBean.java (added) +++ geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/AccountProfileDataBean.java Tue Sep 20 09:07:08 2005 @@ -0,0 +1,183 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.geronimo.samples.daytrader; + +import org.apache.geronimo.samples.daytrader.util.*; + +public class AccountProfileDataBean + implements java.io.Serializable +{ + + /* Accessor methods for persistent fields */ + + private String userID; /* userID */ + private String password; /* password */ + private String fullName; /* fullName */ + private String address; /* address */ + private String email; /* email */ + private String creditCard; /* creditCard */ + + public AccountProfileDataBean(){ } + public AccountProfileDataBean(String userID, + String password, + String fullName, + String address, + String email, + String creditCard) + { + setUserID(userID); + setPassword(password); + setFullName(fullName); + setAddress(address); + setEmail(email); + setCreditCard(creditCard); + } + + public static AccountProfileDataBean getRandomInstance() { + return new AccountProfileDataBean( + TradeConfig.rndUserID(), // userID + TradeConfig.rndUserID(), // password + TradeConfig.rndFullName(), // fullname + TradeConfig.rndAddress(), // address + TradeConfig.rndEmail(TradeConfig.rndUserID()), //email + TradeConfig.rndCreditCard() // creditCard + ); + } + + public String toString() + { + return "\n\tAccount Profile Data for userID:" + getUserID() + + "\n\t\t password:" + getPassword() + + "\n\t\t fullName:" + getFullName() + + "\n\t\t address:" + getAddress() + + "\n\t\t email:" + getEmail() + + "\n\t\t creditCard:" + getCreditCard() + ; + } + public String toHTML() + { + return "
    Account Profile Data for userID: " + getUserID() + "" + + "
  • password:" + getPassword() + "
  • " + + "
  • fullName:" + getFullName() + "
  • " + + "
  • address:" + getAddress() + "
  • " + + "
  • email:" + getEmail() + "
  • " + + "
  • creditCard:" + getCreditCard() + "
  • " + ; + } + public void print() + { + Log.log( this.toString() ); + } + + /** + * Gets the userID + * @return Returns a String + */ + public String getUserID() { + return userID; + } + /** + * Sets the userID + * @param userID The userID to set + */ + public void setUserID(String userID) + { + this.userID = userID; + } + + /** + * Gets the password + * @return Returns a String + */ + public String getPassword() { + return password; + } + /** + * Sets the password + * @param password The password to set + */ + public void setPassword(String password) + { + this.password = password; + } + + /** + * Gets the fullName + * @return Returns a String + */ + public String getFullName() { + return fullName; + } + /** + * Sets the fullName + * @param fullName The fullName to set + */ + public void setFullName(String fullName) + { + this.fullName = fullName; + } + + /** + * Gets the address + * @return Returns a String + */ + public String getAddress() { + return address; + } + /** + * Sets the address + * @param address The address to set + */ + public void setAddress(String address) + { + this.address = address; + } + + /** + * Gets the email + * @return Returns a String + */ + public String getEmail() { + return email; + } + /** + * Sets the email + * @param email The email to set + */ + public void setEmail(String email) + { + this.email = email; + } + + /** + * Gets the creditCard + * @return Returns a String + */ + public String getCreditCard() { + return creditCard; + } + /** + * Sets the creditCard + * @param creditCard The creditCard to set + */ + public void setCreditCard(String creditCard) + { + this.creditCard = creditCard; + } + +} Added: geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/HoldingDataBean.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/HoldingDataBean.java?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/HoldingDataBean.java (added) +++ geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/HoldingDataBean.java Tue Sep 20 09:07:08 2005 @@ -0,0 +1,172 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.geronimo.samples.daytrader; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import org.apache.geronimo.samples.daytrader.util.*; + +public class HoldingDataBean + implements Serializable { + + /* persistent/relationship fields */ + + private Integer holdingID; /* holdingID */ + private double quantity; /* quantity */ + private BigDecimal purchasePrice; /* purchasePrice */ + private Date purchaseDate; /* purchaseDate */ + private String quoteID; /* Holding(*) ---> Quote(1) */ + + public HoldingDataBean(){ } + public HoldingDataBean(Integer holdingID, + double quantity, + BigDecimal purchasePrice, + Date purchaseDate, + String quoteID) + { + setHoldingID(holdingID); + setQuantity(quantity); + setPurchasePrice(purchasePrice); + setPurchaseDate(purchaseDate); + setQuoteID(quoteID); + } + + public static HoldingDataBean getRandomInstance() { + return new HoldingDataBean( + new Integer(TradeConfig.rndInt(100000)), //holdingID + TradeConfig.rndQuantity(), //quantity + TradeConfig.rndBigDecimal(1000.0f), //purchasePrice + new java.util.Date(TradeConfig.rndInt(Integer.MAX_VALUE)), //purchaseDate + TradeConfig.rndSymbol() // symbol + ); + } + + public String toString() + { + return "\n\tHolding Data for holding: " + getHoldingID() + + "\n\t\t quantity:" + getQuantity() + + "\n\t\t purchasePrice:" + getPurchasePrice() + + "\n\t\t purchaseDate:" + getPurchaseDate() + + "\n\t\t quoteID:" + getQuoteID() + ; + } + + public String toHTML() + { + return "
    Holding Data for holding: " + getHoldingID() + "" + + "
  • quantity:" + getQuantity() + "
  • " + + "
  • purchasePrice:" + getPurchasePrice() + "
  • " + + "
  • purchaseDate:" + getPurchaseDate() + "
  • " + + "
  • quoteID:" + getQuoteID() + "
  • " + ; + } + public void print() + { + Log.log( this.toString() ); + } + /** + * Gets the holdingID + * @return Returns a Integer + */ + public Integer getHoldingID() { + return holdingID; + } + /** + * Sets the holdingID + * @param holdingID The holdingID to set + */ + public void setHoldingID(Integer holdingID) + { + this.holdingID = holdingID; + } + + /** + * Gets the quantity + * @return Returns a BigDecimal + */ + public double getQuantity() { + return quantity; + } + /** + * Sets the quantity + * @param quantity The quantity to set + */ + public void setQuantity(double quantity) + { + this.quantity = quantity; + } + + /** + * Gets the purchasePrice + * @return Returns a BigDecimal + */ + public BigDecimal getPurchasePrice() { + return purchasePrice; + } + /** + * Sets the purchasePrice + * @param purchasePrice The purchasePrice to set + */ + public void setPurchasePrice(BigDecimal purchasePrice) + { + this.purchasePrice = purchasePrice; + } + + /** + * Gets the purchaseDate + * @return Returns a Date + */ + public Date getPurchaseDate() { + return purchaseDate; + } + /** + * Sets the purchaseDate + * @param purchaseDate The purchaseDate to set + */ + public void setPurchaseDate(Date purchaseDate) + { + this.purchaseDate = purchaseDate; + } + + /** + * Gets the quoteID + * @return Returns a Integer + */ + public String getQuoteID() { + return quoteID; + } + /** + * Sets the quoteID + * @param quoteID The quoteID to set + */ + public void setQuoteID(String quoteID) + { + this.quoteID = quoteID; + } + /** + * Gets the quoteID + * @return Returns a Integer + */ + /* Disabled for D185273 + public String getSymbol() { + return getQuoteID(); + } + */ +} Added: geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/MarketSummaryDataBean.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/MarketSummaryDataBean.java?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/MarketSummaryDataBean.java (added) +++ geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/MarketSummaryDataBean.java Tue Sep 20 09:07:08 2005 @@ -0,0 +1,233 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.geronimo.samples.daytrader; + +import java.util.*; +import java.math.BigDecimal; +import java.io.Serializable; + +import org.apache.geronimo.samples.daytrader.util.*; + +public class MarketSummaryDataBean implements Serializable +{ + private BigDecimal TSIA; /* Trade Stock Index Average */ + private BigDecimal openTSIA; /* Trade Stock Index Average at the open */ + private double volume; /* volume of shares traded */ + private Collection topGainers; /* Collection of top gaining stocks */ + private Collection topLosers; /* Collection of top losing stocks */ + //FUTURE private Collection topVolume; /* Collection of top stocks by volume */ + private Date summaryDate; /* Date this summary was taken */ + + //cache the gainPercent once computed for this bean + private BigDecimal gainPercent=null; + + public MarketSummaryDataBean(){ } + public MarketSummaryDataBean(BigDecimal TSIA, + BigDecimal openTSIA, + double volume, + Collection topGainers, + Collection topLosers//, Collection topVolume + ) + { + setTSIA(TSIA); + setOpenTSIA(openTSIA); + setVolume(volume); + setTopGainers(topGainers); + setTopLosers(topLosers); + setSummaryDate(new java.sql.Date(System.currentTimeMillis())); + gainPercent = FinancialUtils.computeGainPercent(getTSIA(), getOpenTSIA()); + + } + + public static MarketSummaryDataBean getRandomInstance() { + Collection gain = new ArrayList(); + Collection lose = new ArrayList(); + + for (int ii = 0; ii < 5; ii++) { + QuoteDataBean quote1 = QuoteDataBean.getRandomInstance(); + QuoteDataBean quote2 = QuoteDataBean.getRandomInstance(); + + gain.add(quote1); + lose.add(quote2); + } + + return new MarketSummaryDataBean( + TradeConfig.rndBigDecimal(1000000.0f), + TradeConfig.rndBigDecimal(1000000.0f), + TradeConfig.rndQuantity(), + gain, + lose + ); + } + + public String toString() + { + String ret = "\n\tMarket Summary at: " + getSummaryDate() + + "\n\t\t TSIA:" + getTSIA() + + "\n\t\t openTSIA:" + getOpenTSIA() + + "\n\t\t gain:" + getGainPercent() + + "\n\t\t volume:" + getVolume() + ; + + if ( (getTopGainers()==null) || (getTopLosers()==null) ) + return ret; + ret += "\n\t\t Current Top Gainers:"; + Iterator it = getTopGainers().iterator(); + while ( it.hasNext() ) + { + QuoteDataBean quoteData = (QuoteDataBean) it.next(); + ret += ( "\n\t\t\t" + quoteData.toString() ); + } + ret += "\n\t\t Current Top Losers:"; + it = getTopLosers().iterator(); + while ( it.hasNext() ) + { + QuoteDataBean quoteData = (QuoteDataBean) it.next(); + ret += ( "\n\t\t\t" + quoteData.toString() ); + } + return ret; + } + public String toHTML() + { + String ret = "
    Market Summary at: " + getSummaryDate() + + "
  • TSIA:" + getTSIA() + "
  • " + + "
  • openTSIA:" + getOpenTSIA() + "
  • " + + "
  • volume:" + getVolume() + "
  • " + ; + if ( (getTopGainers()==null) || (getTopLosers()==null) ) + return ret; + ret += "
    Current Top Gainers:"; + Iterator it = getTopGainers().iterator(); + while ( it.hasNext() ) + { + QuoteDataBean quoteData = (QuoteDataBean) it.next(); + ret += ( "
  • " + quoteData.toString() + "
  • " ); + } + ret += "
    Current Top Losers:"; + it = getTopLosers().iterator(); + while ( it.hasNext() ) + { + QuoteDataBean quoteData = (QuoteDataBean) it.next(); + ret += ( "
  • " + quoteData.toString() + "
  • " ); + } + return ret; + } + public void print() + { + Log.log( this.toString() ); + } + + public BigDecimal getGainPercent() + { + if ( gainPercent == null ) + gainPercent = FinancialUtils.computeGainPercent(getTSIA(), getOpenTSIA()); + return gainPercent; + } + + + /** + * Gets the tSIA + * @return Returns a BigDecimal + */ + public BigDecimal getTSIA() { + return TSIA; + } + /** + * Sets the tSIA + * @param tSIA The tSIA to set + */ + public void setTSIA(BigDecimal tSIA) { + TSIA = tSIA; + } + + /** + * Gets the openTSIA + * @return Returns a BigDecimal + */ + public BigDecimal getOpenTSIA() { + return openTSIA; + } + /** + * Sets the openTSIA + * @param openTSIA The openTSIA to set + */ + public void setOpenTSIA(BigDecimal openTSIA) { + this.openTSIA = openTSIA; + } + + /** + * Gets the volume + * @return Returns a BigDecimal + */ + public double getVolume() { + return volume; + } + /** + * Sets the volume + * @param volume The volume to set + */ + public void setVolume(double volume) { + this.volume = volume; + } + + /** + * Gets the topGainers + * @return Returns a Collection + */ + public Collection getTopGainers() { + return topGainers; + } + /** + * Sets the topGainers + * @param topGainers The topGainers to set + */ + public void setTopGainers(Collection topGainers) { + this.topGainers = topGainers; + } + + /** + * Gets the topLosers + * @return Returns a Collection + */ + public Collection getTopLosers() { + return topLosers; + } + /** + * Sets the topLosers + * @param topLosers The topLosers to set + */ + public void setTopLosers(Collection topLosers) { + this.topLosers = topLosers; + } + + /** + * Gets the summaryDate + * @return Returns a Date + */ + public Date getSummaryDate() { + return summaryDate; + } + /** + * Sets the summaryDate + * @param summaryDate The summaryDate to set + */ + public void setSummaryDate(Date summaryDate) { + this.summaryDate = summaryDate; + } + +} \ No newline at end of file Added: geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/MarketSummaryDataBeanWS.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/MarketSummaryDataBeanWS.java?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/MarketSummaryDataBeanWS.java (added) +++ geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/MarketSummaryDataBeanWS.java Tue Sep 20 09:07:08 2005 @@ -0,0 +1,223 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.geronimo.samples.daytrader; + +import java.util.Collection; +import java.math.BigDecimal; +import java.util.Date; +import java.io.Serializable; + +import org.apache.geronimo.samples.daytrader.util.*; + +/** + * + * @author aspyker + * + * This is a duplicate MarketSummaryDataBean to handle web service handling + * of collections. Instead this class uses typed arrays. + */ +public class MarketSummaryDataBeanWS implements Serializable +{ + private BigDecimal TSIA; /* Trade Stock Index Average */ + private BigDecimal openTSIA; /* Trade Stock Index Average at the open */ + private double volume; /* volume of shares traded */ + private QuoteDataBean topGainers[]; /* Collection of top gaining stocks */ + private QuoteDataBean topLosers[]; /* Collection of top losing stocks */ + private Date summaryDate; /* Date this summary was taken */ + + //cache the gainPercent once computed for this bean + private BigDecimal gainPercent=null; + + public MarketSummaryDataBeanWS(){ } + public MarketSummaryDataBeanWS(BigDecimal TSIA, + BigDecimal openTSIA, + double volume, + QuoteDataBean[] topGainers, + QuoteDataBean[] topLosers//, Collection topVolume + ) + { + setTSIA(TSIA); + setOpenTSIA(openTSIA); + setVolume(volume); + setTopGainers(topGainers); + setTopLosers(topLosers); + setSummaryDate(new java.sql.Date(System.currentTimeMillis())); + gainPercent = FinancialUtils.computeGainPercent(getTSIA(), getOpenTSIA()); + + } + + + public String toString() + { + String ret = "\n\tMarket Summary at: " + getSummaryDate() + + "\n\t\t TSIA:" + getTSIA() + + "\n\t\t openTSIA:" + getOpenTSIA() + //+ "\n\t\t gain:" + getGainPercent() + + "\n\t\t volume:" + getVolume() + ; + + if ( (getTopGainers()==null) || (getTopLosers()==null) ) + return ret; + ret += "\n\t\t Current Top Gainers:"; + for (int ii = 0; ii < topGainers.length; ii++) { + QuoteDataBean quoteData = topGainers[ii]; + ret += ( "\n\t\t\t" + quoteData.toString() ); + } + ret += "\n\t\t Current Top Losers:"; + for (int ii = 0; ii < topLosers.length; ii++) { + QuoteDataBean quoteData = topLosers[ii]; + ret += ( "\n\t\t\t" + quoteData.toString() ); + } + return ret; + } + public String toHTML() + { + String ret = "
    Market Summary at: " + getSummaryDate() + + "
  • TSIA:" + getTSIA() + "
  • " + + "
  • openTSIA:" + getOpenTSIA() + "
  • " + + "
  • volume:" + getVolume() + "
  • " + ; + if ( (getTopGainers()==null) || (getTopLosers()==null) ) + return ret; + ret += "
    Current Top Gainers:"; + for (int ii = 0; ii < topGainers.length; ii++) { + QuoteDataBean quoteData = topGainers[ii]; + ret += ( "
  • " + quoteData.toString() + "
  • " ); + } + ret += "
    Current Top Losers:"; + for (int ii = 0; ii < topLosers.length; ii++) { + QuoteDataBean quoteData = topLosers[ii]; + ret += ( "
  • " + quoteData.toString() + "
  • " ); + } + return ret; + } + public void print() + { + Log.log( this.toString() ); + } + + + /* Disabled for D185273 + public BigDecimal getGainPercent() + { + if ( gainPercent == null ) + gainPercent = FinancialUtils.computeGainPercent(getTSIA(), getOpenTSIA()); + return gainPercent; + } + */ + + + /** + * Gets the tSIA + * @return Returns a BigDecimal + */ + public BigDecimal getTSIA() { + return TSIA; + } + /** + * Sets the tSIA + * @param tSIA The tSIA to set + */ + public void setTSIA(BigDecimal tSIA) { + TSIA = tSIA; + } + + /** + * Gets the openTSIA + * @return Returns a BigDecimal + */ + public BigDecimal getOpenTSIA() { + return openTSIA; + } + /** + * Sets the openTSIA + * @param openTSIA The openTSIA to set + */ + public void setOpenTSIA(BigDecimal openTSIA) { + this.openTSIA = openTSIA; + } + + /** + * Gets the volume + * @return Returns a BigDecimal + */ + public double getVolume() { + return volume; + } + /** + * Sets the volume + * @param volume The volume to set + */ + public void setVolume(double volume) { + this.volume = volume; + } + + /** + * Gets the topGainers + * @return Returns a Collection + */ + public QuoteDataBean[] getTopGainers() { + return topGainers; + } + /** + * Sets the topGainers + * @param topGainers The topGainers to set + */ + public void setTopGainers(QuoteDataBean[] topGainers) { + this.topGainers = topGainers; + } + + /** + * Gets the topLosers + * @return Returns a Collection + */ + public QuoteDataBean[] getTopLosers() { + return topLosers; + } + /** + * Sets the topLosers + * @param topLosers The topLosers to set + */ + public void setTopLosers(QuoteDataBean[] topLosers) { + this.topLosers = topLosers; + } + + /** + * Gets the summaryDate + * @return Returns a Date + */ + public Date getSummaryDate() { + return summaryDate; + } + /** + * Sets the summaryDate + * @param summaryDate The summaryDate to set + */ + public void setSummaryDate(Date summaryDate) { + this.summaryDate = summaryDate; + } + + public static MarketSummaryDataBeanWS convertBean(org.apache.geronimo.samples.daytrader.MarketSummaryDataBean origBean) { + Collection gainCol = origBean.getTopGainers(); + QuoteDataBean gain[] = (QuoteDataBean[])gainCol.toArray(new QuoteDataBean[0]); + Collection loseCol = origBean.getTopLosers(); + QuoteDataBean lose[] = (QuoteDataBean[])loseCol.toArray(new QuoteDataBean[0]); + return new MarketSummaryDataBeanWS(origBean.getTSIA(), origBean.getOpenTSIA(), origBean.getVolume(), gain, lose); + } + +} \ No newline at end of file Added: geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/OrderDataBean.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/OrderDataBean.java?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/OrderDataBean.java (added) +++ geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/OrderDataBean.java Tue Sep 20 09:07:08 2005 @@ -0,0 +1,262 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.geronimo.samples.daytrader; + + +import java.math.BigDecimal; +import java.util.Date; +import java.io.Serializable; + +import org.apache.geronimo.samples.daytrader.util.*; + + + +public class OrderDataBean implements Serializable +{ + + private Integer orderID; /* orderID */ + private String orderType; /* orderType (buy, sell, etc.) */ + private String orderStatus; /* orderStatus (open, processing, completed, closed, cancelled) */ + private Date openDate; /* openDate (when the order was entered) */ + private Date completionDate; /* completionDate */ + private double quantity; /* quantity */ + private BigDecimal price; /* price */ + private BigDecimal orderFee; /* price */ + + + /* Fields for relationship fields are not kept in the Data Bean */ + private String symbol; + + public OrderDataBean() {} + /** + * OrderDataBean + * @construct an OrderDataBean + */ + public OrderDataBean(Integer orderID, + String orderType, + String orderStatus, + Date openDate, + Date completionDate, + double quantity, + BigDecimal price, + BigDecimal orderFee, + String symbol + ) + { + setOrderID(orderID); + setOrderType(orderType); + setOrderStatus(orderStatus); + setOpenDate(openDate); + setCompletionDate(completionDate); + setQuantity(quantity); + setPrice(price); + setOrderFee(orderFee); + setSymbol(symbol); + } + + public static OrderDataBean getRandomInstance() { + return new OrderDataBean( + new Integer(TradeConfig.rndInt(100000)), + TradeConfig.rndBoolean() ? "buy" : "sell", + "open", + new java.util.Date(TradeConfig.rndInt(Integer.MAX_VALUE)), + new java.util.Date(TradeConfig.rndInt(Integer.MAX_VALUE)), + TradeConfig.rndQuantity(), + TradeConfig.rndBigDecimal(1000.0f), + TradeConfig.rndBigDecimal(1000.0f), + TradeConfig.rndSymbol() + ); + } + + public String toString() + { + return "Order " + getOrderID() + + "\n\t orderType: " + getOrderType() + + "\n\t orderStatus: " + getOrderStatus() + + "\n\t openDate: " + getOpenDate() + + "\n\t completionDate: " + getCompletionDate() + + "\n\t quantity: " + getQuantity() + + "\n\t price: " + getPrice() + + "\n\t orderFee: " + getOrderFee() + + "\n\t symbol: " + getSymbol() + ; + } + public String toHTML() + { + return "
    Order " + getOrderID() + "" + + "
  • orderType: " + getOrderType() + "
  • " + + "
  • orderStatus: " + getOrderStatus() + "
  • " + + "
  • openDate: " + getOpenDate() + "
  • " + + "
  • completionDate: " + getCompletionDate() + "
  • " + + "
  • quantity: " + getQuantity() + "
  • " + + "
  • price: " + getPrice() + "
  • " + + "
  • orderFee: " + getOrderFee() + "
  • " + + "
  • symbol: " + getSymbol() + "
  • " + ; + } + + public void print() + { + Log.log( this.toString() ); + } + + /** + * Gets the orderID + * @return Returns a Integer + */ + public Integer getOrderID() { + return orderID; + } + /** + * Sets the orderID + * @param orderID The orderID to set + */ + public void setOrderID(Integer orderID) { + this.orderID = orderID; + } + + + /** + * Gets the orderType + * @return Returns a String + */ + public String getOrderType() { + return orderType; + } + /** + * Sets the orderType + * @param orderType The orderType to set + */ + public void setOrderType(String orderType) { + this.orderType = orderType; + } + + + /** + * Gets the orderStatus + * @return Returns a String + */ + public String getOrderStatus() { + return orderStatus; + } + /** + * Sets the orderStatus + * @param orderStatus The orderStatus to set + */ + public void setOrderStatus(String orderStatus) { + this.orderStatus = orderStatus; + } + + + /** + * Gets the openDate + * @return Returns a Date + */ + public Date getOpenDate() { + return openDate; + } + /** + * Sets the openDate + * @param openDate The openDate to set + */ + public void setOpenDate(Date openDate) { + this.openDate = openDate; + } + + + /** + * Gets the completionDate + * @return Returns a Date + */ + public Date getCompletionDate() { + return completionDate; + } + /** + * Sets the completionDate + * @param completionDate The completionDate to set + */ + public void setCompletionDate(Date completionDate) { + this.completionDate = completionDate; + } + + + /** + * Gets the quantity + * @return Returns a BigDecimal + */ + public double getQuantity() { + return quantity; + } + /** + * Sets the quantity + * @param quantity The quantity to set + */ + public void setQuantity(double quantity) { + this.quantity = quantity; + } + + + /** + * Gets the price + * @return Returns a BigDecimal + */ + public BigDecimal getPrice() { + return price; + } + /** + * Sets the price + * @param price The price to set + */ + public void setPrice(BigDecimal price) { + this.price = price; + } + + + /** + * Gets the orderFee + * @return Returns a BigDecimal + */ + public BigDecimal getOrderFee() { + return orderFee; + } + /** + * Sets the orderFee + * @param orderFee The orderFee to set + */ + public void setOrderFee(BigDecimal orderFee) { + this.orderFee = orderFee; + } + + /** + * Gets the symbol + * @return Returns a String + */ + public String getSymbol() { + return symbol; + } + /** + * Sets the symbol + * @param symbol The symbol to set + */ + public void setSymbol(String symbol) { + this.symbol = symbol; + } + + +} + Added: geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/QuoteDataBean.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/QuoteDataBean.java?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/QuoteDataBean.java (added) +++ geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/QuoteDataBean.java Tue Sep 20 09:07:08 2005 @@ -0,0 +1,240 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.geronimo.samples.daytrader; + +import java.math.BigDecimal; +import java.io.Serializable; + +import org.apache.geronimo.samples.daytrader.util.*; + +public class QuoteDataBean implements Serializable +{ + + /* Accessor methods for persistent fields */ + + private String symbol; /* symbol */ + private String companyName; /* companyName */ + private double volume; /* volume */ + private BigDecimal price; /* price */ + private BigDecimal open; /* open price */ + private BigDecimal low; /* low price */ + private BigDecimal high; /* high price */ + private double change; /* price change */ + + /* Accessor methods for relationship fields are not kept in the DataBean */ + public QuoteDataBean(){ } + + public QuoteDataBean(String symbol, String companyName, double volume, + BigDecimal price, BigDecimal open, BigDecimal low, + BigDecimal high, double change) + { + setSymbol(symbol); + setCompanyName(companyName); + setVolume(volume); + setPrice(price); + setOpen(open); + setLow(low); + setHigh(high); + setChange(change); + } + + public static QuoteDataBean getRandomInstance() { + return new QuoteDataBean( + TradeConfig.rndSymbol(), //symbol + TradeConfig.rndSymbol() + " Incorporated", //Company Name + TradeConfig.rndFloat(100000), //volume + TradeConfig.rndBigDecimal(1000.0f), //price + TradeConfig.rndBigDecimal(1000.0f), //open + TradeConfig.rndBigDecimal(1000.0f), //low + TradeConfig.rndBigDecimal(1000.0f), //high + TradeConfig.rndFloat(100000) //volume + ); + } + + //Create a "zero" value quoteDataBean for the given symbol + public QuoteDataBean(String symbol) + { + setSymbol(symbol); + } + + + public String toString() + { + return "\n\tQuote Data for: " + getSymbol() + + "\n\t\t companyName: " + getCompanyName() + + "\n\t\t volume: " + getVolume() + + "\n\t\t price: " + getPrice() + + "\n\t\t open: " + getOpen() + + "\n\t\t low: " + getLow() + + "\n\t\t high: " + getHigh() + + "\n\t\t change: " + getChange() + ; + } + + public String toHTML() + { + return "
    Quote Data for: " + getSymbol() + + "
  • companyName: " + getCompanyName() + "
  • " + + "
  • volume: " + getVolume()+ "
  • " + + "
  • price: " + getPrice()+ "
  • " + + "
  • open: " + getOpen()+ "
  • " + + "
  • low: " + getLow()+ "
  • " + + "
  • high: " + getHigh()+ "
  • " + + "
  • change: " + getChange()+ "
  • " + ; + } + public void print() + { + Log.log( this.toString() ); + } + + /** + * Gets the symbol + * @return Returns a String + */ + public String getSymbol() + { + return symbol; + } + /** + * Sets the symbol + * @param symbol The symbol to set + */ + public void setSymbol(String symbol) + { + this.symbol = symbol; + } + + /** + * Gets the companyName + * @return Returns a String + */ + public String getCompanyName() + { + return companyName; + } + /** + * Sets the companyName + * @param companyName The companyName to set + */ + public void setCompanyName(String companyName) + { + this.companyName = companyName; + } + + /** + * Gets the price + * @return Returns a BigDecimal + */ + public BigDecimal getPrice() + { + return price; + } + /** + * Sets the price + * @param price The price to set + */ + public void setPrice(BigDecimal price) + { + this.price = price; + } + + /** + * Gets the open + * @return Returns a BigDecimal + */ + public BigDecimal getOpen() + { + return open; + } + /** + * Sets the open + * @param open The open to set + */ + public void setOpen(BigDecimal open) + { + this.open = open; + } + + /** + * Gets the low + * @return Returns a BigDecimal + */ + public BigDecimal getLow() + { + return low; + } + /** + * Sets the low + * @param low The low to set + */ + public void setLow(BigDecimal low) + { + this.low = low; + } + + /** + * Gets the high + * @return Returns a BigDecimal + */ + public BigDecimal getHigh() + { + return high; + } + /** + * Sets the high + * @param high The high to set + */ + public void setHigh(BigDecimal high) + { + this.high = high; + } + + /** + * Gets the change + * @return Returns a double + */ + public double getChange() + { + return change; + } + /** + * Sets the change + * @param change The change to set + */ + public void setChange(double change) + { + this.change = change; + } + + /** + * Gets the volume + * @return Returns a BigDecimal + */ + public double getVolume() { + return volume; + } + /** + * Sets the volume + * @param volume The volume to set + */ + public void setVolume(double volume) { + this.volume = volume; + } + +} \ No newline at end of file Added: geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/RunStatsDataBean.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/RunStatsDataBean.java?rev=290479&view=auto ============================================================================== --- geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/RunStatsDataBean.java (added) +++ geronimo/trunk/sandbox/daytrader/modules/ejb/src/java/org/apache/geronimo/samples/daytrader/RunStatsDataBean.java Tue Sep 20 09:07:08 2005 @@ -0,0 +1,256 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.geronimo.samples.daytrader; + + +import java.io.Serializable; + +public class RunStatsDataBean implements Serializable +{ + //Constructors + public RunStatsDataBean(){ } + + // count of trade users in the database (users w/ userID like 'uid:%') + private int tradeUserCount; + // count of trade stocks in the database (stocks w/ symbol like 's:%') + private int tradeStockCount; + + // count of new registered users in this run (users w/ userID like 'ru:%') -- random user + private int newUserCount; + + // sum of logins by trade users + private int sumLoginCount; + // sum of logouts by trade users + private int sumLogoutCount; + + // count of holdings of trade users + private int holdingCount; + + // count of orders of trade users + private int orderCount; + // count of buy orders of trade users + private int buyOrderCount; + // count of sell orders of trade users + private int sellOrderCount; + // count of cancelled orders of trade users + private int cancelledOrderCount; + // count of open orders of trade users + private int openOrderCount; + // count of orders deleted during this trade Reset + private int deletedOrderCount; + + public String toString() + { + return "\n\tRunStatsData for reset at " + new java.util.Date() + + "\n\t\t tradeUserCount: " + getTradeUserCount() + + "\n\t\t newUserCount: " + getNewUserCount() + + "\n\t\t sumLoginCount: " + getSumLoginCount() + + "\n\t\t sumLogoutCount: " + getSumLogoutCount() + + "\n\t\t holdingCount: " + getHoldingCount() + + "\n\t\t orderCount: " + getOrderCount() + + "\n\t\t buyOrderCount: " + getBuyOrderCount() + + "\n\t\t sellOrderCount: " + getSellOrderCount() + + "\n\t\t cancelledOrderCount: " + getCancelledOrderCount() + + "\n\t\t openOrderCount: " + getOpenOrderCount() + + "\n\t\t deletedOrderCount: " + getDeletedOrderCount() + ; + } + + + /** + * Gets the tradeUserCount + * @return Returns a int + */ + public int getTradeUserCount() { + return tradeUserCount; + } + /** + * Sets the tradeUserCount + * @param tradeUserCount The tradeUserCount to set + */ + public void setTradeUserCount(int tradeUserCount) { + this.tradeUserCount = tradeUserCount; + } + + /** + * Gets the newUserCount + * @return Returns a int + */ + public int getNewUserCount() { + return newUserCount; + } + /** + * Sets the newUserCount + * @param newUserCount The newUserCount to set + */ + public void setNewUserCount(int newUserCount) { + this.newUserCount = newUserCount; + } + + /** + * Gets the sumLoginCount + * @return Returns a int + */ + public int getSumLoginCount() { + return sumLoginCount; + } + /** + * Sets the sumLoginCount + * @param sumLoginCount The sumLoginCount to set + */ + public void setSumLoginCount(int sumLoginCount) { + this.sumLoginCount = sumLoginCount; + } + + /** + * Gets the sumLogoutCount + * @return Returns a int + */ + public int getSumLogoutCount() { + return sumLogoutCount; + } + /** + * Sets the sumLogoutCount + * @param sumLogoutCount The sumLogoutCount to set + */ + public void setSumLogoutCount(int sumLogoutCount) { + this.sumLogoutCount = sumLogoutCount; + } + + /** + * Gets the holdingCount + * @return Returns a int + */ + public int getHoldingCount() { + return holdingCount; + } + /** + * Sets the holdingCount + * @param holdingCount The holdingCount to set + */ + public void setHoldingCount(int holdingCount) { + this.holdingCount = holdingCount; + } + + /** + * Gets the buyOrderCount + * @return Returns a int + */ + public int getBuyOrderCount() { + return buyOrderCount; + } + /** + * Sets the buyOrderCount + * @param buyOrderCount The buyOrderCount to set + */ + public void setBuyOrderCount(int buyOrderCount) { + this.buyOrderCount = buyOrderCount; + } + + /** + * Gets the sellOrderCount + * @return Returns a int + */ + public int getSellOrderCount() { + return sellOrderCount; + } + /** + * Sets the sellOrderCount + * @param sellOrderCount The sellOrderCount to set + */ + public void setSellOrderCount(int sellOrderCount) { + this.sellOrderCount = sellOrderCount; + } + + /** + * Gets the cancelledOrderCount + * @return Returns a int + */ + public int getCancelledOrderCount() { + return cancelledOrderCount; + } + /** + * Sets the cancelledOrderCount + * @param cancelledOrderCount The cancelledOrderCount to set + */ + public void setCancelledOrderCount(int cancelledOrderCount) { + this.cancelledOrderCount = cancelledOrderCount; + } + + /** + * Gets the openOrderCount + * @return Returns a int + */ + public int getOpenOrderCount() { + return openOrderCount; + } + /** + * Sets the openOrderCount + * @param openOrderCount The openOrderCount to set + */ + public void setOpenOrderCount(int openOrderCount) { + this.openOrderCount = openOrderCount; + } + + /** + * Gets the deletedOrderCount + * @return Returns a int + */ + public int getDeletedOrderCount() { + return deletedOrderCount; + } + /** + * Sets the deletedOrderCount + * @param deletedOrderCount The deletedOrderCount to set + */ + public void setDeletedOrderCount(int deletedOrderCount) { + this.deletedOrderCount = deletedOrderCount; + } + + /** + * Gets the orderCount + * @return Returns a int + */ + public int getOrderCount() { + return orderCount; + } + /** + * Sets the orderCount + * @param orderCount The orderCount to set + */ + public void setOrderCount(int orderCount) { + this.orderCount = orderCount; + } + + /** + * Gets the tradeStockCount + * @return Returns a int + */ + public int getTradeStockCount() { + return tradeStockCount; + } + /** + * Sets the tradeStockCount + * @param tradeStockCount The tradeStockCount to set + */ + public void setTradeStockCount(int tradeStockCount) { + this.tradeStockCount = tradeStockCount; + } + +} +