Skip to content

Commit e8abe7f

Browse files
committed
Merge branch 'master' into xray-gettingstarted
2 parents 43c2704 + a949ae3 commit e8abe7f

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ The `master` branch shows the use of Spring, Angular, nginx, the [AWS SDK for Ja
1010
Other branches extend the application's functionality and show the use of other AWS services. See the readme in each branch for details about the integration and instructions for use.
1111

1212
**Branches**
13-
- [`cognito`](https://github.com/awslabs/eb-java-scorekeep/tree/cognito) - Support login and store users in an [Amazon Cognito](http://aws.amazon.com/cognito) user pool. Get AWS SDK credentials and make service calls with a Cognito Identity Pool.
13+
- [`cognito`](https://github.com/awslabs/eb-java-scorekeep/tree/cognito) - Support login and store users in an [Amazon Cognito](http://aws.amazon.com/cognito) user pool. Get AWS SDK credentials and make service calls with a Cognito identity pool.
14+
- [`cognito-basic`](https://github.com/awslabs/eb-java-scorekeep/tree/cognito-basic) - Use Cognito for user ID storage. User pool only, no identity pool.
1415
- [`lambda`](https://github.com/awslabs/eb-java-scorekeep/tree/lambda) - Call an [AWS Lambda](http://aws.amazon.com/lambda) function to generate random names.
1516
- [`sql`](https://github.com/awslabs/eb-java-scorekeep/tree/sql) - Use JDBC to store game histories in an attached PostgreSQL database instance.
1617
- [`xray`](https://github.com/awslabs/eb-java-scorekeep/tree/xray) - Use the [AWS X-Ray SDK for Java](http://docs.aws.amazon.com/xray-sdk-for-java/latest/javadoc/) to instrument incoming requests, functions, SDK clients, SQL queries, HTTP clients, startup code, and AWS Lambda functions.
18+
- [`xray-cognito`](https://github.com/awslabs/eb-java-scorekeep/tree/xray-cognito) - Use AWS credentials obtained with Amazon Cognito to upload trace data to X-Ray from the browser.
1719
- [`xray-gettingstarted`](https://github.com/awslabs/eb-java-scorekeep/tree/xray-gettingstarted) ([tutorial](https://docs.aws.amazon.com/xray/latest/devguide/xray-gettingstarted.html)) - Use the AWS X-Ray SDK for Java to instrument incoming requests and SDK clients (no additional configuration required).
1820

1921
Use the procedures in the following sections to run the project on Elastic Beanstalk and configure it for local testing and development.

src/main/java/scorekeep/MoveFactory.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
import java.util.List;
55
import java.util.Set;
66
import java.lang.Class;
7+
import java.lang.Thread;
78
import java.lang.reflect.Method;
89
import java.lang.reflect.InvocationTargetException;
10+
911
import org.slf4j.Logger;
1012
import org.slf4j.LoggerFactory;
1113

@@ -16,7 +18,7 @@ public class MoveFactory {
1618
private final StateModel stateModel = new StateModel();
1719
private final GameController gameController = new GameController();
1820
private final StateController stateController = new StateController();
19-
private final RulesFactory rulesFactory = new RulesFactory();
21+
private final RulesFactory rulesFactory = new RulesFactory();
2022

2123
public MoveFactory(){
2224
}
@@ -58,7 +60,12 @@ public Move newMove(String sessionId, String gameId, String userId, String moveT
5860
State newState = new State(stateId, sessionId, gameId, newStateText, newTurn);
5961
// send notification on game end
6062
if ( newStateText.startsWith("A") || newStateText.startsWith("B")) {
61-
Sns.sendNotification("Scorekeep game completed", "Winner: " + userId);
63+
Thread comm = new Thread() {
64+
public void run() {
65+
Sns.sendNotification("Scorekeep game completed", "Winner: " + userId);
66+
}
67+
};
68+
comm.start();
6269
}
6370
// register state and move id to game
6471
gameController.setGameMove(sessionId, gameId, moveId);

src/main/java/scorekeep/UserFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public String randomName() throws IOException {
4747
Map<String, String> jsonMap = mapper.readValue(inputStream, Map.class);
4848
String name = jsonMap.get("name");
4949
EntityUtils.consume(entity);
50+
Sns.sendNotification("Scorekeep user created", "Name: " + name);
5051
return name;
5152
} finally {
5253
response.close();

0 commit comments

Comments
 (0)