private void checkConfiguration(final Object[] keyValueConfiguration) throws BaleenException { if (keyValueConfiguration == null) { return; } if (keyValueConfiguration.length % 2 == 1) { throw new BaleenException( "Format is key,value,key,value must be an even number of entries in the array"); } }
private void checkConfiguration(final Object[] keyValueConfiguration) throws BaleenException { if (keyValueConfiguration == null) { return; } if (keyValueConfiguration.length % 2 == 1) { throw new BaleenException( "Format is key,value,key,value must be an even number of entries in the array"); } }
@Override public Optional<String> aggregate(List<?> values) throws BaleenException { if (CollectionUtils.isEmpty(values)) { return Optional.empty(); } try { return Optional.of(mapper.writeValueAsString(values)); } catch (JsonProcessingException e) { throw new BaleenException(e); } } }
@Override public void stop() throws BaleenException { try { if (server != null) { server.stop(); } constraints.clear(); constraintMappings.clear(); LOGGER.info("Server stopped"); } catch (Exception e) { throw new BaleenException("Unable to stop server", e); } }
@Override public Optional<String> aggregate(List<?> values) throws BaleenException { if (CollectionUtils.isEmpty(values)) { return Optional.empty(); } try { return Optional.of(mapper.writeValueAsString(values)); } catch (JsonProcessingException e) { throw new BaleenException(e); } } }
@Override public void close() throws BaleenException { if (mongoFactory != null) { try { mongoFactory.close(); } catch (Exception e) { throw new BaleenException(e); } } } }
@Override protected void createQueue() throws BaleenException { try { consumer = mqResource.createConsumer(topic, null); } catch (final JMSException e) { throw new BaleenException(e); } }
@Override protected void createQueue() throws BaleenException { try { supplier = mqResource.createSupplier(exchangeName, routingKey, topic); } catch (final IOException e) { throw new BaleenException(e); } }
@Override protected void createQueue() throws BaleenException { try { consumer = mqResource.createConsumer(exchangeName, routingKey, topic); } catch (final IOException e) { throw new BaleenException(e); } }
@Override protected void createQueue() throws BaleenException { try { consumer = mqResource.createConsumer(exchangeName, routingKey, topic); } catch (final IOException e) { throw new BaleenException(e); } }
/** Check whether there are files present (which don't start with key-) */ public File[] checkFilesExist() throws BaleenException { final File[] files = new File(mucPath).listFiles(f -> !f.getName().startsWith("key-") && f.isFile()); if (files == null || files.length == 0) { getMonitor().info("No MUC files found is the path correct: {}", mucPath); throw new BaleenException("No MUC files found to process"); } return files; }
/** Check whether there are files present (which don't start with key-) */ public File[] checkFilesExist() throws BaleenException { final File[] files = new File(mucPath).listFiles(f -> !f.getName().startsWith("key-") && f.isFile()); if (files == null || files.length == 0) { getMonitor().info("No MUC files found is the path correct: {}", mucPath); throw new BaleenException("No MUC files found to process"); } return files; }
/** Create a new pipeline from the provided YAML, with the given name */ public BaleenPipeline create(String name, PipelineConfiguration config) throws BaleenException { if (pipelines.containsKey(name)) { throw new BaleenException("A " + getType() + " of that name already exists"); } logger.info("Creating {}", name); BaleenPipeline pipeline = toPipeline(name, config); pipelines.put(name, pipeline); es.submit(pipeline); metrics.getCounter("created").inc(); return pipeline; }
@Override protected void createQueue() throws BaleenException { try { producer = mqResource.getProducer(); session = mqResource.getSession(); destination = session.createQueue(topic); } catch (final JMSException e) { throw new BaleenException(e); } }
/** * Create a new pipeline from the provided YAML file, with the given name. If multiplicity is * greater than 1 names will be suffixed with '-n' for each multiple. */ public List<BaleenPipeline> create(String name, File file, int multiplicity) throws BaleenException { try { return create(name, new YamlPiplineConfiguration(file), multiplicity); } catch (IOException e) { throw new BaleenException(e); } }
/** * Create a new pipeline from the provided YAML, with the given name. If multiplicity is greater * than 1 names will be suffixed with '-n' for each multiple. */ public List<BaleenPipeline> create(String name, InputStream yaml, int multiplicity) throws BaleenException { try { return create(name, new YamlPiplineConfiguration(yaml), multiplicity); } catch (IOException e) { throw new BaleenException(e); } }
/** * Create a new pipeline from the provided YAML, with the given name. If multiplicity is greater * than 1 names will be suffixed with '-n' for each multiple. */ public List<BaleenPipeline> create(String name, InputStream yaml, int multiplicity) throws BaleenException { try { return create(name, new YamlPipelineConfiguration(yaml), multiplicity); } catch (IOException e) { throw new BaleenException(e); } }
/** * Create a new pipeline from the provided YAML file, with the given name. If multiplicity is * greater than 1 names will be suffixed with '-n' for each multiple. */ public List<BaleenPipeline> create(String name, File file, int multiplicity) throws BaleenException { try { return create(name, new YamlPipelineConfiguration(file), multiplicity); } catch (IOException e) { throw new BaleenException(e); } }
@Override protected void initialize() throws BaleenException { super.initialize(); throw new BaleenException("Testing"); } }
@Override protected void writeToFile(JCas jCas, File file) throws BaleenException { try { FileUtils.writeStringToFile(file, jCas.getDocumentText(), Charset.defaultCharset()); } catch (IOException ioe) { throw new BaleenException(ioe); } }