Java 类org.apache.camel.processor.Enricher 实例源码

项目:syndesis    文件:SalesforceStreamingConnector.java   
@Override
public final String createEndpointUri(final String scheme, final Map<String, String> options) throws URISyntaxException {
    final String sObjectName = options.get(SalesforceEndpointConfig.SOBJECT_NAME);

    final String query = "SELECT Id FROM " + sObjectName;
    final String topicName = topicNameFor(options);
    options.put("topicName", topicName);
    options.put(SalesforceEndpointConfig.SOBJECT_QUERY, query);
    options.remove(SalesforceEndpointConfig.SOBJECT_NAME);

    final String salesforceComponent = getComponentScheme();

    if (!topicName.endsWith("_delete")) {
        final Enricher enricher = new Enricher(
            new ConstantExpression(salesforceComponent + ":getSObject?rawPayload=true&sObjectName=" + sObjectName));
        enricher.setCamelContext(getCamelContext());

        setBeforeConsumer(enricher);
    }

    return super.createEndpointUri(scheme, options);
}
项目:connectors    文件:AbstractSalesforceStreamingConnector.java   
@Override
public String createEndpointUri(final String scheme, final Map<String, String> options) throws URISyntaxException {
    final String sObjectName = options.get(SalesforceEndpointConfig.SOBJECT_NAME);

    final String query = "SELECT Id FROM " + sObjectName;
    options.put("topicName", topicNameFor(options));
    options.put(SalesforceEndpointConfig.SOBJECT_QUERY, query);
    options.remove(SalesforceEndpointConfig.SOBJECT_NAME);

    final String salesforceComponent = getComponentName() + "-component";

    final Enricher enricher = new Enricher(
        new ConstantExpression(salesforceComponent + ":getSObject?rawPayload=true&sObjectName=" + sObjectName));
    enricher.setCamelContext(getCamelContext());

    setBeforeConsumer(enricher);

    return super.createEndpointUri(scheme, options);
}
项目:Camel    文件:EnrichDefinition.java   
@Override
public Processor createProcessor(RouteContext routeContext) throws Exception {

    Expression exp = getExpression().createExpression(routeContext);
    boolean isShareUnitOfWork = getShareUnitOfWork() != null && getShareUnitOfWork();
    boolean isIgnoreInvalidEndpoint = getIgnoreInvalidEndpoint() != null && getIgnoreInvalidEndpoint();

    Enricher enricher = new Enricher(exp);
    enricher.setShareUnitOfWork(isShareUnitOfWork);
    enricher.setIgnoreInvalidEndpoint(isIgnoreInvalidEndpoint);
    AggregationStrategy strategy = createAggregationStrategy(routeContext);
    if (strategy != null) {
        enricher.setAggregationStrategy(strategy);
    }
    if (aggregateOnException != null) {
        enricher.setAggregateOnException(aggregateOnException);
    }
    return enricher;
}
项目:Camel    文件:ManagedEnricher.java   
public ManagedEnricher(CamelContext context, Enricher processor, EnrichDefinition definition) {
    super(context, processor, definition);
    this.processor = processor;
}
项目:Camel    文件:ManagedEnricher.java   
@Override
public Enricher getProcessor() {
    return processor;
}