summaryrefslogtreecommitdiff
path: root/qpid/java/client/src/main/java/org/apache/qpid/nclient/util/ReadOnlyMessage.java
blob: 6583a95c7e3d562ed9340e778ec38d6a41a3a0cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package org.apache.qpid.nclient.util;

import java.nio.ByteBuffer;

import org.apache.qpid.transport.DeliveryProperties;
import org.apache.qpid.transport.MessageProperties;
import org.apache.qpid.api.Message;

public abstract class ReadOnlyMessage implements Message
{
    MessageProperties _messageProperties;
    DeliveryProperties _deliveryProperties;
        
    public void appendData(byte[] src)
    {
        throw new UnsupportedOperationException("This Message is read only after the initial source");
    }

    public void appendData(ByteBuffer src)
    {
        throw new UnsupportedOperationException("This Message is read only after the initial source");
    }

    public DeliveryProperties getDeliveryProperties()
    {
        return _deliveryProperties;
    }

    public MessageProperties getMessageProperties()
    {
        return _messageProperties;
    }
    
    public void clearData()
    {
        throw new UnsupportedOperationException("This Message is read only after the initial source, cannot clear data");
    }
}