Permalink
Browse files

Merge branch 'master' of github.com:AxonFramework/Axon-trader

  • Loading branch information...
2 parents 656648b + 8bd2dc7 commit cd9937baaab7cd40898fb0a8836b6a8db596f960 @abuijze abuijze committed Nov 19, 2012
Showing with 526 additions and 689 deletions.
  1. +1 −1 .gitignore
  2. +0 −54 companies-api/pom.xml
  3. +1 −1 companies/pom.xml
  4. +5 −5 companies/src/main/java/org/axonframework/samples/trader/company/command/Company.java
  5. +2 −2 companies/src/main/java/org/axonframework/samples/trader/company/command/CompanyCommandHandler.java
  6. +4 −4 ...nies/src/main/java/org/axonframework/samples/trader/company/command/CompanyOrderBookListener.java
  7. +4 −4 ...ies/src/test/java/org/axonframework/samples/trader/company/command/CompanyCommandHandlerTest.java
  8. +4 −20 {users-api → core-api}/pom.xml
  9. +2 −2 ...api/src/main/java/org/axonframework/samples/trader/api/company}/AddOrderBookToCompanyCommand.java
  10. +1 −1 ...i → core-api/src/main/java/org/axonframework/samples/trader/api/company}/CompanyCreatedEvent.java
  11. +6 −3 ...company/api → core-api/src/main/java/org/axonframework/samples/trader/api/company}/CompanyId.java
  12. +2 −2 ... → core-api/src/main/java/org/axonframework/samples/trader/api/company}/CreateCompanyCommand.java
  13. +2 −2 ...api/src/main/java/org/axonframework/samples/trader/api/company}/OrderBookAddedToCompanyEvent.java
  14. +1 −1 ...e-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/AbstractOrderCommand.java
  15. +1 −1 ...i/src/main/java/org/axonframework/samples/trader/api/orders/trades}/AbstractOrderPlacedEvent.java
  16. +1 −1 ...re-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/BuyOrderPlacedEvent.java
  17. +1 −1 ...-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/CreateBuyOrderCommand.java
  18. +1 −1 ...api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/CreateOrderBookCommand.java
  19. +1 −1 ...api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/CreateSellOrderCommand.java
  20. +1 −1 ...-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/OrderBookCreatedEvent.java
  21. +1 −1 ...der → core-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/OrderBookId.java
  22. +1 −1 ...i/order → core-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/OrderId.java
  23. +1 −1 ...der → core-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/PortfolioId.java
  24. +1 −1 ...e-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/SellOrderPlacedEvent.java
  25. +1 −1 ...ore-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/TradeExecutedEvent.java
  26. +1 −1 ...r → core-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/TransactionId.java
  27. +4 −4 ...ava/org/axonframework/samples/trader/api/orders}/transaction/AbstractStartTransactionCommand.java
  28. +2 −2 ...a/org/axonframework/samples/trader/api/orders}/transaction/AbstractTransactionCancelledEvent.java
  29. +2 −2 ...a/org/axonframework/samples/trader/api/orders}/transaction/AbstractTransactionConfirmedEvent.java
  30. +2 −2 ...va/org/axonframework/samples/trader/api/orders}/transaction/AbstractTransactionExecutedEvent.java
  31. +3 −3 ...onframework/samples/trader/api/orders}/transaction/AbstractTransactionPartiallyExecutedEvent.java
  32. +4 −4 ...ava/org/axonframework/samples/trader/api/orders}/transaction/AbstractTransactionStartedEvent.java
  33. +2 −2 ...n/java/org/axonframework/samples/trader/api/orders}/transaction/BuyTransactionCancelledEvent.java
  34. +2 −2 ...n/java/org/axonframework/samples/trader/api/orders}/transaction/BuyTransactionConfirmedEvent.java
  35. +2 −2 ...in/java/org/axonframework/samples/trader/api/orders}/transaction/BuyTransactionExecutedEvent.java
  36. +2 −2 ...rg/axonframework/samples/trader/api/orders}/transaction/BuyTransactionPartiallyExecutedEvent.java
  37. +4 −4 ...ain/java/org/axonframework/samples/trader/api/orders}/transaction/BuyTransactionStartedEvent.java
  38. +2 −2 .../main/java/org/axonframework/samples/trader/api/orders}/transaction/CancelTransactionCommand.java
  39. +2 −2 ...main/java/org/axonframework/samples/trader/api/orders}/transaction/ConfirmTransactionCommand.java
  40. +2 −2 ...ain/java/org/axonframework/samples/trader/api/orders}/transaction/ExecutedTransactionCommand.java
  41. +2 −2 .../java/org/axonframework/samples/trader/api/orders}/transaction/SellTransactionCancelledEvent.java
  42. +2 −2 .../java/org/axonframework/samples/trader/api/orders}/transaction/SellTransactionConfirmedEvent.java
  43. +2 −2 ...n/java/org/axonframework/samples/trader/api/orders}/transaction/SellTransactionExecutedEvent.java
  44. +2 −2 ...g/axonframework/samples/trader/api/orders}/transaction/SellTransactionPartiallyExecutedEvent.java
  45. +4 −4 ...in/java/org/axonframework/samples/trader/api/orders}/transaction/SellTransactionStartedEvent.java
  46. +4 −4 ...ain/java/org/axonframework/samples/trader/api/orders}/transaction/StartBuyTransactionCommand.java
  47. +4 −4 ...in/java/org/axonframework/samples/trader/api/orders}/transaction/StartSellTransactionCommand.java
  48. +1 −1 ...e-api/src/main/java/org/axonframework/samples/trader/api/orders}/transaction/TransactionType.java
  49. +3 −3 ...ore-api/src/main/java/org/axonframework/samples/trader}/api/portfolio/CreatePortfolioCommand.java
  50. +3 −3 ...core-api/src/main/java/org/axonframework/samples/trader}/api/portfolio/PortfolioCreatedEvent.java
  51. +7 −7 ...c/main/java/org/axonframework/samples/trader/api/portfolio/cash/CancelCashReservationCommand.java
  52. +4 −4 ...ore-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/CashDepositedEvent.java
  53. +7 −7 .../main/java/org/axonframework/samples/trader/api/portfolio/cash/CashReservationCancelledEvent.java
  54. +7 −7 .../main/java/org/axonframework/samples/trader/api/portfolio/cash/CashReservationConfirmedEvent.java
  55. +6 −6 ...c/main/java/org/axonframework/samples/trader/api/portfolio/cash/CashReservationRejectedEvent.java
  56. +5 −5 ...core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/CashReservedEvent.java
  57. +4 −4 ...ore-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/CashWithdrawnEvent.java
  58. +8 −8 .../main/java/org/axonframework/samples/trader/api/portfolio/cash/ConfirmCashReservationCommand.java
  59. +5 −5 ...ore-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/DepositCashCommand.java
  60. +7 −7 ...ore-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/ReserveCashCommand.java
  61. +4 −4 ...re-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/WithdrawCashCommand.java
  62. +3 −3 ...c/main/java/org/axonframework/samples/trader/api/portfolio/stock}/AddItemsToPortfolioCommand.java
  63. +4 −4 ...g/axonframework/samples/trader/api/portfolio/stock}/CancelItemReservationForPortfolioCommand.java
  64. +4 −4 .../axonframework/samples/trader/api/portfolio/stock}/ConfirmItemReservationForPortfolioCommand.java
  65. +4 −4 .../axonframework/samples/trader/api/portfolio/stock}/ItemReservationCancelledForPortfolioEvent.java
  66. +4 −4 .../axonframework/samples/trader/api/portfolio/stock}/ItemReservationConfirmedForPortfolioEvent.java
  67. +4 −4 .../axonframework/samples/trader/api/portfolio/stock}/ItemToReserveNotAvailableInPortfolioEvent.java
  68. +3 −3 ...c/main/java/org/axonframework/samples/trader/api/portfolio/stock}/ItemsAddedToPortfolioEvent.java
  69. +4 −4 ...e-api/src/main/java/org/axonframework/samples/trader/api/portfolio/stock}/ItemsReservedEvent.java
  70. +4 −4 ...xonframework/samples/trader/api/portfolio/stock}/NotEnoughItemsAvailableToReserveInPortfolio.java
  71. +4 −4 ...-api/src/main/java/org/axonframework/samples/trader/api/portfolio/stock}/ReserveItemsCommand.java
  72. +1 −1 ...→ core-api/src/main/java/org/axonframework/samples/trader/api/users}/AuthenticateUserCommand.java
  73. +1 −1 ...s/api → core-api/src/main/java/org/axonframework/samples/trader/api/users}/CreateUserCommand.java
  74. +1 −1 ...r/users/api → core-api/src/main/java/org/axonframework/samples/trader/api/users}/UserAccount.java
  75. +1 −1 ... → core-api/src/main/java/org/axonframework/samples/trader/api/users}/UserAuthenticatedEvent.java
  76. +1 −1 ...rs/api → core-api/src/main/java/org/axonframework/samples/trader/api/users}/UserCreatedEvent.java
  77. +1 −1 ...trader/users/api → core-api/src/main/java/org/axonframework/samples/trader/api/users}/UserId.java
  78. +1 −1 external-listeners/pom.xml
  79. +1 −1 ...-listeners/src/main/java/org/axonframework/samples/trader/listener/OrderbookExternalListener.java
  80. +0 −53 orders-api/pom.xml
  81. +1 −16 orders/pom.xml
  82. +20 −20 orders/src/main/java/org/axonframework/samples/trader/orders/command/BuyTradeManagerSaga.java
  83. +19 −19 orders/src/main/java/org/axonframework/samples/trader/orders/command/Portfolio.java
  84. +11 −11 orders/src/main/java/org/axonframework/samples/trader/orders/command/PortfolioCommandHandler.java
  85. +3 −3 ...rc/main/java/org/axonframework/samples/trader/orders/command/PortfolioManagementUserListener.java
  86. +13 −13 orders/src/main/java/org/axonframework/samples/trader/orders/command/SellTradeManagerSaga.java
  87. +3 −3 orders/src/main/java/org/axonframework/samples/trader/orders/command/TradeManagerSaga.java
  88. +4 −4 orders/src/main/java/org/axonframework/samples/trader/orders/command/Transaction.java
  89. +1 −1 orders/src/main/java/org/axonframework/samples/trader/orders/command/TransactionCommandHandler.java
  90. +15 −11 orders/src/test/java/org/axonframework/samples/trader/orders/command/BuyTradeManagerSagaTest.java
  91. +28 −28 ...rs/src/test/java/org/axonframework/samples/trader/orders/command/PortfolioCommandHandlerTest.java
  92. +3 −3 ...est/java/org/axonframework/samples/trader/orders/command/PortfolioManagementUserListenerTest.java
  93. +8 −4 orders/src/test/java/org/axonframework/samples/trader/orders/command/SellTradeManagerSagaTest.java
  94. +4 −4 ...src/test/java/org/axonframework/samples/trader/orders/command/TransactionCommandHandlingTest.java
  95. +3 −3 ...a/org/axonframework/samples/trader/orders/command/matchers/AddItemsToPortfolioCommandMatcher.java
  96. +3 −3 ...ework/samples/trader/orders/command/matchers/CancelItemReservationForPortfolioCommandMatcher.java
  97. +5 −5 ...ork/samples/trader/orders/command/matchers/CancelMoneyReservationFromPortfolioCommandMatcher.java
  98. +2 −2 ...ava/org/axonframework/samples/trader/orders/command/matchers/CancelTransactionCommandMatcher.java
  99. +3 −3 ...work/samples/trader/orders/command/matchers/ConfirmItemReservationForPortfolioCommandMatcher.java
  100. +5 −5 ...k/samples/trader/orders/command/matchers/ConfirmMoneyReservationFromPortfolionCommandMatcher.java
  101. +2 −2 ...va/org/axonframework/samples/trader/orders/command/matchers/ConfirmTransactionCommandMatcher.java
  102. +3 −3 ...t/java/org/axonframework/samples/trader/orders/command/matchers/CreateBuyOrderCommandMatcher.java
  103. +3 −3 .../java/org/axonframework/samples/trader/orders/command/matchers/CreateSellOrderCommandMatcher.java
  104. +5 −5 ...g/axonframework/samples/trader/orders/command/matchers/DepositMoneyToPortfolioCommandMatcher.java
  105. +2 −2 ...a/org/axonframework/samples/trader/orders/command/matchers/ExecutedTransactionCommandMatcher.java
  106. +5 −5 ...axonframework/samples/trader/orders/command/matchers/ReserveMoneyFromPortfolioCommandMatcher.java
  107. +3 −3 ...st/java/org/axonframework/samples/trader/orders/command/matchers/ReservedItemsCommandMatcher.java
  108. +1 −4 pom.xml
  109. +1 −16 query/pom.xml
  110. +1 −1 query/src/main/java/org/axonframework/samples/trader/query/company/CompanyListener.java
  111. +7 −2 query/src/main/java/org/axonframework/samples/trader/query/orderbook/OrderBookListener.java
  112. +4 −4 query/src/main/java/org/axonframework/samples/trader/query/portfolio/PortfolioItemEventListener.java
  113. +7 −7 ...y/src/main/java/org/axonframework/samples/trader/query/portfolio/PortfolioMoneyEventListener.java
  114. +1 −1 query/src/main/java/org/axonframework/samples/trader/query/transaction/TransactionEntry.java
  115. +1 −1 query/src/main/java/org/axonframework/samples/trader/query/transaction/TransactionEventListener.java
  116. +1 −1 ...org/axonframework/samples/trader/query/company/repositories/CompanyRepositoryIntegrationTest.java
  117. +10 −4 .../test/java/org/axonframework/samples/trader/query/orderbook/OrderBookListenerIntegrationTest.java
  118. +9 −9 ...rc/test/java/org/axonframework/samples/trader/query/portfolio/PortfolioItemEventListenerTest.java
  119. +1 −1 query/src/test/java/org/axonframework/samples/trader/query/transaction/TransactionEntryMatcher.java
  120. +9 −9 ...rc/test/java/org/axonframework/samples/trader/query/transaction/TransactionEventListenerTest.java
  121. +0 −37 trade-engine-api/pom.xml
  122. +1 −1 trade-engine/pom.xml
  123. +4 −4 trade-engine/src/main/java/org/axonframework/samples/trader/tradeengine/command/Order.java
  124. +8 −8 trade-engine/src/main/java/org/axonframework/samples/trader/tradeengine/command/OrderBook.java
  125. +3 −3 ...e/src/main/java/org/axonframework/samples/trader/tradeengine/command/OrderBookCommandHandler.java
  126. +10 −1 ...c/test/java/org/axonframework/samples/trader/tradeengine/command/OrderBookCommandHandlerTest.java
  127. +1 −1 users-query/pom.xml
  128. +1 −1 users-query/src/main/java/org/axonframework/samples/trader/query/users/UserEntry.java
  129. +1 −1 users-query/src/main/java/org/axonframework/samples/trader/query/users/UserListener.java
  130. +1 −6 users/pom.xml
  131. +3 −3 users/src/main/java/org/axonframework/samples/trader/users/command/User.java
  132. +4 −4 users/src/main/java/org/axonframework/samples/trader/users/command/UserCommandHandler.java
  133. +5 −1 users/src/test/java/org/axonframework/samples/trader/app/command/user/UserCommandHandlerTest.java
  134. +7 −7 web-ui/src/main/java/org/axonframework/samples/trader/webui/admin/AdminController.java
  135. +6 −6 web-ui/src/main/java/org/axonframework/samples/trader/webui/companies/CompanyController.java
  136. +11 −11 web-ui/src/main/java/org/axonframework/samples/trader/webui/init/DBInit.java
  137. +1 −1 web-ui/src/main/java/org/axonframework/samples/trader/webui/init/MongoController.java
  138. +2 −2 ...i/src/main/java/org/axonframework/samples/trader/webui/security/TraderAuthenticationProvider.java
  139. +1 −1 web-ui/src/main/java/org/axonframework/samples/trader/webui/util/SecurityUtil.java
  140. +7 −7 web-ui/src/test/java/org/axonframework/samples/trader/test/CommandCreator.groovy
View
@@ -5,7 +5,7 @@
.gradle
build
# intellij files
-.idea/*
+.idea/
**/.idea/*
**/gradle.properties
*.ipr
View
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Copyright (c) 2010-2012. Axon Framework
- ~
- ~ 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.
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.axonframework.samples</groupId>
- <artifactId>axon-trader</artifactId>
- <version>0.1-SNAPSHOT</version>
- </parent>
-
- <artifactId>axon-trader-companies-api</artifactId>
-
- <dependencies>
- <!-- Internal dependencies -->
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>axon-trader-users-api</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>axon-trader-trade-engine-api</artifactId>
- <version>${project.version}</version>
- </dependency>
-
-
- <!-- External dependencies -->
- <dependency>
- <groupId>org.axonframework</groupId>
- <artifactId>axon-core</artifactId>
- <version>${axon.version}</version>
- </dependency>
- </dependencies>
-
-</project>
View
@@ -31,7 +31,7 @@
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>axon-trader-companies-api</artifactId>
+ <artifactId>axon-trader-core-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
@@ -19,15 +19,15 @@
import org.axonframework.eventhandling.annotation.EventHandler;
import org.axonframework.eventsourcing.annotation.AbstractAnnotatedAggregateRoot;
import org.axonframework.eventsourcing.annotation.AggregateIdentifier;
-import org.axonframework.samples.trader.company.api.CompanyCreatedEvent;
-import org.axonframework.samples.trader.company.api.CompanyId;
-import org.axonframework.samples.trader.company.api.OrderBookAddedToCompanyEvent;
-import org.axonframework.samples.trader.tradeengine.api.order.OrderBookId;
+import org.axonframework.samples.trader.api.company.CompanyCreatedEvent;
+import org.axonframework.samples.trader.api.company.CompanyId;
+import org.axonframework.samples.trader.api.company.OrderBookAddedToCompanyEvent;
+import org.axonframework.samples.trader.api.orders.trades.OrderBookId;
/**
* @author Jettro Coenradie
*/
-public class Company extends AbstractAnnotatedAggregateRoot {
+class Company extends AbstractAnnotatedAggregateRoot {
private static final long serialVersionUID = 8723320580782813954L;
@AggregateIdentifier
@@ -18,8 +18,8 @@
import org.axonframework.commandhandling.annotation.CommandHandler;
import org.axonframework.repository.Repository;
-import org.axonframework.samples.trader.company.api.AddOrderBookToCompanyCommand;
-import org.axonframework.samples.trader.company.api.CreateCompanyCommand;
+import org.axonframework.samples.trader.api.company.AddOrderBookToCompanyCommand;
+import org.axonframework.samples.trader.api.company.CreateCompanyCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
@@ -19,10 +19,10 @@
import org.axonframework.commandhandling.CommandBus;
import org.axonframework.commandhandling.GenericCommandMessage;
import org.axonframework.eventhandling.annotation.EventHandler;
-import org.axonframework.samples.trader.company.api.AddOrderBookToCompanyCommand;
-import org.axonframework.samples.trader.company.api.CompanyCreatedEvent;
-import org.axonframework.samples.trader.tradeengine.api.order.CreateOrderBookCommand;
-import org.axonframework.samples.trader.tradeengine.api.order.OrderBookId;
+import org.axonframework.samples.trader.api.company.AddOrderBookToCompanyCommand;
+import org.axonframework.samples.trader.api.company.CompanyCreatedEvent;
+import org.axonframework.samples.trader.api.orders.trades.CreateOrderBookCommand;
+import org.axonframework.samples.trader.api.orders.trades.OrderBookId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -16,10 +16,10 @@
package org.axonframework.samples.trader.company.command;
-import org.axonframework.samples.trader.company.api.CompanyCreatedEvent;
-import org.axonframework.samples.trader.company.api.CompanyId;
-import org.axonframework.samples.trader.company.api.CreateCompanyCommand;
-import org.axonframework.samples.trader.users.api.UserId;
+import org.axonframework.samples.trader.api.company.CompanyCreatedEvent;
+import org.axonframework.samples.trader.api.company.CompanyId;
+import org.axonframework.samples.trader.api.company.CreateCompanyCommand;
+import org.axonframework.samples.trader.api.users.UserId;
import org.axonframework.test.FixtureConfiguration;
import org.axonframework.test.Fixtures;
import org.junit.Before;
@@ -1,32 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Copyright (c) 2010-2012. Axon Framework
- ~
- ~ 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.
- -->
-
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
<parent>
- <groupId>org.axonframework.samples</groupId>
<artifactId>axon-trader</artifactId>
+ <groupId>org.axonframework.samples</groupId>
<version>0.1-SNAPSHOT</version>
</parent>
+ <modelVersion>4.0.0</modelVersion>
- <artifactId>axon-trader-users-api</artifactId>
+ <groupId>org.axonframework.samples</groupId>
+ <artifactId>axon-trader-core-api</artifactId>
<dependencies>
<dependency>
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.company.api;
+package org.axonframework.samples.trader.api.company;
-import org.axonframework.samples.trader.tradeengine.api.order.OrderBookId;
+import org.axonframework.samples.trader.api.orders.trades.OrderBookId;
/**
* <p>Create the relation between a company and an OrderBook</p>
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.company.api;
+package org.axonframework.samples.trader.api.company;
/**
* <p>A new company is created with a certain value and an amount of shares. Those two values can be used to calculate
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.company.api;
+package org.axonframework.samples.trader.api.company;
import org.axonframework.common.Assert;
import org.axonframework.domain.IdentifierFactory;
@@ -27,15 +27,18 @@
public class CompanyId implements Serializable {
private static final long serialVersionUID = -2521069615900157076L;
- private String identifier;
+ private final String identifier;
+ private final int hashCode;
public CompanyId() {
this.identifier = IdentifierFactory.getInstance().generateIdentifier();
+ this.hashCode = identifier.hashCode();
}
public CompanyId(String identifier) {
Assert.notNull(identifier, "Identifier may not be null");
this.identifier = identifier;
+ this.hashCode = identifier.hashCode();
}
@Override
@@ -51,7 +54,7 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
- return identifier.hashCode();
+ return hashCode;
}
@Override
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.company.api;
+package org.axonframework.samples.trader.api.company;
-import org.axonframework.samples.trader.users.api.UserId;
+import org.axonframework.samples.trader.api.users.UserId;
/**
* <p>Create a new company by proving the name, the estimated value of the company and the amount of shares that are
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.company.api;
+package org.axonframework.samples.trader.api.company;
-import org.axonframework.samples.trader.tradeengine.api.order.OrderBookId;
+import org.axonframework.samples.trader.api.orders.trades.OrderBookId;
/**
* <p>A new OrderBook is added to the Company</p>
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.tradeengine.api.order;
+package org.axonframework.samples.trader.api.orders.trades;
import org.axonframework.commandhandling.annotation.TargetAggregateIdentifier;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.tradeengine.api.order;
+package org.axonframework.samples.trader.api.orders.trades;
/**
* <p>Abstract parent class for all buy and sell order placed events.</p>
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.tradeengine.api.order;
+package org.axonframework.samples.trader.api.orders.trades;
/**
* <p>A new Buy Order is placed.</p>
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.tradeengine.api.order;
+package org.axonframework.samples.trader.api.orders.trades;
/**
* <p>Create a new Buy Order.</p>
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.tradeengine.api.order;
+package org.axonframework.samples.trader.api.orders.trades;
/**
* <p>Create a new OrderBook for the Company represented by the provided companyIdentifier.</p>
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.tradeengine.api.order;
+package org.axonframework.samples.trader.api.orders.trades;
/**
* <p>Create a new Sell Order using the amount of items to sell for the provided price.</p>
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.tradeengine.api.order;
+package org.axonframework.samples.trader.api.orders.trades;
/**
* <p>A new OrderBook is created for the company with the provided identifier.</p>
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.tradeengine.api.order;
+package org.axonframework.samples.trader.api.orders.trades;
import org.axonframework.common.Assert;
import org.axonframework.domain.IdentifierFactory;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.tradeengine.api.order;
+package org.axonframework.samples.trader.api.orders.trades;
import org.axonframework.common.Assert;
import org.axonframework.domain.IdentifierFactory;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.tradeengine.api.order;
+package org.axonframework.samples.trader.api.orders.trades;
import org.axonframework.common.Assert;
import org.axonframework.domain.IdentifierFactory;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.tradeengine.api.order;
+package org.axonframework.samples.trader.api.orders.trades;
/**
* <p>A new Sell Order is placed for the current OrderBook. </p>
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.tradeengine.api.order;
+package org.axonframework.samples.trader.api.orders.trades;
import java.io.Serializable;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.tradeengine.api.order;
+package org.axonframework.samples.trader.api.orders.trades;
import org.axonframework.common.Assert;
import org.axonframework.domain.IdentifierFactory;
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.transaction;
+package org.axonframework.samples.trader.api.orders.transaction;
-import org.axonframework.samples.trader.tradeengine.api.order.OrderBookId;
-import org.axonframework.samples.trader.tradeengine.api.order.PortfolioId;
-import org.axonframework.samples.trader.tradeengine.api.order.TransactionId;
+import org.axonframework.samples.trader.api.orders.trades.OrderBookId;
+import org.axonframework.samples.trader.api.orders.trades.PortfolioId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
Oops, something went wrong.

0 comments on commit cd9937b

Please sign in to comment.