All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.messaging.servicebus.implementation.MessageWithLockToken Maven / Gradle / Ivy

There is a newer version: 7.18.0-beta.1
Show newest version
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.messaging.servicebus.implementation;

import org.apache.qpid.proton.message.Message;
import org.apache.qpid.proton.message.impl.MessageImpl;

import java.util.UUID;

/**
 * Represents a received message containing a lock token.
 */
public class MessageWithLockToken extends MessageImpl {
    private final UUID lockToken;

    MessageWithLockToken(Message message, UUID lockToken) {
        super(message.getHeader(), message.getDeliveryAnnotations(), message.getMessageAnnotations(),
            message.getProperties(), message.getApplicationProperties(), message.getBody(), message.getFooter());
        this.lockToken = lockToken;
    }

    /**
     * Gets the lock token associated with this message.
     *
     * @return The lock token associated with this message or {@link MessageUtils#ZERO_LOCK_TOKEN} if there is none.
     */
    public UUID getLockToken() {
        return lockToken;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy