/* * (non-Javadoc) * * @see play.Plugin#onStart() */ @Override public void onStart() { if (Auth.hasService()) { log.warn( "A auth service was already registered - replacing the old one, however this might hint to a configuration problem if this is a production environment."); } Auth.service(this); }
private static Optional<JsonNode> getValidJson(Http.RequestBody body) { JsonNode json = body.asJson(); logger.debug("received json: {}", json); try { // validates json Json.fromJson(json, Message.class); } catch (Exception e) { logger.warn("Invalid json ({})", e.getCause().getMessage()); return Optional.empty(); } return Optional.of(json); }