Search in sources :

Example 1 with DataByteArrayInputStream

use of org.fusesource.hawtbuf.DataByteArrayInputStream in project camel by apache.

the class HawtDBCamelCodec method unmarshallKey.

public String unmarshallKey(Buffer buffer) throws IOException {
    DataByteArrayInputStream bais = new DataByteArrayInputStream(buffer);
    String key = keyCodec.decode(bais);
    return key;
}
Also used : DataByteArrayInputStream(org.fusesource.hawtbuf.DataByteArrayInputStream)

Example 2 with DataByteArrayInputStream

use of org.fusesource.hawtbuf.DataByteArrayInputStream in project camel by apache.

the class HawtDBCamelCodec method unmarshallExchange.

public Exchange unmarshallExchange(CamelContext camelContext, Buffer buffer) throws IOException {
    DataByteArrayInputStream bais = new DataByteArrayInputStream(buffer);
    DefaultExchangeHolder pe = exchangeCodec.decode(bais);
    Exchange answer = new DefaultExchange(camelContext);
    DefaultExchangeHolder.unmarshal(answer, pe);
    // restore the from endpoint
    String fromEndpointUri = (String) answer.removeProperty("CamelAggregatedFromEndpoint");
    if (fromEndpointUri != null) {
        Endpoint fromEndpoint = camelContext.hasEndpoint(fromEndpointUri);
        if (fromEndpoint != null) {
            answer.setFromEndpoint(fromEndpoint);
        }
    }
    return answer;
}
Also used : DefaultExchangeHolder(org.apache.camel.impl.DefaultExchangeHolder) DefaultExchange(org.apache.camel.impl.DefaultExchange) Exchange(org.apache.camel.Exchange) DefaultExchange(org.apache.camel.impl.DefaultExchange) Endpoint(org.apache.camel.Endpoint) DataByteArrayInputStream(org.fusesource.hawtbuf.DataByteArrayInputStream)

Example 3 with DataByteArrayInputStream

use of org.fusesource.hawtbuf.DataByteArrayInputStream in project camel by apache.

the class LevelDBCamelCodec method unmarshallKey.

public String unmarshallKey(Buffer buffer) throws IOException {
    DataByteArrayInputStream bais = new DataByteArrayInputStream(buffer);
    String key = keyCodec.decode(bais);
    return key;
}
Also used : DataByteArrayInputStream(org.fusesource.hawtbuf.DataByteArrayInputStream)

Example 4 with DataByteArrayInputStream

use of org.fusesource.hawtbuf.DataByteArrayInputStream in project camel by apache.

the class LevelDBCamelCodec method unmarshallExchange.

public Exchange unmarshallExchange(CamelContext camelContext, Buffer buffer) throws IOException {
    DataByteArrayInputStream bais = new DataByteArrayInputStream(buffer);
    DefaultExchangeHolder pe = exchangeCodec.decode(bais);
    Exchange answer = new DefaultExchange(camelContext);
    DefaultExchangeHolder.unmarshal(answer, pe);
    // restore the from endpoint
    String fromEndpointUri = (String) answer.removeProperty("CamelAggregatedFromEndpoint");
    if (fromEndpointUri != null) {
        Endpoint fromEndpoint = camelContext.hasEndpoint(fromEndpointUri);
        if (fromEndpoint != null) {
            answer.setFromEndpoint(fromEndpoint);
        }
    }
    return answer;
}
Also used : DefaultExchangeHolder(org.apache.camel.impl.DefaultExchangeHolder) DefaultExchange(org.apache.camel.impl.DefaultExchange) Exchange(org.apache.camel.Exchange) DefaultExchange(org.apache.camel.impl.DefaultExchange) Endpoint(org.apache.camel.Endpoint) DataByteArrayInputStream(org.fusesource.hawtbuf.DataByteArrayInputStream)

Aggregations

DataByteArrayInputStream (org.fusesource.hawtbuf.DataByteArrayInputStream)4 Endpoint (org.apache.camel.Endpoint)2 Exchange (org.apache.camel.Exchange)2 DefaultExchange (org.apache.camel.impl.DefaultExchange)2 DefaultExchangeHolder (org.apache.camel.impl.DefaultExchangeHolder)2