| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||
| ProducerTemplate |
|
| 0.0;0 |
| 1 | /** |
|
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
|
| 3 | * contributor license agreements. See the NOTICE file distributed with |
|
| 4 | * this work for additional information regarding copyright ownership. |
|
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
|
| 6 | * (the "License"); you may not use this file except in compliance with |
|
| 7 | * the License. You may obtain a copy of the License at |
|
| 8 | * |
|
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
|
| 10 | * |
|
| 11 | * Unless required by applicable law or agreed to in writing, software |
|
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
|
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
| 14 | * See the License for the specific language governing permissions and |
|
| 15 | * limitations under the License. |
|
| 16 | */ |
|
| 17 | package org.apache.camel; |
|
| 18 | ||
| 19 | import java.util.Map; |
|
| 20 | ||
| 21 | /** |
|
| 22 | * @version $Revision: $ |
|
| 23 | */ |
|
| 24 | public interface ProducerTemplate<E extends Exchange> extends Service { |
|
| 25 | ||
| 26 | /** |
|
| 27 | * Sends the exchange to the default endpoint |
|
| 28 | * |
|
| 29 | * @param exchange the exchange to send |
|
| 30 | */ |
|
| 31 | E send(E exchange); |
|
| 32 | ||
| 33 | /** |
|
| 34 | * Sends an exchange to the default endpoint using a supplied |
|
| 35 | * |
|
| 36 | * @{link Processor} to populate the exchange |
|
| 37 | * |
|
| 38 | * @param processor the transformer used to populate the new exchange |
|
| 39 | */ |
|
| 40 | E send(Processor processor); |
|
| 41 | ||
| 42 | /** |
|
| 43 | * Sends the body to the default endpoint and returns the result content |
|
| 44 | * |
|
| 45 | * @param body the body to send |
|
| 46 | * @return the returned message body |
|
| 47 | */ |
|
| 48 | Object sendBody(Object body); |
|
| 49 | ||
| 50 | /** |
|
| 51 | * Sends the body to the default endpoint with a specified header and header |
|
| 52 | * value |
|
| 53 | * |
|
| 54 | * @param body the payload send |
|
| 55 | * @param header the header name |
|
| 56 | * @param headerValue the header value |
|
| 57 | * @return the result |
|
| 58 | */ |
|
| 59 | Object sendBodyAndHeader(Object body, String header, Object headerValue); |
|
| 60 | ||
| 61 | /** |
|
| 62 | * Sends the body to the default endpoint with the specified headers and |
|
| 63 | * header values |
|
| 64 | * |
|
| 65 | * @param body the payload send |
|
| 66 | * @return the result |
|
| 67 | */ |
|
| 68 | Object sendBodyAndHeaders(Object body, Map<String, Object> headers); |
|
| 69 | ||
| 70 | // Allow sending to arbitrary endpoints |
|
| 71 | // ----------------------------------------------------------------------- |
|
| 72 | ||
| 73 | /** |
|
| 74 | * Sends the exchange to the given endpoint |
|
| 75 | * |
|
| 76 | * @param endpointUri the endpoint URI to send the exchange to |
|
| 77 | * @param exchange the exchange to send |
|
| 78 | */ |
|
| 79 | E send(String endpointUri, E exchange); |
|
| 80 | ||
| 81 | /** |
|
| 82 | * Sends an exchange to an endpoint using a supplied |
|
| 83 | * |
|
| 84 | * @{link Processor} to populate the exchange |
|
| 85 | * |
|
| 86 | * @param endpointUri the endpoint URI to send the exchange to |
|
| 87 | * @param processor the transformer used to populate the new exchange |
|
| 88 | */ |
|
| 89 | E send(String endpointUri, Processor processor); |
|
| 90 | ||
| 91 | /** |
|
| 92 | * Sends the exchange to the given endpoint |
|
| 93 | * |
|
| 94 | * @param endpoint the endpoint to send the exchange to |
|
| 95 | * @param exchange the exchange to send |
|
| 96 | */ |
|
| 97 | E send(Endpoint<E> endpoint, E exchange); |
|
| 98 | ||
| 99 | /** |
|
| 100 | * Sends an exchange to an endpoint using a supplied |
|
| 101 | * |
|
| 102 | * @{link Processor} to populate the exchange |
|
| 103 | * |
|
| 104 | * @param endpoint the endpoint to send the exchange to |
|
| 105 | * @param processor the transformer used to populate the new exchange |
|
| 106 | */ |
|
| 107 | E send(Endpoint<E> endpoint, Processor processor); |
|
| 108 | ||
| 109 | /** |
|
| 110 | * Send the body to an endpoint |
|
| 111 | * |
|
| 112 | * @param endpoint |
|
| 113 | * @param body = the payload |
|
| 114 | * @return the result |
|
| 115 | */ |
|
| 116 | Object sendBody(Endpoint<E> endpoint, Object body); |
|
| 117 | ||
| 118 | /** |
|
| 119 | * Send the body to an endpoint |
|
| 120 | * |
|
| 121 | * @param endpointUri |
|
| 122 | * @param body = the payload |
|
| 123 | * @return the result |
|
| 124 | */ |
|
| 125 | Object sendBody(String endpointUri, Object body); |
|
| 126 | ||
| 127 | } |