Package org.cyclop.model.exception

Examples of org.cyclop.model.exception.ServiceException


      resPan.showResultsTableOnInit = true;
      resPan.initPage = pager.getCurrentPage();
      return resPan;
    } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException
        | IllegalArgumentException | InvocationTargetException e) {
      throw new ServiceException("Cannot create QueryResultPanel instance: " + e.getMessage(), e);
    }

  }
View Full Code Here


        @Value("${queryImport.maxFileSizeMb}") int maxFileSizeMb,
        @Value("${queryImport.parallel.maxThreadsProImport}") int maxThreadsProImport) {
      try {
        this.listSeparatorRegEx = Pattern.compile(listSeparatorRegEx);
      } catch (PatternSyntaxException e) {
        throw new ServiceException("Property: queryImport.listSeparatorRegEx syntax error: " + e.getMessage(),
            e);
      }
      this.encoding = encoding;
      this.maxFileSizeMb = maxFileSizeMb;
      this.maxThreadsProImport = maxThreadsProImport;
View Full Code Here

    try {
      Class<?> clazz = obj.getClass();
      Field field = findField(clazz, fieldName);
      if (field == null) {
        throw new ServiceException("Field: " + fieldName + " not found on in class heirarchy: " + clazz);
      }
      field.setAccessible(true);
      field.set(obj, val);
    } catch (SecurityException | IllegalArgumentException | IllegalAccessException e) {
      throw new ServiceException("Error setting final field: " + fieldName + " on: " + obj + " to: " + val
          + " - Error: " + e.getClass() + ", Msg:  " + e.getMessage(), e);

    }
  }
View Full Code Here

        } else if (partCompletion instanceof OffsetBasedCompletion) {
          OffsetBasedCompletion partDynamic = (OffsetBasedCompletion) partCompletion;
          completionStartMarker = partDynamic.canApply(cqlQuery, offset);

        } else {
          throw new ServiceException("Unsupported CqlPartCompletion: " + partCompletion.getClass());
        }

        LOG.debug("completionStartMarker: {}", completionStartMarker);

        if (completionStartMarker == -1) {
View Full Code Here

      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      try {
        ImageIO.write(img, "jpg", baos);
        baos.flush();
      } catch (IOException e) {
        throw new ServiceException("Error generating kaptcha image: " + e.getMessage(), e);
      }

      byte[] bytes = baos.toByteArray();
      return bytes;
    }
View Full Code Here

      String jsonText = jsonMarshaller.marshal(entity);
      ByteBuffer buf = encoder.get().encode(CharBuffer.wrap(jsonText));
      int written = channel.write(buf);
      channel.truncate(written);
    } catch (IOException | SecurityException | IllegalStateException e) {
      throw new ServiceException("Error storing query history in:" + histPath + " - " + e.getClass() + " - "
          + e.getMessage(), e);
    }
    LOG.trace("File has been sotred {}", entity);
  }
View Full Code Here

      T content = jsonMarshaller.unmarshal(clazz, decoded);

      LOG.debug("File read");
      return Optional.ofNullable(content);
    } catch (IOException | SecurityException | IllegalStateException e) {
      throw new ServiceException("Error reading filr from:" + filePath + " - " + e.getMessage(), e);
    }

  }
View Full Code Here

          Thread.interrupted();
        }
      }
    }
    if (lockChannel == null) {
      throw new ServiceException("File lock on '" + histPath + "' cannot be obtained: " + lastExMessage);
    }

    return lockChannel;
  }
View Full Code Here

    exportAsCsv(query, bos);
    try {
      String resStr = new String(bos.toByteArray(), conf.encoding);
      return resStr;
    } catch (UnsupportedEncodingException e) {
      throw new ServiceException("Encoding: " + conf.encoding + " caused error during export: " + e.getMessage(),
          e);
    }
  }
View Full Code Here

    T unmarshalObj;
    try {
      unmarshalObj = objectMapper.get().readValue(input, clazz);
    } catch (IOException e) {
      throw new ServiceException("Got IOException during json unmarshalling: " + e.getMessage() + " - input:'"
          + input + "'", e);
    }
    LOG.trace("Unmarshaled JSON from {} to {}", input, unmarshalObj);
    return unmarshalObj;
  }
View Full Code Here

TOP

Related Classes of org.cyclop.model.exception.ServiceException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.