Qpid Proton C API  0.32.0
delivery.h
Go to the documentation of this file.
1 #ifndef PROTON_DELIVERY_H
2 #define PROTON_DELIVERY_H 1
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
24 
25 #include <proton/import_export.h>
26 #include <proton/disposition.h>
27 #include <proton/type_compat.h>
28 #include <stddef.h>
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
47 
55 PN_EXTERN pn_delivery_tag_t pn_dtag(const char *bytes, size_t size);
56 
68 PN_EXTERN pn_delivery_t *pn_delivery(pn_link_t *link, pn_delivery_tag_t tag);
69 
79 PN_EXTERN void *pn_delivery_get_context(pn_delivery_t *delivery);
80 
90 PN_EXTERN void pn_delivery_set_context(pn_delivery_t *delivery, void *context);
91 
98 PN_EXTERN pn_record_t *pn_delivery_attachments(pn_delivery_t *delivery);
99 
106 PN_EXTERN pn_delivery_tag_t pn_delivery_tag(pn_delivery_t *delivery);
107 
114 PN_EXTERN pn_link_t *pn_delivery_link(pn_delivery_t *delivery);
115 
125 PN_EXTERN pn_disposition_t *pn_delivery_local(pn_delivery_t *delivery);
126 
133 PN_EXTERN uint64_t pn_delivery_local_state(pn_delivery_t *delivery);
134 
145 
152 PN_EXTERN uint64_t pn_delivery_remote_state(pn_delivery_t *delivery);
153 
160 PN_EXTERN bool pn_delivery_settled(pn_delivery_t *delivery);
161 
168 PN_EXTERN size_t pn_delivery_pending(pn_delivery_t *delivery);
169 
179 PN_EXTERN bool pn_delivery_partial(pn_delivery_t *delivery);
180 
199 PN_EXTERN bool pn_delivery_aborted(pn_delivery_t *delivery);
200 
210 PN_EXTERN bool pn_delivery_writable(pn_delivery_t *delivery);
211 
221 PN_EXTERN bool pn_delivery_readable(pn_delivery_t *delivery);
222 
233 PN_EXTERN bool pn_delivery_updated(pn_delivery_t *delivery);
234 
244 PN_EXTERN void pn_delivery_update(pn_delivery_t *delivery, uint64_t state);
245 
253 PN_EXTERN void pn_delivery_clear(pn_delivery_t *delivery);
254 
261 PN_EXTERN bool pn_delivery_current(pn_delivery_t *delivery);
262 
280 PN_EXTERN void pn_delivery_abort(pn_delivery_t *delivery);
281 
292 PN_EXTERN void pn_delivery_settle(pn_delivery_t *delivery);
293 
299 PN_EXTERN void pn_delivery_dump(pn_delivery_t *delivery);
300 
313 PN_EXTERN bool pn_delivery_buffered(pn_delivery_t *delivery);
314 
331 PN_DEPRECATED("Use the PN_DELIVERY event to track deliveries with pending operations")
332 PN_EXTERN pn_delivery_t *pn_work_head(pn_connection_t *connection);
333 
343 PN_DEPRECATED("Use the PN_DELIVERY event to track deliveries with pending operations")
344 PN_EXTERN pn_delivery_t *pn_work_next(pn_delivery_t *delivery);
345 
350 #ifdef __cplusplus
351 }
352 #endif
353 
354 #endif /* delivery.h */
pn_record_t * pn_delivery_attachments(pn_delivery_t *delivery)
Get the attachments that are associated with a delivery object.
void pn_delivery_set_context(pn_delivery_t *delivery, void *context)
Set a new application context for a delivery object.
bool pn_delivery_updated(pn_delivery_t *delivery)
Check if a delivery is updated.
bool pn_delivery_writable(pn_delivery_t *delivery)
Check if a delivery is writable.
uint64_t pn_delivery_local_state(pn_delivery_t *delivery)
Get the local disposition state for a delivery.
bool pn_delivery_aborted(pn_delivery_t *delivery)
Check if a received delivery has been aborted.
bool pn_delivery_current(pn_delivery_t *delivery)
Return true if delivery is the current delivery for its link.
bool pn_delivery_buffered(pn_delivery_t *delivery)
Check if a delivery is buffered.
A delivery has been created or updated.
Definition: event.h:254
pn_disposition_t * pn_delivery_local(pn_delivery_t *delivery)
Get the local disposition for a delivery.
bool pn_delivery_settled(pn_delivery_t *delivery)
Check if a delivery is remotely settled.
pn_delivery_tag_t pn_delivery_tag(pn_delivery_t *delivery)
Get the tag for a delivery object.
void pn_delivery_update(pn_delivery_t *delivery, uint64_t state)
Update the disposition of a delivery.
uint64_t pn_delivery_remote_state(pn_delivery_t *delivery)
Get the remote disposition state for a delivery.
struct pn_delivery_t pn_delivery_t
An AMQP Delivery object.
Definition: types.h:405
struct pn_disposition_t pn_disposition_t
A delivery state.
Definition: disposition.h:52
void pn_delivery_dump(pn_delivery_t *delivery)
Utility function for printing details of a delivery.
bool pn_delivery_partial(pn_delivery_t *delivery)
Check if a delivery only has partial message data.
void pn_delivery_abort(pn_delivery_t *delivery)
Abort a delivery being sent.
pn_link_t * pn_delivery_link(pn_delivery_t *delivery)
Get the parent link for a delivery object.
void * pn_delivery_get_context(pn_delivery_t *delivery)
Get the application context that is associated with a delivery object.
pn_disposition_t * pn_delivery_remote(pn_delivery_t *delivery)
Get the remote disposition for a delivery.
void pn_delivery_clear(pn_delivery_t *delivery)
Clear the updated flag for a delivery.
bool pn_delivery_readable(pn_delivery_t *delivery)
Check if a delivery is readable.
struct pn_connection_t pn_connection_t
An AMQP Connection object.
Definition: types.h:285
pn_delivery_t * pn_delivery(pn_link_t *link, pn_delivery_tag_t tag)
Create a delivery on a link.
pn_bytes_t pn_delivery_tag_t
An AMQP delivery tag.
Definition: delivery.h:46
pn_delivery_t * pn_work_next(pn_delivery_t *delivery)
Get the next delivery on the connection that needs has pending operations.
A const byte buffer.
Definition: types.h:216
pn_delivery_tag_t pn_dtag(const char *bytes, size_t size)
Construct a delivery tag.
pn_delivery_t * pn_work_head(pn_connection_t *connection)
Extracts the first delivery on the connection that has pending operations.
size_t pn_delivery_pending(pn_delivery_t *delivery)
Get the amount of pending message data for a delivery.
void pn_delivery_settle(pn_delivery_t *delivery)
Settle a delivery.
A delivery state.