| 1 |
|
| 2 |
/* |
| 3 |
* |
| 4 |
* Licensed to the Apache Software Foundation (ASF) under one |
| 5 |
* or more contributor license agreements. See the NOTICE file |
| 6 |
* distributed with this work for additional information |
| 7 |
* regarding copyright ownership. The ASF licenses this file |
| 8 |
* to you under the Apache License, Version 2.0 (the |
| 9 |
* "License"); you may not use this file except in compliance |
| 10 |
* with the License. You may obtain a copy of the License at |
| 11 |
* |
| 12 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 13 |
* |
| 14 |
* Unless required by applicable law or agreed to in writing, |
| 15 |
* software distributed under the License is distributed on an |
| 16 |
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 17 |
* KIND, either express or implied. See the License for the |
| 18 |
* specific language governing permissions and limitations |
| 19 |
* under the License. |
| 20 |
* |
| 21 |
*/ |
| 22 |
|
| 23 |
|
| 24 |
package org.apache.qpid.proton.amqp.messaging; |
| 25 |
|
| 26 |
import org.apache.qpid.proton.amqp.UnsignedByte; |
| 27 |
import org.apache.qpid.proton.amqp.UnsignedInteger; |
| 28 |
|
| 29 |
public final class Header implements Section |
| 30 |
{ |
| 31 |
private Boolean _durable; |
| 32 |
private UnsignedByte _priority; |
| 33 |
private UnsignedInteger _ttl; |
| 34 |
private Boolean _firstAcquirer; |
| 35 |
private UnsignedInteger _deliveryCount; |
| 36 |
|
| 37 |
public Header() |
| 38 |
{ |
| 39 |
} |
| 40 |
|
| 41 |
public Header(Header other) |
| 42 |
{ |
| 43 |
this._durable = other._durable; |
| 44 |
this._priority = other._priority; |
| 45 |
this._ttl = other._ttl; |
| 46 |
this._firstAcquirer = other._firstAcquirer; |
| 47 |
this._deliveryCount = other._deliveryCount; |
| 48 |
} |
| 49 |
|
| 50 |
public Boolean getDurable() |
| 51 |
{ |
| 52 |
return _durable; |
| 53 |
} |
| 54 |
|
| 55 |
public void setDurable(Boolean durable) |
| 56 |
{ |
| 57 |
_durable = durable; |
| 58 |
} |
| 59 |
|
| 60 |
public UnsignedByte getPriority() |
| 61 |
{ |
| 62 |
return _priority; |
| 63 |
} |
| 64 |
|
| 65 |
public void setPriority(UnsignedByte priority) |
| 66 |
{ |
| 67 |
_priority = priority; |
| 68 |
} |
| 69 |
|
| 70 |
public UnsignedInteger getTtl() |
| 71 |
{ |
| 72 |
return _ttl; |
| 73 |
} |
| 74 |
|
| 75 |
public void setTtl(UnsignedInteger ttl) |
| 76 |
{ |
| 77 |
_ttl = ttl; |
| 78 |
} |
| 79 |
|
| 80 |
public Boolean getFirstAcquirer() |
| 81 |
{ |
| 82 |
return _firstAcquirer; |
| 83 |
} |
| 84 |
|
| 85 |
public void setFirstAcquirer(Boolean firstAcquirer) |
| 86 |
{ |
| 87 |
_firstAcquirer = firstAcquirer; |
| 88 |
} |
| 89 |
|
| 90 |
public UnsignedInteger getDeliveryCount() |
| 91 |
{ |
| 92 |
return _deliveryCount; |
| 93 |
} |
| 94 |
|
| 95 |
public void setDeliveryCount(UnsignedInteger deliveryCount) |
| 96 |
{ |
| 97 |
_deliveryCount = deliveryCount; |
| 98 |
} |
| 99 |
|
| 100 |
|
| 101 |
@Override |
| 102 |
public String toString() |
| 103 |
{ |
| 104 |
return "Header{" + |
| 105 |
"durable=" + _durable + |
| 106 |
", priority=" + _priority + |
| 107 |
", ttl=" + _ttl + |
| 108 |
", firstAcquirer=" + _firstAcquirer + |
| 109 |
", deliveryCount=" + _deliveryCount + |
| 110 |
'}'; |
| 111 |
} |
| 112 |
|
| 113 |
@Override |
| 114 |
public SectionType getType() { |
| 115 |
return SectionType.Header; |
| 116 |
} |
| 117 |
} |