@Test public void testClearCacheCommand() throws UserIdentityUnauthorizedException { handler.handle(OperatorApiJsonTestUtils.CHARGING_STATION_ID_STRING, null, ChargingStationTestUtils.ROOT_IDENTITY_CONTEXT); }
@Override public void handle(String chargingStationId, JsonObject commandObject, IdentityContext identityContext) throws UserIdentityUnauthorizedException { ChargingStationId csId = new ChargingStationId(chargingStationId); if (!commandAuthorizationService.isAuthorized(csId, identityContext.getUserIdentity(), RequestClearCacheCommand.class)) { throw new UserIdentityUnauthorizedException(chargingStationId, identityContext.getUserIdentity(), RequestClearCacheCommand.class); } ChargingStation chargingStation = repository.findOne(chargingStationId); if (chargingStation != null && chargingStation.communicationAllowed()) { commandGateway.send(new RequestClearCacheCommand(csId, identityContext), new CorrelationToken()); } }
RequestClearCacheJsonCommandHandler extends JsonCommandHandler { @Override public void handle(String chargingStationId, JsonObject commandObject, IdentityContext identityContext) throws UserIdentityUnauthorizedException { ChargingStationId csId = new ChargingStationId(chargingStationId); if (!commandAuthorizationService.isAuthorized(csId, identityContext.getUserIdentity(), RequestClearCacheCommand.class)) { throw new UserIdentityUnauthorizedException(chargingStationId, identityContext.getUserIdentity(), RequestClearCacheCommand.class); } ChargingStation chargingStation = repository.findOne(chargingStationId); if (chargingStation != null && chargingStation.communicationAllowed()) { commandGateway.send(new RequestClearCacheCommand(csId, identityContext), new CorrelationToken()); } } }
RequestClearCacheJsonCommandHandler extends JsonCommandHandler { @Override public void handle(String chargingStationId, JsonObject commandObject, IdentityContext identityContext) throws UserIdentityUnauthorizedException { ChargingStationId csId = new ChargingStationId(chargingStationId); if (!commandAuthorizationService.isAuthorized(csId, identityContext.getUserIdentity(), RequestClearCacheCommand.class)) { throw new UserIdentityUnauthorizedException(chargingStationId, identityContext.getUserIdentity(), RequestClearCacheCommand.class); } ChargingStation chargingStation = repository.findOne(chargingStationId); if (chargingStation != null && chargingStation.communicationAllowed()) { commandGateway.send(new RequestClearCacheCommand(csId, identityContext), new CorrelationToken()); } }  }
RequestClearCacheJsonCommandHandler extends JsonCommandHandler { @Override public void handle(String chargingStationId, JsonObject commandObject, IdentityContext identityContext) throws UserIdentityUnauthorizedException { ChargingStationId csId = new ChargingStationId(chargingStationId); if (!commandAuthorizationService.isAuthorized(csId, identityContext.getUserIdentity(), RequestClearCacheCommand.class)) { throw new UserIdentityUnauthorizedException(chargingStationId, identityContext.getUserIdentity(), RequestClearCacheCommand.class); } ChargingStation chargingStation = repository.findOne(chargingStationId); if (chargingStation != null && chargingStation.communicationAllowed()) { commandGateway.send(new RequestClearCacheCommand(csId, identityContext), new CorrelationToken()); } }  @Override String getCommandName(); @Override void handle(String chargingStationId, JsonObject commandObject, IdentityContext identityContext); }
RequestClearCacheJsonCommandHandler extends JsonCommandHandler { @Override public void handle(String chargingStationId, JsonObject commandObject, IdentityContext identityContext) throws UserIdentityUnauthorizedException { ChargingStationId csId = new ChargingStationId(chargingStationId); if (!commandAuthorizationService.isAuthorized(csId, identityContext.getUserIdentity(), RequestClearCacheCommand.class)) { throw new UserIdentityUnauthorizedException(chargingStationId, identityContext.getUserIdentity(), RequestClearCacheCommand.class); } ChargingStation chargingStation = repository.findOne(chargingStationId); if (chargingStation != null && chargingStation.communicationAllowed()) { commandGateway.send(new RequestClearCacheCommand(csId, identityContext), new CorrelationToken()); } }  @Override String getCommandName(); @Override void handle(String chargingStationId, JsonObject commandObject, IdentityContext identityContext);  }