public void sendCommonErrorResponse(final String message, final boolean once) {
   Map<String, Object> output = createCommonResponse(message);
   if (once) {
     output.put(OUTPUT_ONCE, once);
   }
   this.service.addResults(session.getClient(), ResultProcessor.CHANNEL_ERROR, output);
 }
 public void notifyCompleted(final boolean success) {
   log.info("Completed - layer:", layerId, "type:", type, "success:", success);
   Map<String, Object> output = createCommonResponse("completed");
   output.put("success", success);
   output.put("type", type.toString());
   this.service.addResults(session.getClient(), ResultProcessor.CHANNEL_STATUS, output);
 }
 /**
  * Checks if the map scale is valid
  *
  * @return <code>true</code> if map scale is valid; <code>false</code> otherwise.
  */
 protected boolean validateMapScales() {
   return JobHelper.isRequestScalesInRange(
       this.session.getMapScales(),
       (int) this.session.getLocation().getZoom(),
       layer,
       session.getLocation().getSrs());
 }
 /** Send image parsing error */
 protected void imageParsingFailed(final String message) {
   log.debug("Image parsing failed");
   Map<String, Object> output = new HashMap<String, Object>();
   output.put(OUTPUT_LAYER_ID, this.layerId);
   output.put(OUTPUT_ONCE, true);
   output.put(OUTPUT_MESSAGE, message);
   this.service.addResults(session.getClient(), ResultProcessor.CHANNEL_ERROR, output);
 }
 public void notifyError(String error) {
   if (error == null) {
     error = "Something went wrong";
   }
   log.error("On Error - layer:", layerId, "type:", type, "msg:", error);
   Map<String, Object> output = createCommonResponse(error);
   output.put("type", type.toString());
   this.service.addResults(session.getClient(), ResultProcessor.CHANNEL_ERROR, output);
 }
 /**
  * Checks if enough information for running the task type
  *
  * @return <code>true</code> if enough information for type; <code>false</code> otherwise.
  */
 public boolean hasValidParams() {
   if (this.type == JobType.HIGHLIGHT) {
     if (this.sessionLayer.getHighlightedFeatureIds() != null
         && this.sessionLayer.getHighlightedFeatureIds().size() > 0) {
       return true;
     }
   } else if (this.type == JobType.MAP_CLICK) {
     if (session.getMapClick() != null) {
       return true;
     }
   } else if (this.type == JobType.GEOJSON) {
     if (session.getFilter() != null) {
       return true;
     }
   } else if (this.type == JobType.PROPERTY_FILTER) {
     if (session.getPropertyFilter() != null) {
       return true;
     }
   } else if (this.type == JobType.NORMAL) {
     return true;
   }
   return false;
 }
 public void notifyStart() {
   log.info("On start - layer:", layerId, "type:", type);
   this.service.addResults(
       session.getClient(), ResultProcessor.CHANNEL_STATUS, createCommonResponse("started"));
 }