Disposition
Engine » Delivery

## Macros

#define | PN_RECEIVED (0x0000000000000023)
| The PN_RECEIVED delivery state is a non terminal state indicating how much (if any) message data has been received for a delivery. More...
#define | PN_ACCEPTED (0x0000000000000024)
| The PN_ACCEPTED delivery state is a terminal state indicating that the delivery was successfully processed. More...
#define | PN_REJECTED (0x0000000000000025)
| The PN_REJECTED delivery state is a terminal state indicating that the delivery could not be processed due to some error condition. More...
#define | PN_RELEASED (0x0000000000000026)
| The PN_RELEASED delivery state is a terminal state indicating that the delivery is being returned to the sender. More...
#define | PN_MODIFIED (0x0000000000000027)
| The PN_MODIFIED delivery state is a terminal state indicating that the delivery is being returned to the sender and should be annotated by the sender prior to further delivery attempts. More...

## Typedefs

typedef struct pn_disposition_t | pn_disposition_t
| Dispositions record the current state and/or final outcome of a transfer. More...

## Functions

PN_EXTERN uint64_t | pn_disposition_type (pn_disposition_t *disposition)
| Get the type of a disposition. More...
PN_EXTERN pn_condition_t * | pn_disposition_condition (pn_disposition_t *disposition)
| Access the condition object associated with a disposition. More...
PN_EXTERN pn_data_t * | pn_disposition_data (pn_disposition_t *disposition)
| Access the disposition as a raw pn_data_t. More...
PN_EXTERN uint32_t | pn_disposition_get_section_number (pn_disposition_t *disposition)
| Get the section number associated with a disposition. More...
PN_EXTERN void | pn_disposition_set_section_number (pn_disposition_t *disposition, uint32_t section_number)
| Set the section number associated with a disposition. More...
PN_EXTERN uint64_t | pn_disposition_get_section_offset (pn_disposition_t *disposition)
| Get the section offset associated with a disposition. More...
PN_EXTERN void | pn_disposition_set_section_offset (pn_disposition_t *disposition, uint64_t section_offset)
| Set the section offset associated with a disposition. More...
PN_EXTERN bool | pn_disposition_is_failed (pn_disposition_t *disposition)
| Check if a disposition has the failed flag set. More...
PN_EXTERN void | pn_disposition_set_failed (pn_disposition_t *disposition, bool failed)
| Set the failed flag on a disposition. More...
PN_EXTERN bool | pn_disposition_is_undeliverable (pn_disposition_t *disposition)
| Check if a disposition has the undeliverable flag set. More...
PN_EXTERN void | pn_disposition_set_undeliverable (pn_disposition_t *disposition, bool undeliverable)
| Set the undeliverable flag on a disposition. More...
PN_EXTERN pn_data_t * | pn_disposition_annotations (pn_disposition_t *disposition)
| Access the annotations associated with a disposition. More...

## Detailed Description

## Macro Definition Documentation

## PN_ACCEPTED

#define PN_ACCEPTED (0x0000000000000024)

The PN_ACCEPTED delivery state is a terminal state indicating that the delivery was successfully processed.

Once in this state there will be no further state changes prior to the delivery being settled.

## PN_MODIFIED

#define PN_MODIFIED (0x0000000000000027)

The PN_MODIFIED delivery state is a terminal state indicating that the delivery is being returned to the sender and should be annotated by the sender prior to further delivery attempts.

Once in this state there will be no further state changes prior to the delivery being settled.

## PN_RECEIVED

#define PN_RECEIVED (0x0000000000000023)

The PN_RECEIVED delivery state is a non terminal state indicating how much (if any) message data has been received for a delivery.

## PN_REJECTED

#define PN_REJECTED (0x0000000000000025)

The PN_REJECTED delivery state is a terminal state indicating that the delivery could not be processed due to some error condition.

Once in this state there will be no further state changes prior to the delivery being settled.

## PN_RELEASED

#define PN_RELEASED (0x0000000000000026)

The PN_RELEASED delivery state is a terminal state indicating that the delivery is being returned to the sender.

Once in this state there will be no further state changes prior to the delivery being settled.

## Typedef Documentation

## pn_disposition_t

typedef struct pn_disposition_t pn_disposition_t

Dispositions record the current state and/or final outcome of a transfer.

Every delivery contains both a local and remote disposition. The local disposition holds the local state of the delivery, and the remote disposition holds the last known remote state of the delivery.

## Function Documentation

## pn_disposition_annotations()

PN_EXTERN pn_data_t* pn_disposition_annotations | ( | pn_disposition_t * | disposition | ) |

Access the annotations associated with a disposition.

The pn_data_t object retrieved by this operation may be modified prior to updating a delivery. When a delivery is updated, the annotations described by the pn_data_t are reported to the peer if applicable to the current delivery state, e.g. states such as PN_MODIFIED. The pn_data_t must be empty or contain a symbol keyed map.

The pointer returned by this operation is valid until the parent delivery is settled.

Parameters

  [in] | disposition | a disposition object

Returns
  the annotations associated with the disposition

## pn_disposition_condition()

PN_EXTERN pn_condition_t* pn_disposition_condition | ( | pn_disposition_t * | disposition | ) |

Access the condition object associated with a disposition.

The pn_condition_t object retrieved by this operation may be modified prior to updating a delivery. When a delivery is updated, the condition described by the disposition is reported to the peer if applicable to the current delivery state, e.g. states such as PN_REJECTED.

The pointer returned by this operation is valid until the parent delivery is settled.

Parameters

  [in] | disposition | a disposition object

Returns
  a pointer to the disposition condition

## pn_disposition_data()

PN_EXTERN pn_data_t* pn_disposition_data | ( | pn_disposition_t * | disposition | ) |

Access the disposition as a raw pn_data_t.

Dispositions are an extension point in the AMQP protocol. The disposition interface provides setters/getters for those dispositions that are predefined by the specification, however access to the raw disposition data is provided so that other dispositions can be used.

The pn_data_t pointer returned by this operation is valid until the parent delivery is settled.

Parameters

  [in] | disposition | a disposition object

Returns
  a pointer to the raw disposition data

## pn_disposition_get_section_number()

PN_EXTERN uint32_t pn_disposition_get_section_number | ( | pn_disposition_t * | disposition | ) |

Get the section number associated with a disposition.

Parameters

  [in] | disposition | a disposition object

Returns
  a section number

## pn_disposition_get_section_offset()

PN_EXTERN uint64_t pn_disposition_get_section_offset | ( | pn_disposition_t * | disposition | ) |

Get the section offset associated with a disposition.

Parameters

  [in] | disposition | a disposition object

Returns
  a section offset

## pn_disposition_is_failed()

PN_EXTERN bool pn_disposition_is_failed | ( | pn_disposition_t * | disposition | ) |

Check if a disposition has the failed flag set.

Parameters

  [in] | disposition | a disposition object

Returns
  true if the disposition has the failed flag set, false otherwise

## pn_disposition_is_undeliverable()

PN_EXTERN bool pn_disposition_is_undeliverable | ( | pn_disposition_t * | disposition | ) |

Check if a disposition has the undeliverable flag set.

Parameters

  [in] | disposition | a disposition object

Returns
  true if the disposition has the undeliverable flag set, false otherwise

## pn_disposition_set_failed()

PN_EXTERN void pn_disposition_set_failed | ( | pn_disposition_t * | disposition,
|  | bool | failed
| ) |  |

Set the failed flag on a disposition.

Parameters

  [in] | disposition | a disposition object
  [in] | failed | the value of the failed flag

## pn_disposition_set_section_number()

PN_EXTERN void pn_disposition_set_section_number | ( | pn_disposition_t * | disposition,
|  | uint32_t | section_number
| ) |  |

Set the section number associated with a disposition.

Parameters

  [in] | disposition | a disposition object
  [in] | section_number | a section number

## pn_disposition_set_section_offset()

PN_EXTERN void pn_disposition_set_section_offset | ( | pn_disposition_t * | disposition,
|  | uint64_t | section_offset
| ) |  |

Set the section offset associated with a disposition.

Parameters

  [in] | disposition | a disposition object
  [in] | section_offset | a section offset

## pn_disposition_set_undeliverable()

PN_EXTERN void pn_disposition_set_undeliverable | ( | pn_disposition_t * | disposition,
|  | bool | undeliverable
| ) |  |

Set the undeliverable flag on a disposition.

Parameters

  [in] | disposition | a disposition object
  [in] | undeliverable | the value of the undeliverable flag

## pn_disposition_type()

PN_EXTERN uint64_t pn_disposition_type | ( | pn_disposition_t * | disposition | ) |

Get the type of a disposition.

Defined values are:

- PN_RECEIVED
- PN_ACCEPTED
- PN_REJECTED
- PN_RELEASED
- PN_MODIFIED

Parameters

  [in] | disposition | a disposition object

Returns
  the type of the disposition