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"); } }
@SuppressWarnings("unchecked") private List<String> yamlToList(Object yamlObject) throws InvalidParameterException { if (yamlObject == null) { return Collections.emptyList(); } else if (yamlObject instanceof List) { return (List<String>) yamlObject; } else if (yamlObject instanceof String) { return Lists.newArrayList((String) yamlObject); } else { throw new InvalidParameterException("Unable to cast object to List<String>"); } }
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 void init(Resource connection, Map<String, Object> config) throws BaleenException { try { country = (SharedCountryResource) connection; } catch (ClassCastException cce) { throw new InvalidParameterException( "Unable to cast connection parameter to SharedCountryResource", cce); } super.init(connection, config); }
@Override public void close() throws BaleenException { if (mongoFactory != null) { try { mongoFactory.close(); } catch (Exception e) { throw new BaleenException(e); } } } }
@Override public void init(Resource connection, Map<String, Object> config) throws BaleenException { try { country = (SharedCountryResource) connection; } catch (ClassCastException cce) { throw new InvalidParameterException( "Unable to cast connection parameter to SharedCountryResource", cce); } super.init(connection, config); }
@Override protected void createQueue() throws BaleenException { try { consumer = mqResource.createConsumer(topic, null); } catch (final JMSException e) { throw new BaleenException(e); } }
private void control(BaleenPipeline pipeline, String command) throws InvalidParameterException { switch (command.toLowerCase()) { case "pause": pipeline.pause(); break; case "unpause": pipeline.unpause(); break; default: throw new InvalidParameterException("Unexpected command '" + command + "'"); } }
@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); } }
@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 public void close() throws BaleenException { if (mongoFactory != null) { try { mongoFactory.close(); } catch (Exception 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 InMemoryDocumentHistory loadExistingDocumentHistory(String documentId) throws BaleenException { loadCalled = true; if (throwException) { throw new BaleenException(); } else if (returnNull) { return null; } else { return new InMemoryDocumentHistory(this, documentId); } } }