This repository has been archived by the owner on Dec 14, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the transaction stuff to the code base
- Loading branch information
Showing
22 changed files
with
1,100 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
...org/axonframework/samples/trader/app/api/transaction/AbstractStartTransactionCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (c) 2011. Gridshore | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.axonframework.samples.trader.app.api.transaction; | ||
|
||
import org.axonframework.domain.AggregateIdentifier; | ||
|
||
/** | ||
* @author Jettro Coenradie | ||
*/ | ||
public class AbstractStartTransactionCommand { | ||
private AggregateIdentifier orderbookIdentifier; | ||
private AggregateIdentifier portfolioIdentifier; | ||
private long tradeCount; | ||
private long itemPrice; | ||
|
||
public AbstractStartTransactionCommand(AggregateIdentifier orderbookIdentifier, AggregateIdentifier portfolioIdentifier, long tradeCount, long itemPrice) { | ||
this.itemPrice = itemPrice; | ||
this.orderbookIdentifier = orderbookIdentifier; | ||
this.portfolioIdentifier = portfolioIdentifier; | ||
this.tradeCount = tradeCount; | ||
} | ||
|
||
public long getItemPrice() { | ||
return itemPrice; | ||
} | ||
|
||
public AggregateIdentifier getOrderbookIdentifier() { | ||
return orderbookIdentifier; | ||
} | ||
|
||
public AggregateIdentifier getPortfolioIdentifier() { | ||
return portfolioIdentifier; | ||
} | ||
|
||
public long getTradeCount() { | ||
return tradeCount; | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
...org/axonframework/samples/trader/app/api/transaction/AbstractTransactionStartedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright (c) 2011. Gridshore | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.axonframework.samples.trader.app.api.transaction; | ||
|
||
import org.axonframework.domain.AggregateIdentifier; | ||
import org.axonframework.domain.DomainEvent; | ||
|
||
/** | ||
* @author Jettro Coenradie | ||
*/ | ||
public abstract class AbstractTransactionStartedEvent extends DomainEvent { | ||
private AggregateIdentifier orderbookIdentifier; | ||
private AggregateIdentifier portfolioIdentifier; | ||
private long totalItems; | ||
private long pricePerItem; | ||
|
||
public AbstractTransactionStartedEvent(AggregateIdentifier orderbookIdentifier, | ||
AggregateIdentifier portfolioIdentifier, | ||
long totalItems, | ||
long pricePerItem) { | ||
this.orderbookIdentifier = orderbookIdentifier; | ||
this.portfolioIdentifier = portfolioIdentifier; | ||
this.totalItems = totalItems; | ||
this.pricePerItem = pricePerItem; | ||
} | ||
|
||
public AggregateIdentifier getOrderbookIdentifier() { | ||
return orderbookIdentifier; | ||
} | ||
|
||
public AggregateIdentifier getPortfolioIdentifier() { | ||
return portfolioIdentifier; | ||
} | ||
|
||
public long getPricePerItem() { | ||
return pricePerItem; | ||
} | ||
|
||
public long getTotalItems() { | ||
return totalItems; | ||
} | ||
|
||
} |
44 changes: 44 additions & 0 deletions
44
...va/org/axonframework/samples/trader/app/api/transaction/BuyTransactionCancelledEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (c) 2011. Gridshore | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.axonframework.samples.trader.app.api.transaction; | ||
|
||
import org.axonframework.domain.AggregateIdentifier; | ||
import org.axonframework.domain.DomainEvent; | ||
|
||
/** | ||
* @author Jettro Coenradie | ||
*/ | ||
public class BuyTransactionCancelledEvent extends DomainEvent { | ||
private long totalAmountOfItems; | ||
private long amountOfExecutedItems; | ||
|
||
public BuyTransactionCancelledEvent(long totalAmountOfItems, long amountOfExecutedItems) { | ||
this.totalAmountOfItems = totalAmountOfItems; | ||
this.amountOfExecutedItems = amountOfExecutedItems; | ||
} | ||
|
||
public AggregateIdentifier getTransactionIdentifier() { | ||
return super.getAggregateIdentifier(); | ||
} | ||
|
||
public long getAmountOfExecutedItems() { | ||
return amountOfExecutedItems; | ||
} | ||
|
||
public long getTotalAmountOfItems() { | ||
return totalAmountOfItems; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...va/org/axonframework/samples/trader/app/api/transaction/BuyTransactionConfirmedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright (c) 2011. Gridshore | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.axonframework.samples.trader.app.api.transaction; | ||
|
||
import org.axonframework.domain.AggregateIdentifier; | ||
import org.axonframework.domain.DomainEvent; | ||
|
||
/** | ||
* @author Jettro Coenradie | ||
*/ | ||
public class BuyTransactionConfirmedEvent extends DomainEvent { | ||
public AggregateIdentifier getTransactionIdentifier() { | ||
return super.getAggregateIdentifier(); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...ava/org/axonframework/samples/trader/app/api/transaction/BuyTransactionExecutedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (c) 2011. Gridshore | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.axonframework.samples.trader.app.api.transaction; | ||
|
||
import org.axonframework.domain.AggregateIdentifier; | ||
import org.axonframework.domain.DomainEvent; | ||
|
||
/** | ||
* @author Jettro Coenradie | ||
*/ | ||
public class BuyTransactionExecutedEvent extends DomainEvent { | ||
private long amountOfItems; | ||
private long itemPrice; | ||
|
||
public BuyTransactionExecutedEvent(long amountOfItems, long itemPrice) { | ||
this.amountOfItems = amountOfItems; | ||
this.itemPrice = itemPrice; | ||
} | ||
|
||
public AggregateIdentifier getTransactionIdentifier() { | ||
return this.getAggregateIdentifier(); | ||
} | ||
|
||
public long getAmountOfItems() { | ||
return amountOfItems; | ||
} | ||
|
||
public long getItemPrice() { | ||
return itemPrice; | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
...xonframework/samples/trader/app/api/transaction/BuyTransactionPartiallyExecutedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright (c) 2011. Gridshore | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.axonframework.samples.trader.app.api.transaction; | ||
|
||
import org.axonframework.domain.AggregateIdentifier; | ||
import org.axonframework.domain.DomainEvent; | ||
|
||
/** | ||
* @author Jettro Coenradie | ||
*/ | ||
public class BuyTransactionPartiallyExecutedEvent extends DomainEvent { | ||
private long amountOfExecutedItems; | ||
private long totalOfExecutedItems; | ||
private long itemPrice; | ||
|
||
public BuyTransactionPartiallyExecutedEvent(long amountOfExecutedItems, long totalOfExecutedItems, long itemPrice) { | ||
|
||
this.amountOfExecutedItems = amountOfExecutedItems; | ||
this.totalOfExecutedItems = totalOfExecutedItems; | ||
this.itemPrice = itemPrice; | ||
} | ||
|
||
public AggregateIdentifier getTransactionIdentifier() { | ||
return this.getAggregateIdentifier(); | ||
} | ||
|
||
public long getAmountOfExecutedItems() { | ||
return amountOfExecutedItems; | ||
} | ||
|
||
public void setAmountOfExecutedItems(long amountOfExecutedItems) { | ||
this.amountOfExecutedItems = amountOfExecutedItems; | ||
} | ||
|
||
public long getItemPrice() { | ||
return itemPrice; | ||
} | ||
|
||
public void setItemPrice(long itemPrice) { | ||
this.itemPrice = itemPrice; | ||
} | ||
|
||
public long getTotalOfExecutedItems() { | ||
return totalOfExecutedItems; | ||
} | ||
|
||
public void setTotalOfExecutedItems(long totalOfExecutedItems) { | ||
this.totalOfExecutedItems = totalOfExecutedItems; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...java/org/axonframework/samples/trader/app/api/transaction/BuyTransactionStartedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (c) 2011. Gridshore | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.axonframework.samples.trader.app.api.transaction; | ||
|
||
import org.axonframework.domain.AggregateIdentifier; | ||
|
||
/** | ||
* @author Jettro Coenradie | ||
*/ | ||
public class BuyTransactionStartedEvent extends AbstractTransactionStartedEvent { | ||
|
||
public BuyTransactionStartedEvent(AggregateIdentifier orderbookIdentifier, | ||
AggregateIdentifier portfolioIdentifier, | ||
long totalItems, | ||
long pricePerItem) { | ||
super(orderbookIdentifier, portfolioIdentifier, totalItems, pricePerItem); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...n/java/org/axonframework/samples/trader/app/api/transaction/CancelTransactionCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2011. Gridshore | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.axonframework.samples.trader.app.api.transaction; | ||
|
||
import org.axonframework.domain.AggregateIdentifier; | ||
|
||
/** | ||
* @author Jettro Coenradie | ||
*/ | ||
public class CancelTransactionCommand { | ||
private AggregateIdentifier transactionIdentifier; | ||
|
||
public CancelTransactionCommand(AggregateIdentifier transactionIdentifier) { | ||
this.transactionIdentifier = transactionIdentifier; | ||
} | ||
|
||
public AggregateIdentifier getTransactionIdentifier() { | ||
return transactionIdentifier; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
.../java/org/axonframework/samples/trader/app/api/transaction/ConfirmTransactionCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2011. Gridshore | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.axonframework.samples.trader.app.api.transaction; | ||
|
||
import org.axonframework.domain.AggregateIdentifier; | ||
|
||
/** | ||
* @author Jettro Coenradie | ||
*/ | ||
public class ConfirmTransactionCommand { | ||
private AggregateIdentifier transactionIdentifier; | ||
|
||
public ConfirmTransactionCommand(AggregateIdentifier transactionIdentifier) { | ||
this.transactionIdentifier = transactionIdentifier; | ||
} | ||
|
||
public AggregateIdentifier getTransactionIdentifier() { | ||
return transactionIdentifier; | ||
} | ||
} |
Oops, something went wrong.