Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit cd9937baaab7cd40898fb0a8836b6a8db596f960 2 parents 656648b + 8bd2dc7
@abuijze abuijze authored
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 companies/src/main/java/org/axonframework/samples/trader/company/command/CompanyOrderBookListener.java
  7. +4 −4 companies/src/test/java/org/axonframework/samples/trader/company/command/CompanyCommandHandlerTest.java
  8. +4 −20 {users-api → core-api}/pom.xml
  9. +2 −2 ...arr; core-api/src/main/java/org/axonframework/samples/trader/api/company}/AddOrderBookToCompanyCommand.java
  10. +1 −1  ...ny/api → core-api/src/main/java/org/axonframework/samples/trader/api/company}/CompanyCreatedEvent.java
  11. +6 −3 ...ader/company/api → core-api/src/main/java/org/axonframework/samples/trader/api/company}/CompanyId.java
  12. +2 −2 ...y/api → core-api/src/main/java/org/axonframework/samples/trader/api/company}/CreateCompanyCommand.java
  13. +2 −2 ...arr; core-api/src/main/java/org/axonframework/samples/trader/api/company}/OrderBookAddedToCompanyEvent.java
  14. +1 −1  ...→ core-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/AbstractOrderCommand.java
  15. +1 −1  ...r; core-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/AbstractOrderPlacedEvent.java
  16. +1 −1  ... → core-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/BuyOrderPlacedEvent.java
  17. +1 −1  ...rarr; core-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/CreateBuyOrderCommand.java
  18. +1 −1  ...arr; core-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/CreateOrderBookCommand.java
  19. +1 −1  ...arr; core-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/CreateSellOrderCommand.java
  20. +1 −1  ...rarr; core-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/OrderBookCreatedEvent.java
  21. +1 −1  ...pi/order → core-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/OrderBookId.java
  22. +1 −1  ...ne/api/order → core-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/OrderId.java
  23. +1 −1  ...pi/order → core-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/PortfolioId.java
  24. +1 −1  ...→ core-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/SellOrderPlacedEvent.java
  25. +1 −1  ...r → core-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/TradeExecutedEvent.java
  26. +1 −1  .../order → core-api/src/main/java/org/axonframework/samples/trader/api/orders/trades}/TransactionId.java
  27. +4 −4 ...src/main/java/org/axonframework/samples/trader/api/orders}/transaction/AbstractStartTransactionCommand.java
  28. +2 −2 ...c/main/java/org/axonframework/samples/trader/api/orders}/transaction/AbstractTransactionCancelledEvent.java
  29. +2 −2 ...c/main/java/org/axonframework/samples/trader/api/orders}/transaction/AbstractTransactionConfirmedEvent.java
  30. +2 −2 ...rc/main/java/org/axonframework/samples/trader/api/orders}/transaction/AbstractTransactionExecutedEvent.java
  31. +3 −3 ...ava/org/axonframework/samples/trader/api/orders}/transaction/AbstractTransactionPartiallyExecutedEvent.java
  32. +4 −4 ...src/main/java/org/axonframework/samples/trader/api/orders}/transaction/AbstractTransactionStartedEvent.java
  33. +2 −2 ...pi/src/main/java/org/axonframework/samples/trader/api/orders}/transaction/BuyTransactionCancelledEvent.java
  34. +2 −2 ...pi/src/main/java/org/axonframework/samples/trader/api/orders}/transaction/BuyTransactionConfirmedEvent.java
  35. +2 −2 ...api/src/main/java/org/axonframework/samples/trader/api/orders}/transaction/BuyTransactionExecutedEvent.java
  36. +2 −2 ...ain/java/org/axonframework/samples/trader/api/orders}/transaction/BuyTransactionPartiallyExecutedEvent.java
  37. +4 −4 ...-api/src/main/java/org/axonframework/samples/trader/api/orders}/transaction/BuyTransactionStartedEvent.java
  38. +2 −2 ...re-api/src/main/java/org/axonframework/samples/trader/api/orders}/transaction/CancelTransactionCommand.java
  39. +2 −2 ...e-api/src/main/java/org/axonframework/samples/trader/api/orders}/transaction/ConfirmTransactionCommand.java
  40. +2 −2 ...-api/src/main/java/org/axonframework/samples/trader/api/orders}/transaction/ExecutedTransactionCommand.java
  41. +2 −2 ...i/src/main/java/org/axonframework/samples/trader/api/orders}/transaction/SellTransactionCancelledEvent.java
  42. +2 −2 ...i/src/main/java/org/axonframework/samples/trader/api/orders}/transaction/SellTransactionConfirmedEvent.java
  43. +2 −2 ...pi/src/main/java/org/axonframework/samples/trader/api/orders}/transaction/SellTransactionExecutedEvent.java
  44. +2 −2 ...in/java/org/axonframework/samples/trader/api/orders}/transaction/SellTransactionPartiallyExecutedEvent.java
  45. +4 −4 ...api/src/main/java/org/axonframework/samples/trader/api/orders}/transaction/SellTransactionStartedEvent.java
  46. +4 −4 ...-api/src/main/java/org/axonframework/samples/trader/api/orders}/transaction/StartBuyTransactionCommand.java
  47. +4 −4 ...api/src/main/java/org/axonframework/samples/trader/api/orders}/transaction/StartSellTransactionCommand.java
  48. +1 −1  ...→ core-api/src/main/java/org/axonframework/samples/trader/api/orders}/transaction/TransactionType.java
  49. +3 −3 ...s → core-api/src/main/java/org/axonframework/samples/trader}/api/portfolio/CreatePortfolioCommand.java
  50. +3 −3 ...rs → core-api/src/main/java/org/axonframework/samples/trader}/api/portfolio/PortfolioCreatedEvent.java
  51. +7 −7 ...ore-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/CancelCashReservationCommand.java
  52. +4 −4 ...a → core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/CashDepositedEvent.java
  53. +7 −7 ...re-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/CashReservationCancelledEvent.java
  54. +7 −7 ...re-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/CashReservationConfirmedEvent.java
  55. +6 −6 ...ore-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/CashReservationRejectedEvent.java
  56. +5 −5 ...va → core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/CashReservedEvent.java
  57. +4 −4 ...a → core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/CashWithdrawnEvent.java
  58. +8 −8 ...re-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/ConfirmCashReservationCommand.java
  59. +5 −5 ...a → core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/DepositCashCommand.java
  60. +7 −7 ...a → core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/ReserveCashCommand.java
  61. +4 −4 ... → core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/WithdrawCashCommand.java
  62. +3 −3 ...ore-api/src/main/java/org/axonframework/samples/trader/api/portfolio/stock}/AddItemsToPortfolioCommand.java
  63. +4 −4 ...in/java/org/axonframework/samples/trader/api/portfolio/stock}/CancelItemReservationForPortfolioCommand.java
  64. +4 −4 ...n/java/org/axonframework/samples/trader/api/portfolio/stock}/ConfirmItemReservationForPortfolioCommand.java
  65. +4 −4 ...n/java/org/axonframework/samples/trader/api/portfolio/stock}/ItemReservationCancelledForPortfolioEvent.java
  66. +4 −4 ...n/java/org/axonframework/samples/trader/api/portfolio/stock}/ItemReservationConfirmedForPortfolioEvent.java
  67. +4 −4 ...n/java/org/axonframework/samples/trader/api/portfolio/stock}/ItemToReserveNotAvailableInPortfolioEvent.java
  68. +3 −3 ...ore-api/src/main/java/org/axonframework/samples/trader/api/portfolio/stock}/ItemsAddedToPortfolioEvent.java
  69. +4 −4 ...→ core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/stock}/ItemsReservedEvent.java
  70. +4 −4 ...java/org/axonframework/samples/trader/api/portfolio/stock}/NotEnoughItemsAvailableToReserveInPortfolio.java
  71. +4 −4 ...rarr; core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/stock}/ReserveItemsCommand.java
  72. +1 −1  .../api → core-api/src/main/java/org/axonframework/samples/trader/api/users}/AuthenticateUserCommand.java
  73. +1 −1  .../users/api → core-api/src/main/java/org/axonframework/samples/trader/api/users}/CreateUserCommand.java
  74. +1 −1  ...trader/users/api → core-api/src/main/java/org/axonframework/samples/trader/api/users}/UserAccount.java
  75. +1 −1  ...s/api → core-api/src/main/java/org/axonframework/samples/trader/api/users}/UserAuthenticatedEvent.java
  76. +1 −1  ...r/users/api → core-api/src/main/java/org/axonframework/samples/trader/api/users}/UserCreatedEvent.java
  77. +1 −1  ...ples/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  external-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 orders/src/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 orders/src/test/java/org/axonframework/samples/trader/orders/command/PortfolioCommandHandlerTest.java
  92. +3 −3 orders/src/test/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 orders/src/test/java/org/axonframework/samples/trader/orders/command/TransactionCommandHandlingTest.java
  95. +3 −3 ...c/test/java/org/axonframework/samples/trader/orders/command/matchers/AddItemsToPortfolioCommandMatcher.java
  96. +3 −3 ...g/axonframework/samples/trader/orders/command/matchers/CancelItemReservationForPortfolioCommandMatcher.java
  97. +5 −5 ...axonframework/samples/trader/orders/command/matchers/CancelMoneyReservationFromPortfolioCommandMatcher.java
  98. +2 −2 ...src/test/java/org/axonframework/samples/trader/orders/command/matchers/CancelTransactionCommandMatcher.java
  99. +3 −3 .../axonframework/samples/trader/orders/command/matchers/ConfirmItemReservationForPortfolioCommandMatcher.java
  100. +5 −5 ...onframework/samples/trader/orders/command/matchers/ConfirmMoneyReservationFromPortfolionCommandMatcher.java
  101. +2 −2 ...rc/test/java/org/axonframework/samples/trader/orders/command/matchers/ConfirmTransactionCommandMatcher.java
  102. +3 −3 ...rs/src/test/java/org/axonframework/samples/trader/orders/command/matchers/CreateBuyOrderCommandMatcher.java
  103. +3 −3 ...s/src/test/java/org/axonframework/samples/trader/orders/command/matchers/CreateSellOrderCommandMatcher.java
  104. +5 −5 ...st/java/org/axonframework/samples/trader/orders/command/matchers/DepositMoneyToPortfolioCommandMatcher.java
  105. +2 −2 ...c/test/java/org/axonframework/samples/trader/orders/command/matchers/ExecutedTransactionCommandMatcher.java
  106. +5 −5 .../java/org/axonframework/samples/trader/orders/command/matchers/ReserveMoneyFromPortfolioCommandMatcher.java
  107. +3 −3 orders/src/test/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 query/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  ...test/java/org/axonframework/samples/trader/query/company/repositories/CompanyRepositoryIntegrationTest.java
  117. +10 −4 query/src/test/java/org/axonframework/samples/trader/query/orderbook/OrderBookListenerIntegrationTest.java
  118. +9 −9 query/src/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 query/src/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 trade-engine/src/main/java/org/axonframework/samples/trader/tradeengine/command/OrderBookCommandHandler.java
  126. +10 −1 ...-engine/src/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 web-ui/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
2  .gitignore
@@ -5,7 +5,7 @@
.gradle
build
# intellij files
-.idea/*
+.idea/
**/.idea/*
**/gradle.properties
*.ipr
View
54 companies-api/pom.xml
@@ -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
2  companies/pom.xml
@@ -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>
View
10 companies/src/main/java/org/axonframework/samples/trader/company/command/Company.java
@@ -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
View
4 companies/src/main/java/org/axonframework/samples/trader/company/command/CompanyCommandHandler.java
@@ -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;
View
8 companies/src/main/java/org/axonframework/samples/trader/company/command/CompanyOrderBookListener.java
@@ -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;
View
8 companies/src/test/java/org/axonframework/samples/trader/company/command/CompanyCommandHandlerTest.java
@@ -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;
View
24 users-api/pom.xml → core-api/pom.xml
@@ -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>
View
4 ...der/company/api/AddOrderBookToCompanyCommand.java → ...der/api/company/AddOrderBookToCompanyCommand.java
@@ -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>
View
2  ...mples/trader/company/api/CompanyCreatedEvent.java → ...mples/trader/api/company/CompanyCreatedEvent.java
@@ -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
View
9 ...amework/samples/trader/company/api/CompanyId.java → ...amework/samples/trader/api/company/CompanyId.java
@@ -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
View
4 ...ples/trader/company/api/CreateCompanyCommand.java → ...ples/trader/api/company/CreateCompanyCommand.java
@@ -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
View
4 ...der/company/api/OrderBookAddedToCompanyEvent.java → ...der/api/company/OrderBookAddedToCompanyEvent.java
@@ -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>
View
2  ...r/tradeengine/api/order/AbstractOrderCommand.java → ...rader/api/orders/trades/AbstractOrderCommand.java
@@ -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;
View
2  ...adeengine/api/order/AbstractOrderPlacedEvent.java → ...r/api/orders/trades/AbstractOrderPlacedEvent.java
@@ -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>
View
2  ...er/tradeengine/api/order/BuyOrderPlacedEvent.java → ...trader/api/orders/trades/BuyOrderPlacedEvent.java
@@ -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>
View
2  .../tradeengine/api/order/CreateBuyOrderCommand.java → ...ader/api/orders/trades/CreateBuyOrderCommand.java
@@ -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>
View
2  ...tradeengine/api/order/CreateOrderBookCommand.java → ...der/api/orders/trades/CreateOrderBookCommand.java
@@ -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>
View
2  ...tradeengine/api/order/CreateSellOrderCommand.java → ...der/api/orders/trades/CreateSellOrderCommand.java
@@ -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>
View
2  .../tradeengine/api/order/OrderBookCreatedEvent.java → ...ader/api/orders/trades/OrderBookCreatedEvent.java
@@ -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>
View
2  ...les/trader/tradeengine/api/order/OrderBookId.java → ...samples/trader/api/orders/trades/OrderBookId.java
@@ -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;
View
2  ...samples/trader/tradeengine/api/order/OrderId.java → ...ork/samples/trader/api/orders/trades/OrderId.java
@@ -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;
View
2  ...les/trader/tradeengine/api/order/PortfolioId.java → ...samples/trader/api/orders/trades/PortfolioId.java
@@ -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;
View
2  ...r/tradeengine/api/order/SellOrderPlacedEvent.java → ...rader/api/orders/trades/SellOrderPlacedEvent.java
@@ -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>
View
2  ...der/tradeengine/api/order/TradeExecutedEvent.java → .../trader/api/orders/trades/TradeExecutedEvent.java
@@ -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;
View
2  ...s/trader/tradeengine/api/order/TransactionId.java → ...mples/trader/api/orders/trades/TransactionId.java
@@ -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;
View
8 .../transaction/AbstractStartTransactionCommand.java → .../transaction/AbstractStartTransactionCommand.java
@@ -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
View
4 ...ransaction/AbstractTransactionCancelledEvent.java → ...ransaction/AbstractTransactionCancelledEvent.java
@@ -14,9 +14,9 @@
* 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.TransactionId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
View
4 ...ransaction/AbstractTransactionConfirmedEvent.java → ...ransaction/AbstractTransactionConfirmedEvent.java
@@ -14,9 +14,9 @@
* 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.TransactionId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
View
4 ...transaction/AbstractTransactionExecutedEvent.java → ...transaction/AbstractTransactionExecutedEvent.java
@@ -14,9 +14,9 @@
* 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.TransactionId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
View
6 ...on/AbstractTransactionPartiallyExecutedEvent.java → ...on/AbstractTransactionPartiallyExecutedEvent.java
@@ -14,14 +14,14 @@
* 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.TransactionId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
*/
-public class AbstractTransactionPartiallyExecutedEvent {
+public abstract class AbstractTransactionPartiallyExecutedEvent {
private TransactionId transactionIdentifier;
private long amountOfExecutedItems;
private long totalOfExecutedItems;
View
8 .../transaction/AbstractTransactionStartedEvent.java → .../transaction/AbstractTransactionStartedEvent.java
@@ -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
View
4 ...api/transaction/BuyTransactionCancelledEvent.java → ...ers/transaction/BuyTransactionCancelledEvent.java
@@ -14,9 +14,9 @@
* 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.TransactionId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
View
4 ...api/transaction/BuyTransactionConfirmedEvent.java → ...ers/transaction/BuyTransactionConfirmedEvent.java
@@ -14,9 +14,9 @@
* 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.TransactionId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
View
4 .../api/transaction/BuyTransactionExecutedEvent.java → ...ders/transaction/BuyTransactionExecutedEvent.java
@@ -14,9 +14,9 @@
* 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.TransactionId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
View
4 ...saction/BuyTransactionPartiallyExecutedEvent.java → ...saction/BuyTransactionPartiallyExecutedEvent.java
@@ -14,9 +14,9 @@
* 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.TransactionId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
View
8 ...s/api/transaction/BuyTransactionStartedEvent.java → ...rders/transaction/BuyTransactionStartedEvent.java
@@ -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
View
4 ...ers/api/transaction/CancelTransactionCommand.java → .../orders/transaction/CancelTransactionCommand.java
@@ -14,9 +14,9 @@
* 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.TransactionId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
View
4 ...rs/api/transaction/ConfirmTransactionCommand.java → ...orders/transaction/ConfirmTransactionCommand.java
@@ -14,9 +14,9 @@
* 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.TransactionId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
View
4 ...s/api/transaction/ExecutedTransactionCommand.java → ...rders/transaction/ExecutedTransactionCommand.java
@@ -14,9 +14,9 @@
* 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.TransactionId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
View
4 ...pi/transaction/SellTransactionCancelledEvent.java → ...rs/transaction/SellTransactionCancelledEvent.java
@@ -14,9 +14,9 @@
* 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.TransactionId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
View
4 ...pi/transaction/SellTransactionConfirmedEvent.java → ...rs/transaction/SellTransactionConfirmedEvent.java
@@ -14,9 +14,9 @@
* 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.TransactionId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
View
4 ...api/transaction/SellTransactionExecutedEvent.java → ...ers/transaction/SellTransactionExecutedEvent.java
@@ -14,9 +14,9 @@
* 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.TransactionId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
View
4 ...action/SellTransactionPartiallyExecutedEvent.java → ...action/SellTransactionPartiallyExecutedEvent.java
@@ -14,9 +14,9 @@
* 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.TransactionId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
View
8 .../api/transaction/SellTransactionStartedEvent.java → ...ders/transaction/SellTransactionStartedEvent.java
@@ -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
View
8 ...s/api/transaction/StartBuyTransactionCommand.java → ...rders/transaction/StartBuyTransactionCommand.java
@@ -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
View
8 .../api/transaction/StartSellTransactionCommand.java → ...ders/transaction/StartSellTransactionCommand.java
@@ -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
View
2  ...rader/orders/api/transaction/TransactionType.java → ...rader/api/orders/transaction/TransactionType.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.transaction;
+package org.axonframework.samples.trader.api.orders.transaction;
/**
* @author Jettro Coenradie
View
6 .../orders/api/portfolio/CreatePortfolioCommand.java → .../trader/api/portfolio/CreatePortfolioCommand.java
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio;
+package org.axonframework.samples.trader.api.portfolio;
-import org.axonframework.samples.trader.tradeengine.api.order.PortfolioId;
-import org.axonframework.samples.trader.users.api.UserId;
+import org.axonframework.samples.trader.api.orders.trades.PortfolioId;
+import org.axonframework.samples.trader.api.users.UserId;
/**
* @author Jettro Coenradie
View
6 ...r/orders/api/portfolio/PortfolioCreatedEvent.java → ...s/trader/api/portfolio/PortfolioCreatedEvent.java
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio;
+package org.axonframework.samples.trader.api.portfolio;
-import org.axonframework.samples.trader.tradeengine.api.order.PortfolioId;
-import org.axonframework.samples.trader.users.api.UserId;
+import org.axonframework.samples.trader.api.orders.trades.PortfolioId;
+import org.axonframework.samples.trader.api.users.UserId;
/**
* @author Jettro Coenradie
View
14 ...y/CancelMoneyReservationFromPortfolioCommand.java → .../portfolio/cash/CancelCashReservationCommand.java
@@ -14,23 +14,23 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.money;
+package org.axonframework.samples.trader.api.portfolio.cash;
-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.PortfolioId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
*/
-public class CancelMoneyReservationFromPortfolioCommand {
+public class CancelCashReservationCommand {
private PortfolioId portfolioIdentifier;
private TransactionId transactionIdentifier;
private long amountOfMoneyToCancel;
- public CancelMoneyReservationFromPortfolioCommand(PortfolioId portfolioIdentifier,
- TransactionId transactionIdentifier,
- long amountOfMoneyToCancel) {
+ public CancelCashReservationCommand(PortfolioId portfolioIdentifier,
+ TransactionId transactionIdentifier,
+ long amountOfMoneyToCancel) {
this.portfolioIdentifier = portfolioIdentifier;
this.transactionIdentifier = transactionIdentifier;
this.amountOfMoneyToCancel = amountOfMoneyToCancel;
View
8 ...rtfolio/money/MoneyDepositedToPortfolioEvent.java → ...trader/api/portfolio/cash/CashDepositedEvent.java
@@ -14,18 +14,18 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.money;
+package org.axonframework.samples.trader.api.portfolio.cash;
-import org.axonframework.samples.trader.tradeengine.api.order.PortfolioId;
+import org.axonframework.samples.trader.api.orders.trades.PortfolioId;
/**
* @author Jettro Coenradie
*/
-public class MoneyDepositedToPortfolioEvent {
+public class CashDepositedEvent {
private PortfolioId portfolioId;
private long moneyAddedInCents;
- public MoneyDepositedToPortfolioEvent(PortfolioId portfolioId, long moneyAddedInCents) {
+ public CashDepositedEvent(PortfolioId portfolioId, long moneyAddedInCents) {
this.portfolioId = portfolioId;
this.moneyAddedInCents = moneyAddedInCents;
}
View
14 .../MoneyReservationCancelledFromPortfolioEvent.java → ...portfolio/cash/CashReservationCancelledEvent.java
@@ -14,22 +14,22 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.money;
+package org.axonframework.samples.trader.api.portfolio.cash;
-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.PortfolioId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
*/
-public class MoneyReservationCancelledFromPortfolioEvent {
+public class CashReservationCancelledEvent {
private PortfolioId portfolioIdentifier;
private TransactionId transactionIdentifier;
private long amountOfMoneyToCancel;
- public MoneyReservationCancelledFromPortfolioEvent(PortfolioId portfolioIdentifier,
- TransactionId transactionIdentifier,
- long amountOfMoneyToCancel) {
+ public CashReservationCancelledEvent(PortfolioId portfolioIdentifier,
+ TransactionId transactionIdentifier,
+ long amountOfMoneyToCancel) {
this.portfolioIdentifier = portfolioIdentifier;
this.transactionIdentifier = transactionIdentifier;
this.amountOfMoneyToCancel = amountOfMoneyToCancel;
View
14 .../MoneyReservationConfirmedFromPortfolioEvent.java → ...portfolio/cash/CashReservationConfirmedEvent.java
@@ -14,22 +14,22 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.money;
+package org.axonframework.samples.trader.api.portfolio.cash;
-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.PortfolioId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
*/
-public class MoneyReservationConfirmedFromPortfolioEvent {
+public class CashReservationConfirmedEvent {
private TransactionId transactionIdentifier;
private PortfolioId portfolioIdentifier;
private long amountOfMoneyConfirmedInCents;
- public MoneyReservationConfirmedFromPortfolioEvent(PortfolioId portfolioIdentifier,
- TransactionId transactionId,
- long amountOfMoneyConfirmedInCents) {
+ public CashReservationConfirmedEvent(PortfolioId portfolioIdentifier,
+ TransactionId transactionId,
+ long amountOfMoneyConfirmedInCents) {
this.portfolioIdentifier = portfolioIdentifier;
this.transactionIdentifier = transactionId;
this.amountOfMoneyConfirmedInCents = amountOfMoneyConfirmedInCents;
View
12 ...EnoughMoneyInPortfolioToMakeReservationEvent.java → .../portfolio/cash/CashReservationRejectedEvent.java
@@ -14,21 +14,21 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.money;
+package org.axonframework.samples.trader.api.portfolio.cash;
-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.PortfolioId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
*/
-public class NotEnoughMoneyInPortfolioToMakeReservationEvent {
+public class CashReservationRejectedEvent {
private PortfolioId portfolioIdentifier;
private TransactionId transactionIdentifier;
private long amountToPayInCents;
- public NotEnoughMoneyInPortfolioToMakeReservationEvent(PortfolioId portfolioIdentifier, TransactionId transactionIdentifier,
- long amountToPayInCents) {
+ public CashReservationRejectedEvent(PortfolioId portfolioIdentifier, TransactionId transactionIdentifier,
+ long amountToPayInCents) {
this.portfolioIdentifier = portfolioIdentifier;
this.transactionIdentifier = transactionIdentifier;
this.amountToPayInCents = amountToPayInCents;
View
10 ...tfolio/money/MoneyReservedFromPortfolioEvent.java → .../trader/api/portfolio/cash/CashReservedEvent.java
@@ -14,20 +14,20 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.money;
+package org.axonframework.samples.trader.api.portfolio.cash;
-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.PortfolioId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
*/
-public class MoneyReservedFromPortfolioEvent {
+public class CashReservedEvent {
private PortfolioId portfolioIdentifier;
private TransactionId transactionIdentifier;
private long amountToReserve;
- public MoneyReservedFromPortfolioEvent(PortfolioId portfolioIdentifier, TransactionId transactionIdentifier, long amountToReserve) {
+ public CashReservedEvent(PortfolioId portfolioIdentifier, TransactionId transactionIdentifier, long amountToReserve) {
this.portfolioIdentifier = portfolioIdentifier;
this.transactionIdentifier = transactionIdentifier;
this.amountToReserve = amountToReserve;
View
8 ...folio/money/MoneyWithdrawnFromPortfolioEvent.java → ...trader/api/portfolio/cash/CashWithdrawnEvent.java
@@ -14,18 +14,18 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.money;
+package org.axonframework.samples.trader.api.portfolio.cash;
-import org.axonframework.samples.trader.tradeengine.api.order.PortfolioId;
+import org.axonframework.samples.trader.api.orders.trades.PortfolioId;
/**
* @author Jettro Coenradie
*/
-public class MoneyWithdrawnFromPortfolioEvent {
+public class CashWithdrawnEvent {
private PortfolioId portfolioIdentifier;
private long amountPaidInCents;
- public MoneyWithdrawnFromPortfolioEvent(PortfolioId portfolioIdentifier, long amountPaidInCents) {
+ public CashWithdrawnEvent(PortfolioId portfolioIdentifier, long amountPaidInCents) {
this.portfolioIdentifier = portfolioIdentifier;
this.amountPaidInCents = amountPaidInCents;
}
View
16 ...ConfirmMoneyReservationFromPortfolionCommand.java → ...portfolio/cash/ConfirmCashReservationCommand.java
@@ -14,24 +14,24 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.money;
+package org.axonframework.samples.trader.api.portfolio.cash;
-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.PortfolioId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
*/
-public class ConfirmMoneyReservationFromPortfolionCommand {
+public class ConfirmCashReservationCommand {
private PortfolioId portfolioIdentifier;
private TransactionId transactionIdentifier;
private long amountOfMoneyToConfirmInCents;
- public ConfirmMoneyReservationFromPortfolionCommand(PortfolioId portfolioIdentifier,
- TransactionId transactionIdentifier,
- long amountOfMoneyToConfirmInCents) {
+ public ConfirmCashReservationCommand(PortfolioId portfolioIdentifier,
+ TransactionId transactionIdentifier,
+ long amountOfMoneyToConfirmInCents) {
this.portfolioIdentifier = portfolioIdentifier;
this.transactionIdentifier = transactionIdentifier;
this.amountOfMoneyToConfirmInCents = amountOfMoneyToConfirmInCents;
@@ -51,7 +51,7 @@ public TransactionId getTransactionIdentifier() {
@Override
public String toString() {
- return "ConfirmMoneyReservationFromPortfolionCommand{" +
+ return "ConfirmCashReservationCommand{" +
"amountOfMoneyToConfirmInCents=" + amountOfMoneyToConfirmInCents +
", portfolioIdentifier=" + portfolioIdentifier +
", transactionIdentifier=" + transactionIdentifier +
View
10 ...rtfolio/money/DepositMoneyToPortfolioCommand.java → ...trader/api/portfolio/cash/DepositCashCommand.java
@@ -14,21 +14,21 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.money;
+package org.axonframework.samples.trader.api.portfolio.cash;
-import org.axonframework.samples.trader.tradeengine.api.order.PortfolioId;
+import org.axonframework.samples.trader.api.orders.trades.PortfolioId;
/**
- * Adding money to your Portfolio through a deposit
+ * Adding cash to your Portfolio through a deposit
*
* @author Jettro Coenradie
*/
-public class DepositMoneyToPortfolioCommand {
+public class DepositCashCommand {
private PortfolioId portfolioIdentifier;
private long moneyToAddInCents;
- public DepositMoneyToPortfolioCommand(PortfolioId portfolioIdentifier, long moneyToAddInCents) {
+ public DepositCashCommand(PortfolioId portfolioIdentifier, long moneyToAddInCents) {
this.portfolioIdentifier = portfolioIdentifier;
this.moneyToAddInCents = moneyToAddInCents;
}
View
14 ...folio/money/ReserveMoneyFromPortfolioCommand.java → ...trader/api/portfolio/cash/ReserveCashCommand.java
@@ -14,23 +14,23 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.money;
+package org.axonframework.samples.trader.api.portfolio.cash;
-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.PortfolioId;
+import org.axonframework.samples.trader.api.orders.trades.TransactionId;
/**
* @author Jettro Coenradie
*/
-public class ReserveMoneyFromPortfolioCommand {
+public class ReserveCashCommand {
private PortfolioId portfolioIdentifier;
private TransactionId transactionIdentifier;
private long amountOfMoneyToReserve;
- public ReserveMoneyFromPortfolioCommand(PortfolioId portfolioIdentifier,
- TransactionId transactionIdentifier,
- long amountOfMoneyToReserve) {
+ public ReserveCashCommand(PortfolioId portfolioIdentifier,
+ TransactionId transactionIdentifier,
+ long amountOfMoneyToReserve) {
this.portfolioIdentifier = portfolioIdentifier;
this.transactionIdentifier = transactionIdentifier;
this.amountOfMoneyToReserve = amountOfMoneyToReserve;
View
8 ...olio/money/WithdrawMoneyFromPortfolioCommand.java → ...rader/api/portfolio/cash/WithdrawCashCommand.java
@@ -14,19 +14,19 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.money;
+package org.axonframework.samples.trader.api.portfolio.cash;
-import org.axonframework.samples.trader.tradeengine.api.order.PortfolioId;
+import org.axonframework.samples.trader.api.orders.trades.PortfolioId;
/**
* @author Jettro Coenradie
*/
-public class WithdrawMoneyFromPortfolioCommand {
+public class WithdrawCashCommand {
private PortfolioId portfolioIdentifier;
private long amountToPayInCents;
- public WithdrawMoneyFromPortfolioCommand(PortfolioId portfolioIdentifier, long amountToPayInCents) {
+ public WithdrawCashCommand(PortfolioId portfolioIdentifier, long amountToPayInCents) {
this.portfolioIdentifier = portfolioIdentifier;
this.amountToPayInCents = amountToPayInCents;
View
6 ...pi/portfolio/item/AddItemsToPortfolioCommand.java → ...i/portfolio/stock/AddItemsToPortfolioCommand.java
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.item;
+package org.axonframework.samples.trader.api.portfolio.stock;
-import org.axonframework.samples.trader.tradeengine.api.order.OrderBookId;
-import org.axonframework.samples.trader.tradeengine.api.order.PortfolioId;
+import org.axonframework.samples.trader.api.orders.trades.OrderBookId;
+import org.axonframework.samples.trader.api.orders.trades.PortfolioId;
/**
* Try to add new items for a specific OrderBook to the portfolio.
View
8 ...tem/CancelItemReservationForPortfolioCommand.java → ...ock/CancelItemReservationForPortfolioCommand.java
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.item;
+package org.axonframework.samples.trader.api.portfolio.stock;
-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;
/**
* Cancel a reservation for an amount of items for the OrderBook belonging to the provided identifier in the Portfolio
View
8 ...em/ConfirmItemReservationForPortfolioCommand.java → ...ck/ConfirmItemReservationForPortfolioCommand.java
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.item;
+package org.axonframework.samples.trader.api.portfolio.stock;
-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;
/**
* Confirm the reserved items belonging to OrderBook of the provided identifier for the Portfolio of the provided
View
8 ...em/ItemReservationCancelledForPortfolioEvent.java → ...ck/ItemReservationCancelledForPortfolioEvent.java
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.item;
+package org.axonframework.samples.trader.api.portfolio.stock;
-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
View
8 ...em/ItemReservationConfirmedForPortfolioEvent.java → ...ck/ItemReservationConfirmedForPortfolioEvent.java
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.item;
+package org.axonframework.samples.trader.api.portfolio.stock;
-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
View
8 ...em/ItemToReserveNotAvailableInPortfolioEvent.java → ...ck/ItemToReserveNotAvailableInPortfolioEvent.java
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.item;
+package org.axonframework.samples.trader.api.portfolio.stock;
-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
View
6 ...pi/portfolio/item/ItemsAddedToPortfolioEvent.java → ...i/portfolio/stock/ItemsAddedToPortfolioEvent.java
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.item;
+package org.axonframework.samples.trader.api.portfolio.stock;
-import org.axonframework.samples.trader.tradeengine.api.order.OrderBookId;
-import org.axonframework.samples.trader.tradeengine.api.order.PortfolioId;
+import org.axonframework.samples.trader.api.orders.trades.OrderBookId;
+import org.axonframework.samples.trader.api.orders.trades.PortfolioId;
/**
* New items have been added to the portfolio for the OrderBook of the provided identifier.
View
8 ...orders/api/portfolio/item/ItemsReservedEvent.java → ...rader/api/portfolio/stock/ItemsReservedEvent.java
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.item;
+package org.axonframework.samples.trader.api.portfolio.stock;
-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
View
8 .../NotEnoughItemsAvailableToReserveInPortfolio.java → .../NotEnoughItemsAvailableToReserveInPortfolio.java
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.item;
+package org.axonframework.samples.trader.api.portfolio.stock;
-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
View
8 ...rders/api/portfolio/item/ReserveItemsCommand.java → ...ader/api/portfolio/stock/ReserveItemsCommand.java
@@ -14,12 +14,12 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.orders.api.portfolio.item;
+package org.axonframework.samples.trader.api.portfolio.stock;
-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
View
2  ...les/trader/users/api/AuthenticateUserCommand.java → ...les/trader/api/users/AuthenticateUserCommand.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.users.api;
+package org.axonframework.samples.trader.api.users;
/**
* @author Jettro Coenradie
View
2  ...k/samples/trader/users/api/CreateUserCommand.java → ...k/samples/trader/api/users/CreateUserCommand.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.users.api;
+package org.axonframework.samples.trader.api.users;
import org.axonframework.common.Assert;
View
2  ...amework/samples/trader/users/api/UserAccount.java → ...amework/samples/trader/api/users/UserAccount.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.users.api;
+package org.axonframework.samples.trader.api.users;
/**
* Object used to obtain information about an available UserAccount
View
2  ...ples/trader/users/api/UserAuthenticatedEvent.java → ...ples/trader/api/users/UserAuthenticatedEvent.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.users.api;
+package org.axonframework.samples.trader.api.users;
/**
* Event to indicate that the user with the specified userId has been authenticated.
View
2  ...rk/samples/trader/users/api/UserCreatedEvent.java → ...rk/samples/trader/api/users/UserCreatedEvent.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.users.api;
+package org.axonframework.samples.trader.api.users;
/**
* Event to indicate a new user has been created.
View
2  ...xonframework/samples/trader/users/api/UserId.java → ...xonframework/samples/trader/api/users/UserId.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.axonframework.samples.trader.users.api;
+package org.axonframework.samples.trader.api.users;
import org.axonframework.common.Assert;
import org.axonframework.domain.IdentifierFactory;
View
2  external-listeners/pom.xml
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.axonframework.samples</groupId>
- <artifactId>axon-trader-trade-engine-api</artifactId>
+ <artifactId>axon-trader-core-api</artifactId>
<version>${project.version}</version>
</dependency>
View
2  external-listeners/src/main/java/org/axonframework/samples/trader/listener/OrderbookExternalListener.java
@@ -23,7 +23,7 @@
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.axonframework.eventhandling.annotation.EventHandler;
-import org.axonframework.samples.trader.tradeengine.api.order.TradeExecutedEvent;
+import org.axonframework.samples.trader.api.orders.trades.TradeExecutedEvent;
import org.codehaus.jackson.JsonFactory;
import org.codehaus.jackson.JsonGenerator;
import org.slf4j.Logger;
View
53 orders-api/pom.xml
@@ -1,53 +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-orders-api</artifactId>
-
- <dependencies>
- <!-- Internal dependencies -->
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>axon-trader-trade-engine-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>axon-trader-users-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
17 orders/pom.xml
@@ -30,17 +30,7 @@
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>axon-trader-orders-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>axon-trader-trade-engine-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>axon-trader-users-api</artifactId>
+ <artifactId>axon-trader-core-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
@@ -48,11 +38,6 @@
<artifactId>axon-trader-users-query</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>axon-trader-companies-api</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.axonframework</groupId>
View
40 orders/src/main/java/org/axonframework/samples/trader/orders/command/BuyTradeManagerSaga.java
@@ -21,12 +21,12 @@
import org.axonframework.saga.annotation.EndSaga;
import org.axonframework.saga.annotation.SagaEventHandler;
import org.axonframework.saga.annotation.StartSaga;
-import org.axonframework.samples.trader.orders.api.portfolio.item.AddItemsToPortfolioCommand;
-import org.axonframework.samples.trader.orders.api.portfolio.money.*;
-import org.axonframework.samples.trader.orders.api.transaction.*;
-import org.axonframework.samples.trader.tradeengine.api.order.CreateBuyOrderCommand;
-import org.axonframework.samples.trader.tradeengine.api.order.OrderId;
-import org.axonframework.samples.trader.tradeengine.api.order.TradeExecutedEvent;
+import org.axonframework.samples.trader.api.portfolio.stock.AddItemsToPortfolioCommand;
+import org.axonframework.samples.trader.api.portfolio.cash.*;
+import org.axonframework.samples.trader.api.orders.transaction.*;
+import org.axonframework.samples.trader.api.orders.trades.CreateBuyOrderCommand;
+import org.axonframework.samples.trader.api.orders.trades.OrderId;
+import org.axonframework.samples.trader.api.orders.trades.TradeExecutedEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -58,15 +58,15 @@ public void handle(BuyTransactionStartedEvent event) {
setPricePerItem(event.getPricePerItem());
setTotalItems(event.getTotalItems());
- ReserveMoneyFromPortfolioCommand command = new ReserveMoneyFromPortfolioCommand(getPortfolioIdentifier(),
+ ReserveCashCommand command = new ReserveCashCommand(getPortfolioIdentifier(),
getTransactionIdentifier(),
getTotalItems()
* getPricePerItem());
- getCommandBus().dispatch(new GenericCommandMessage<ReserveMoneyFromPortfolioCommand>(command));
+ getCommandBus().dispatch(new GenericCommandMessage<ReserveCashCommand>(command));
}
@SagaEventHandler(associationProperty = "transactionIdentifier")
- public void handle(MoneyReservedFromPortfolioEvent event) {
+ public void handle(CashReservedEvent event) {
logger.debug("Money for transaction with identifier {} is reserved", getTransactionIdentifier());
ConfirmTransactionCommand command = new ConfirmTransactionCommand(getTransactionIdentifier());
getCommandBus().dispatch(new GenericCommandMessage<ConfirmTransactionCommand>(command),
@@ -86,9 +86,9 @@ public void onFailure(Throwable cause) {
@SagaEventHandler(associationProperty = "transactionIdentifier")
@EndSaga
- public void handle(NotEnoughMoneyInPortfolioToMakeReservationEvent event) {
+ public void handle(CashReservationRejectedEvent event) {
logger.debug(
- "Not enough money was available to make reservation in transaction {} for portfolio {}. Required: {}",
+ "Not enough cash was available to make reservation in transaction {} for portfolio {}. Required: {}",
new Object[]{getTransactionIdentifier(),
event.getPortfolioIdentifier(),
event.getAmountToPayInCents()});
@@ -108,14 +108,14 @@ public void handle(BuyTransactionConfirmedEvent event) {
@SagaEventHandler(associationProperty = "transactionIdentifier")
public void handle(BuyTransactionCancelledEvent event) {
long amountToCancel = (event.getTotalAmountOfItems() - event.getAmountOfExecutedItems()) * getPricePerItem();
- logger.debug("Buy Transaction {} is cancelled, amount of money reserved to cancel is {}",
+ logger.debug("Buy Transaction {} is cancelled, amount of cash reserved to cancel is {}",
event.getTransactionIdentifier(),
amountToCancel);
- CancelMoneyReservationFromPortfolioCommand command = new CancelMoneyReservationFromPortfolioCommand(
+ CancelCashReservationCommand command = new CancelCashReservationCommand(
getPortfolioIdentifier(),
getTransactionIdentifier(),
amountToCancel);
- getCommandBus().dispatch(new GenericCommandMessage<CancelMoneyReservationFromPortfolioCommand>(command));
+ getCommandBus().dispatch(new GenericCommandMessage<CancelCashReservationCommand>(command));
}
@SagaEventHandler(associationProperty = "buyTransactionId", keyName = "transactionIdentifier")
@@ -133,11 +133,11 @@ public void handle(TradeExecutedEvent event) {
public void handle(BuyTransactionExecutedEvent event) {
logger.debug("Buy Transaction {} is executed, last amount of executed items is {} for a price of {}",
new Object[]{event.getTransactionIdentifier(), event.getAmountOfItems(), event.getItemPrice()});
- ConfirmMoneyReservationFromPortfolionCommand confirmCommand =
- new ConfirmMoneyReservationFromPortfolionCommand(getPortfolioIdentifier(),
+ ConfirmCashReservationCommand confirmCommand =
+ new ConfirmCashReservationCommand(getPortfolioIdentifier(),
getTransactionIdentifier(),
event.getAmountOfItems() * event.getItemPrice());
- getCommandBus().dispatch(new GenericCommandMessage<ConfirmMoneyReservationFromPortfolionCommand>(confirmCommand));
+ getCommandBus().dispatch(new GenericCommandMessage<ConfirmCashReservationCommand>(confirmCommand));
AddItemsToPortfolioCommand addItemsCommand =
new AddItemsToPortfolioCommand(getPortfolioIdentifier(),
getOrderbookIdentifier(),
@@ -151,12 +151,12 @@ public void handle(BuyTransactionPartiallyExecutedEvent event) {
new Object[]{event.getTransactionIdentifier(),
event.getAmountOfExecutedItems(),
event.getItemPrice()});
- ConfirmMoneyReservationFromPortfolionCommand confirmCommand =
- new ConfirmMoneyReservationFromPortfolionCommand(getPortfolioIdentifier(),
+ ConfirmCashReservationCommand confirmCommand =
+ new ConfirmCashReservationCommand(getPortfolioIdentifier(),
getTransactionIdentifier(),
event.getAmountOfExecutedItems() * event
.getItemPrice());
- getCommandBus().dispatch(new GenericCommandMessage<ConfirmMoneyReservationFromPortfolionCommand>(confirmCommand));
+ getCommandBus().dispatch(new GenericCommandMessage<ConfirmCashReservationCommand>(confirmCommand));
AddItemsToPortfolioCommand addItemsCommand =
new AddItemsToPortfolioCommand(getPortfolioIdentifier(),
getOrderbookIdentifier(),
View
38 orders/src/main/java/org/axonframework/samples/trader/orders/command/Portfolio.java
@@ -19,13 +19,13 @@
import org.axonframework.eventhandling.annotation.EventHandler;
import org.axonframework.eventsourcing.annotation.AbstractAnnotatedAggregateRoot;
import org.axonframework.eventsourcing.annotation.AggregateIdentifier;
-import org.axonframework.samples.trader.orders.api.portfolio.PortfolioCreatedEvent;
-import org.axonframework.samples.trader.orders.api.portfolio.item.*;
-import org.axonframework.samples.trader.orders.api.portfolio.money.*;
-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.users.api.UserId;
+import org.axonframework.samples.trader.api.portfolio.PortfolioCreatedEvent;
+import org.axonframework.samples.trader.api.portfolio.stock.*;
+import org.axonframework.samples.trader.api.portfolio.cash.*;
+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;
+import org.axonframework.samples.trader.api.users.UserId;
import java.util.HashMap;
import java.util.Map;
@@ -34,7 +34,7 @@
* Not a lot of checks are available. We will check if you still have item before you reserve them. Other than that
* we will not do checks. It is possible to give more items than you reserve.
* <p/>
- * When buying items you need to reserve money. Reservations need to be confirmed or cancelled. It is up to the user
+ * When buying items you need to reserve cash. Reservations need to be confirmed or cancelled. It is up to the user
* to confirm and cancel the right amounts. The Portfolio does not keep track of it.
*
* @author Jettro Coenradie
@@ -93,27 +93,27 @@ public void cancelReservation(OrderBookId orderBookIdentifier, TransactionId tra
}
public void addMoney(long moneyToAddInCents) {
- apply(new MoneyDepositedToPortfolioEvent(portfolioId, moneyToAddInCents));
+ apply(new CashDepositedEvent(portfolioId, moneyToAddInCents));
}
public void makePayment(long amountToPayInCents) {
- apply(new MoneyWithdrawnFromPortfolioEvent(portfolioId, amountToPayInCents));
+ apply(new CashWithdrawnEvent(portfolioId, amountToPayInCents));
}
public void reserveMoney(TransactionId transactionIdentifier, long amountToReserve) {
if (amountOfMoney >= amountToReserve) {
- apply(new MoneyReservedFromPortfolioEvent(portfolioId, transactionIdentifier, amountToReserve));
+ apply(new CashReservedEvent(portfolioId, transactionIdentifier, amountToReserve));
} else {
- apply(new NotEnoughMoneyInPortfolioToMakeReservationEvent(portfolioId, transactionIdentifier, amountToReserve));
+ apply(new CashReservationRejectedEvent(portfolioId, transactionIdentifier, amountToReserve));
}
}
public void cancelMoneyReservation(TransactionId transactionIdentifier, long amountOfMoneyToCancel) {
- apply(new MoneyReservationCancelledFromPortfolioEvent(portfolioId, transactionIdentifier, amountOfMoneyToCancel));
+ apply(new CashReservationCancelledEvent(portfolioId, transactionIdentifier, amountOfMoneyToCancel));
}
public void confirmMoneyReservation(TransactionId transactionIdentifier, long amountOfMoneyToConfirm) {
- apply(new MoneyReservationConfirmedFromPortfolioEvent(portfolioId, transactionIdentifier, amountOfMoneyToConfirm));
+ apply(new CashReservationConfirmedEvent(portfolioId, transactionIdentifier, amountOfMoneyToConfirm));
}
/* EVENT HANDLING */
@@ -156,29 +156,29 @@ public void onReservationCancelled(ItemReservationCancelledForPortfolioEvent eve
}
@EventHandler
- public void onMoneyAddedToPortfolio(MoneyDepositedToPortfolioEvent event) {
+ public void onMoneyAddedToPortfolio(CashDepositedEvent event) {
amountOfMoney += event.getMoneyAddedInCents();
}
@EventHandler
- public void onPaymentMadeFromPortfolio(MoneyWithdrawnFromPortfolioEvent event) {
+ public void onPaymentMadeFromPortfolio(CashWithdrawnEvent event) {
amountOfMoney -= event.getAmountPaidInCents();
}
@EventHandler
- public void onMoneyReservedFromPortfolio(MoneyReservedFromPortfolioEvent event) {
+ public void onMoneyReservedFromPortfolio(CashReservedEvent event) {
amountOfMoney -= event.getAmountToReserve();
reservedAmountOfMoney += event.getAmountToReserve();
}
@EventHandler
- public void onMoneyReservationCancelled(MoneyReservationCancelledFromPortfolioEvent event) {
+ public void onMoneyReservationCancelled(CashReservationCancelledEvent event) {
amountOfMoney += event.getAmountOfMoneyToCancel();
reservedAmountOfMoney -= event.getAmountOfMoneyToCancel();
}
@EventHandler
- public void onMoneyReservationConfirmed(MoneyReservationConfirmedFromPortfolioEvent event) {
+ public void onMoneyReservationConfirmed(CashReservationConfirmedEvent event) {
reservedAmountOfMoney -= event.getAmountOfMoneyConfirmedInCents();
}
View
22 orders/src/main/java/org/axonframework/samples/trader/orders/command/PortfolioCommandHandler.java
@@ -19,12 +19,12 @@
import org.axonframework.commandhandling.annotation.CommandHandler;
import org.axonframework.eventsourcing.EventSourcingRepository;
import org.axonframework.repository.Repository;
-import org.axonframework.samples.trader.orders.api.portfolio.CreatePortfolioCommand;
-import org.axonframework.samples.trader.orders.api.portfolio.item.AddItemsToPortfolioCommand;
-import org.axonframework.samples.trader.orders.api.portfolio.item.CancelItemReservationForPortfolioCommand;
-import org.axonframework.samples.trader.orders.api.portfolio.item.ConfirmItemReservationForPortfolioCommand;
-import org.axonframework.samples.trader.orders.api.portfolio.item.ReserveItemsCommand;
-import org.axonframework.samples.trader.orders.api.portfolio.money.*;
+import org.axonframework.samples.trader.api.portfolio.CreatePortfolioCommand;
+import org.axonframework.samples.trader.api.portfolio.stock.AddItemsToPortfolioCommand;
+import org.axonframework.samples.trader.api.portfolio.stock.CancelItemReservationForPortfolioCommand;
+import org.axonframework.samples.trader.api.portfolio.stock.ConfirmItemReservationForPortfolioCommand;
+import org.axonframework.samples.trader.api.portfolio.stock.ReserveItemsCommand;
+import org.axonframework.samples.trader.api.portfolio.cash.*;