Skip to content

Commit

Permalink
Merge branch 'master' into dev/TP-1102-update-cakeshop-to-utilise-poj…
Browse files Browse the repository at this point in the history
…o-compatible-requester-and-sender-methods
  • Loading branch information
BenNzewi committed Mar 4, 2019
2 parents 0eb38fa + ef54f22 commit 847751f
Show file tree
Hide file tree
Showing 40 changed files with 116 additions and 79 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ sftp-config.json

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
Expand All @@ -84,3 +83,7 @@ conf/login.config
conf/openejb.xml
conf/users.properties
conf/conf.d/

# Annotation validator plugin reports #
#######################################
**/annotation-plugin-validation-result*
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import java.util.UUID;

@Event("example.cake-made")
@Event("example.events.cake-made")
public class CakeMade {

private final UUID cakeId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.time.ZonedDateTime;
import java.util.UUID;

@Event("example.cake-ordered")
@Event("example.events.cake-ordered")
public class CakeOrdered {

private final UUID orderId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.util.List;
import java.util.UUID;

@Event("example.recipe-added")
@Event("example.events.recipe-added")
public class RecipeAdded {

private final UUID recipeId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import java.util.UUID;

@Event("example.recipe-photograph-added")
@Event("example.events.recipe-photograph-added")
public class RecipePhotographAdded {

private final UUID recipeId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import java.util.UUID;

@Event("example.recipe-removed")
@Event("example.events.recipe-removed")
public class RecipeRemoved {

private final UUID recipeId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import java.util.UUID;

@Event("example.recipe-renamed")
@Event("example.events.recipe-renamed")
public class RecipeRenamed {

private final UUID recipeId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://justice.gov.uk/example/event/example.cake-made.json",
"id": "http://justice.gov.uk/example/event/example.events.cake-made.json",
"type": "object",
"properties": {
"cakeId": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://justice.gov.uk/example/event/example.recipe-added.json",
"id": "http://justice.gov.uk/example/event/example.events.recipe-added.json",
"type": "object",
"properties": {
"recipeId": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://justice.gov.uk/example/event/example.recipe-photograph-added.json",
"id": "http://justice.gov.uk/example/event/example.events.recipe-photograph-added.json",
"type": "object",
"properties": {
"recipeId": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://justice.gov.uk/example/event/example.recipe-removed.json",
"id": "http://justice.gov.uk/example/event/example.events.recipe-removed.json",
"type": "object",
"properties": {
"recipeId": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://justice.gov.uk/example/event/example.recipe-renamed.json",
"id": "http://justice.gov.uk/example/event/example.events.recipe-renamed.json",
"type": "object",
"properties": {
"recipeId": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ version: v1
/example.event:
post:
body:
application/vnd.example.recipe-added+json:
schema: !include json/schema/example.recipe-added.json
application/vnd.example.events.recipe-added+json:
schema: !include json/schema/example.events.recipe-added.json
example: !include json/command.add-recipe.json

application/vnd.example.recipe-removed+json:
schema: !include json/schema/example.recipe-removed.json
application/vnd.example.events.recipe-removed+json:
schema: !include json/schema/example.events.recipe-removed.json
example: !include json/recipe-removed.json

application/vnd.example.cake-made+json:
schema: !include json/schema/example.cake-made.json
application/vnd.example.events.cake-made+json:
schema: !include json/schema/example.events.cake-made.json
example: !include json/command.make-cake.json

application/vnd.example.cake-ordered+json:
application/vnd.example.events.cake-ordered+json:

application/vnd.example.recipe-renamed+json:
schema: !include json/schema/example.recipe-renamed.json
application/vnd.example.events.recipe-renamed+json:
schema: !include json/schema/example.events.recipe-renamed.json
example: !include json/recipe-renamed.json

application/vnd.example.recipe-photograph-added+json:
schema: !include json/schema/example.recipe-photograph-added.json
application/vnd.example.events.recipe-photograph-added+json:
schema: !include json/schema/example.events.recipe-photograph-added.json
example: !include json/recipe-photograph-added.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
public class MakeCakeCommandHandlerTest {

private static final String COMMAND_NAME = "example.command.make-cake";
private static final String EVENT_NAME = "example.cake-made";
private static final String EVENT_NAME = "example.events.cake-made";
private static final UUID CAKE_ID = randomUUID();
private static final UUID RECIPE_ID = randomUUID();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
public class OrderCakeCommandHandlerTest {

private static final String COMMAND_NAME = "example.command.order-cake";
private static final String EVENT_NAME = "example.cake-ordered";
private static final String EVENT_NAME = "example.events.cake-ordered";
private static final UUID RECIPE_ID = randomUUID();
private static final UUID ORDER_ID = randomUUID();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@
public class RecipeCommandHandlerTest {

private static final String ADD_RECIPE_COMMAND_NAME = "example.command.add-recipe";
private static final String ADD_RECIPE_EVENT_NAME = "example.recipe-added";
private static final String ADD_RECIPE_EVENT_NAME = "example.events.recipe-added";
private static final String RENAME_RECIPE_COMMAND_NAME = "example.command.rename-recipe";
private static final String RENAME_RECIPE_EVENT_NAME = "example.recipe-renamed";
private static final String RENAME_RECIPE_EVENT_NAME = "example.events.recipe-renamed";
private static final String REMOVE_RECIPE_COMMAND_NAME = "example.command.remove-recipe";
private static final String REMOVE_RECIPE_EVENT_NAME = "example.recipe-removed";
private static final String RECIPE_PHOTOGRAPH_ADDED_EVENT_NAME = "example.recipe-photograph-added";
private static final String REMOVE_RECIPE_EVENT_NAME = "example.events.recipe-removed";
private static final String RECIPE_PHOTOGRAPH_ADDED_EVENT_NAME = "example.events.recipe-photograph-added";

private static final UUID RECIPE_ID = randomUUID();
private static final UUID PHOTO_ID = randomUUID();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class CakeMadeEventListener {
@Inject
CakeRepository cakeRepository;

@Handles("example.cake-made")
@Handles("example.events.cake-made")
public void handle(final Envelope<Cake> envelope) {
//Best practice is to handle a value object rather than an entity
//because the event typically would not cover an entire entity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class CakeOrderedEventListener {
@Inject
CakeOrderRepository repository;

@Handles("example.cake-ordered")
@Handles("example.events.cake-ordered")
public void handle(final Envelope<CakeOrder> envelope) {
//Best practice is to handle a value object rather than an entity
//because the event typically would not cover an entire entity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class RecipeEventListener {
@Inject
IngredientRepository ingredientRepository;

@Handles("example.recipe-added")
@Handles("example.events.recipe-added")
public void recipeAdded(final JsonEnvelope event) {

final String recipeId = event.payloadAsJsonObject().getString(FIELD_RECIPE_ID);
Expand All @@ -66,7 +66,7 @@ public void recipeAdded(final JsonEnvelope event) {
}
}

@Handles("example.recipe-renamed")
@Handles("example.events.recipe-renamed")
public void recipeRenamed(final JsonEnvelope event) {

final String recipeId = event.payloadAsJsonObject().getString(FIELD_RECIPE_ID);
Expand All @@ -78,7 +78,7 @@ public void recipeRenamed(final JsonEnvelope event) {
recipeRepository.save(recipe);
}

@Handles("example.recipe-removed")
@Handles("example.events.recipe-removed")
public void recipeRemoved(final JsonEnvelope event) {
final String recipeId = event.payloadAsJsonObject().getString(FIELD_RECIPE_ID);
LOGGER.trace("=============> Inside remove-recipe Event Listener about to find recipeId: " + recipeId);
Expand All @@ -87,7 +87,7 @@ public void recipeRemoved(final JsonEnvelope event) {
recipeRepository.remove(recipeFound);
}

@Handles("example.recipe-photograph-added")
@Handles("example.events.recipe-photograph-added")
public void recipePhotographAdded(final JsonEnvelope event) {

final String recipeId = event.payloadAsJsonObject().getString(FIELD_RECIPE_ID);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://justice.gov.uk/example/event/example.cake-made.json",
"id": "http://justice.gov.uk/example/event/example.events.cake-made.json",
"type": "object",
"properties": {
"cakeId": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://justice.gov.uk/example/event/listener/example.cake-ordered.json",
"id": "http://justice.gov.uk/example/event/listener/example.events.cake-ordered.json",
"type": "object",
"properties": {
"orderId": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://justice.gov.uk/example/event/example.recipe-added.json",
"id": "http://justice.gov.uk/example/event/example.events.recipe-added.json",
"type": "object",
"properties": {
"recipeId": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://justice.gov.uk/example/event/example.recipe-photograph-added.json",
"id": "http://justice.gov.uk/example/event/example.events.recipe-photograph-added.json",
"type": "object",
"properties": {
"recipeId": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://justice.gov.uk/example/event/example.recipe-removed.json",
"id": "http://justice.gov.uk/example/event/example.events.recipe-removed.json",
"type": "object",
"properties": {
"recipeId": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://justice.gov.uk/example/event/example.recipe-renamed.json",
"id": "http://justice.gov.uk/example/event/example.events.recipe-renamed.json",
"type": "object",
"properties": {
"recipeId": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ subscriptions_descriptor:
subscriptions:
- name: event listener subscription
events:
- name: example.recipe-added
schema_uri: http://justice.gov.uk/example/event/example.recipe-added.json
- name: example.events.recipe-added
schema_uri: http://justice.gov.uk/example/event/example.events.recipe-added.json

- name: example.recipe-removed
schema_uri: http://justice.gov.uk/example/event/example.recipe-removed.json
- name: example.events.recipe-removed
schema_uri: http://justice.gov.uk/example/event/example.events.recipe-removed.json

- name: example.cake-made
schema_uri: http://justice.gov.uk/example/event/example.cake-made.json
- name: example.events.cake-made
schema_uri: http://justice.gov.uk/example/event/example.events.cake-made.json

- name: example.cake-ordered
schema_uri: http://justice.gov.uk/example/event/listener/example.cake-ordered.json
- name: example.events.cake-ordered
schema_uri: http://justice.gov.uk/example/event/listener/example.events.cake-ordered.json

- name: example.recipe-renamed
schema_uri: http://justice.gov.uk/example/event/example.recipe-renamed.json
- name: example.events.recipe-renamed
schema_uri: http://justice.gov.uk/example/event/example.events.recipe-renamed.json

- name: example.recipe-photograph-added
schema_uri: http://justice.gov.uk/example/event/example.recipe-photograph-added.json
- name: example.events.recipe-photograph-added
schema_uri: http://justice.gov.uk/example/event/example.events.recipe-photograph-added.json
event_source_name: event.source


Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class CakeMadeEventProcessor {
@Inject
Sender sender;

@Handles("example.cake-made")
@Handles("example.events.cake-made")
public void handle(final JsonEnvelope event) {
sender.send(event);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class RecipeAddedEventProcessor {
@Inject
Sender sender;

@Handles("example.recipe-added")
@Handles("example.events.recipe-added")
public void recipeAdded(final JsonEnvelope event) {
sender.send(event);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://justice.gov.uk/example/event/example.cake-made.json",
"id": "http://justice.gov.uk/example/event/example.events.cake-made.json",
"type": "object",
"properties": {
"cakeId": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://justice.gov.uk/example/event/example.recipe-added.json",
"id": "http://justice.gov.uk/example/event/example.events.recipe-added.json",
"type": "object",
"properties": {
"recipeId": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ version: v1
/public.event:
post:
body:
application/vnd.example.recipe-added+json:
schema: !include json/schema/example.recipe-added.json
application/vnd.example.events.recipe-added+json:
schema: !include json/schema/example.events.recipe-added.json
example: !include json/recipe-added.json

application/vnd.example.cake-made+json:
schema: !include json/schema/example.cake-made.json
application/vnd.example.events.cake-made+json:
schema: !include json/schema/example.events.cake-made.json
example: !include json/cake-made.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://justice.gov.uk/example/event/example.cake-made.json",
"id": "http://justice.gov.uk/example/event/example.events.cake-made.json",
"type": "object",
"properties": {
"cakeId": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://justice.gov.uk/example/event/example.recipe-added.json",
"id": "http://justice.gov.uk/example/event/example.events.recipe-added.json",
"type": "object",
"properties": {
"recipeId": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ subscriptions_descriptor:
subscriptions:
- name: event processor subscription
events:
- name: example.recipe-added
schema_uri: http://justice.gov.uk/example/event/example.recipe-added.json
- name: example.events.recipe-added
schema_uri: http://justice.gov.uk/example/event/example.events.recipe-added.json

- name: example.cake-made
schema_uri: http://justice.gov.uk/example/event/example.cake-made.json
- name: example.events.cake-made
schema_uri: http://justice.gov.uk/example/event/example.events.cake-made.json
event_source_name: private.event.source
Loading

0 comments on commit 847751f

Please sign in to comment.