@ POST @ Path ( "/probeResponse" ) @ Consumes ( "application/json" ) public String handleJSONProbeResponse ( String probeResponseJSON ) { JSONSerializer serializer = new JSONSerializer ( ) ; ResponseWrapper response ; try { response = serializer . unmarshal ( probeResponseJSON ) ; } catch ( ResponseParseException e ) { String errorResponseString = "Incoming Response could not be parsed. Error message is: " + e . getMessage ( ) ; Console . error ( errorResponseString ) ; Console . error ( "Wireline message that could no be parsed is:" ) ; Console . error ( probeResponseJSON ) ; return errorResponseString ; } for ( ServiceWrapper service : response . getServices ( ) ) { service . setResponseID ( response . getResponseID ( ) ) ; service . setProbeID ( response . getProbeID ( ) ) ; cache . cache ( new ExpiringService ( service ) ) ; } String statusString = "Successfully cached " + response . getServices ( ) . size ( ) + " services" ; updateCacheListener ( statusString ) ; return statusString ; }
Inbound JSON responses get processed here .