Application Layer

GremlinService


To create a com.gremlin.GremlinService, you need a com.gremlin.GremlinCoordinatesProvider, which needs a com.gremlin.ApplicationCoordinates.

To construct a GremlinService using the alfi-aws library:

java
1final GremlinServiceFactory factory = new GremlinServiceFactory(new GremlinCoordinatesProvider() {
2 @Override
3 public ApplicationCoordinates initializeApplicationCoordinates() {
4 ApplicationCoordinates coords = AwsApplicationCoordinatesResolver.inferFromEnvironment()
5 .orElseThrow(IllegalStateException::new);
6 return coords;
7 }
8 });
9final GremlinService gremlinService = factory.getGremlinService();

Injecting Fault

Once you have a reference to the com.gremlin.GremlinService singleton and have defined your Custom com.gremlin.TrafficCoordinates, you can inject fault like this:

java
1gremlinService.applyImpact(trafficCoordinates);