public Exchange createExchange(IApplication application) { Exchange exchange = super.createExchange(); exchange.getIn().setBody(application); return exchange; }
@Override protected void doStop() throws Exception { client = null; super.doStop(); }
@Override public JpaComponent getComponent() { return (JpaComponent) super.getComponent(); }
@Override protected void doStart() throws Exception { super.doStart(); client = getConfiguration().getClient() != null ? getConfiguration().getClient() : getClient(); }
@Override public void configureProperties(Map<String, Object> options) { super.configureProperties(options); Map<String, Object> emProperties = IntrospectionSupport.extractProperties(options, "emf."); if (emProperties != null) { setEntityManagerProperties(emProperties); } }
@Override public void doStart() throws Exception { super.doStart(); String envName = ""; if(System.getProperty("environmentName") != null) {
public Exchange createExchange(ExchangePattern pattern, Event event) { Exchange exchange = super.createExchange(pattern); Message message = exchange.getIn(); message.setBody(event); message.setHeader(GoogleCalendarStreamConstants.EVENT_ID, event.getId()); return exchange; } }
@Override protected void doStop() throws Exception { super.doStop(); sessionHolder.stop(); }
@Override protected void doStart() throws Exception { super.doStart(); // we can get the cluster using various ways if (cluster == null && beanRef != null) { Object bean = CamelContextHelper.mandatoryLookup(getCamelContext(), beanRef); if (bean instanceof Session) { session = (Session) bean; cluster = session.getCluster(); keyspace = session.getLoggedKeyspace(); } else if (bean instanceof Cluster) { cluster = (Cluster) bean; session = null; } else { throw new IllegalArgumentException("CQL Bean type should be of type Session or Cluster but was " + bean); } } if (cluster == null && hosts != null) { // use the cluster builder to create the cluster cluster = createClusterBuilder().build(); } if (cluster != null) { sessionHolder = new CassandraSessionHolder(cluster, keyspace); } else { sessionHolder = new CassandraSessionHolder(session); } sessionHolder.start(); }
public Exchange createExchange(Spreadsheet spreadsheet) { Exchange exchange = super.createExchange(getExchangePattern()); Message message = exchange.getIn(); exchange.getIn().setHeader(GoogleSheetsStreamConstants.SPREADSHEET_ID, spreadsheet.getSpreadsheetId()); exchange.getIn().setHeader(GoogleSheetsStreamConstants.SPREADSHEET_URL, spreadsheet.getSpreadsheetUrl()); message.setBody(spreadsheet); return exchange; } }
@Override public void doStop() throws Exception { if (s3Client != null) { s3Client.shutdown(); } super.doStop(); }
public Exchange createExchange(ValueRange valueRange) { Exchange exchange = super.createExchange(getExchangePattern()); Message message = exchange.getIn(); exchange.getIn().setHeader(GoogleSheetsStreamConstants.SPREADSHEET_ID, configuration.getSpreadsheetId()); exchange.getIn().setHeader(GoogleSheetsStreamConstants.RANGE, valueRange.getRange()); exchange.getIn().setHeader(GoogleSheetsStreamConstants.MAJOR_DIMENSION, valueRange.getMajorDimension()); message.setBody(valueRange); return exchange; }
public Exchange createExchange(ExchangePattern pattern, JSONObject object) { Exchange exchange = super.createExchange(pattern); SlackMessage slackMessage = new SlackMessage(); String text = (String)object.get("text"); String username = (String)object.get("username"); slackMessage.setText(text); slackMessage.setUsername(username); if (ObjectHelper.isNotEmpty((JSONObject)object.get("icons"))) { JSONObject icons = (JSONObject)object.get("icons"); if (ObjectHelper.isNotEmpty((String)icons.get("emoji"))) { slackMessage.setIconEmoji((String)icons.get("emoji")); } } Message message = exchange.getIn(); message.setBody(slackMessage); return exchange; } }
private Exchange createExchange(ExchangePattern pattern, io.iron.ironmq.Message msg) { Exchange exchange = super.createExchange(pattern); Message message = exchange.getIn(); if (configuration.isPreserveHeaders()) { GsonUtil.copyFrom(msg, message); } else { message.setBody(msg.getBody()); } message.setHeader(IronMQConstants.MESSAGE_ID, msg.getId()); message.setHeader(IronMQConstants.MESSAGE_RESERVATION_ID, msg.getReservationId()); message.setHeader(IronMQConstants.MESSAGE_RESERVED_COUNT, msg.getReservedCount()); return exchange; }
public Exchange createExchange(Update update) { Exchange exchange = super.createExchange(); if (update.getMessage() != null) { exchange.getIn().setBody(update.getMessage()); if (update.getMessage().getChat() != null) { exchange.getIn().setHeader(TelegramConstants.TELEGRAM_CHAT_ID, update.getMessage().getChat().getId()); } } else if (update.getChannelPost() != null) { exchange.getIn().setBody(update.getChannelPost()); if (update.getChannelPost().getChat() != null) { exchange.getIn().setHeader(TelegramConstants.TELEGRAM_CHAT_ID, update.getChannelPost().getChat().getId()); } } return exchange; }
Exchange exchange = super.createExchange(pattern); Message message = exchange.getIn();
public Exchange createExchange(Message message) { Exchange exchange = super.createExchange(); exchange.setProperty(Exchange.BINDING, getBinding()); exchange.setIn(new MailMessage(message, getConfiguration().isMapMailMessage())); return exchange; }