CloudQueueMessage Class

  • java.lang.Object
    • com.microsoft.azure.storage.queue.CloudQueueMessage

public class CloudQueueMessage

Represents a message in the Microsoft Azure Queue service.

Field Summary

Modifier and Type Field and Description
String messageContent

Holds the message content.

Constructor Summary

Constructor Description
CloudQueueMessage()

Initializes a new instance of the class (used internally).

CloudQueueMessage(final byte[] content)

Initializes a new instance of the class with a array containing the message.

CloudQueueMessage(final String content)

Initializes a new instance of the class with a containing the message.

Method Summary

Modifier and Type Method and Description
final int getDequeueCount()

Gets the dequeue count.

final Date getExpirationTime()

Gets the time that the message expires.

final String getId()

Gets the message ID.

final Date getInsertionTime()

Gets the time the message was added to the queue.

final byte [] getMessageContentAsByte()

Gets the content of the message as a byte array.

final String getMessageContentAsString()

Gets the content of the message as a string.

final String getMessageContentForTransfer(final boolean shouldEncodeMessage, QueueRequestOptions options)

Gets the content of the message for transfer (internal use only).

final String getMessageId()

Gets the message ID.

final QueueMessageType getMessageType()

Gets the message type.

final Date getNextVisibleTime()

Gets the time that the message will next be visible.

final String getPopReceipt()

Gets the message's pop receipt.

final void setDequeueCount(int dequeueCount)

Sets the dequeue count.

final void setExpirationTime(final Date expirationTime)

Sets the expiration time for the message.

final void setInsertionTime(Date insertionTime)

Sets the representing the time the message was added to the queue.

final void setMessageContent(final byte[] content)

Sets the content of the message as a array.

final void setMessageContent(final String content)

Sets the content of the message as a .

final void setMessageId(String id)

Sets the message ID.

final void setMessageType(final QueueMessageType messageType)

Sets the message's type

final void setNextVisibleTime(final Date nextVisibleTime)

Sets the time for the message to become visible in the queue.

final void setPopReceipt(final String popReceipt)

Sets the message's pop receipt.

Field Details

messageContent

protected String messageContent

Holds the message content.

Constructor Details

CloudQueueMessage

protected CloudQueueMessage()

Initializes a new instance of the class (used internally).

CloudQueueMessage

public CloudQueueMessage(final byte[] content)

Initializes a new instance of the class with a array containing the message.

Parameters:

content - A byte array which contains the message.

CloudQueueMessage

public CloudQueueMessage(final String content)

Initializes a new instance of the class with a containing the message.

Parameters:

content - A String which contains the message.

Method Details

getDequeueCount

public final int getDequeueCount()

Gets the dequeue count.

Returns:

An int which contains the dequeue count.

getExpirationTime

public final Date getExpirationTime()

Gets the time that the message expires.

Returns:

A java.util.Date object which represents the time that the message expires.

getId

public final String getId()

Gets the message ID.

Returns:

A String which contains the message ID.

getInsertionTime

public final Date getInsertionTime()

Gets the time the message was added to the queue.

Returns:

A java.util.Date which represents the time the message was added to the queue.

getMessageContentAsByte

public final byte [] getMessageContentAsByte()

Gets the content of the message as a byte array.

Returns:

A byte array which contains the content of the message.

Throws:

StorageException - If a storage service error occurred.

getMessageContentAsString

public final String getMessageContentAsString()

Gets the content of the message as a string.

Returns:

A String which contains the content of the message.

Throws:

StorageException - If a storage service error occurred.

getMessageContentForTransfer

protected final String getMessageContentForTransfer(final boolean shouldEncodeMessage, QueueRequestOptions options)

Gets the content of the message for transfer (internal use only).

Parameters:

shouldEncodeMessage - Indicates if the message should be encoded.
options - A QueueRequestOptions object that specifies additional options for the request.

Returns:

A String which contains the content of the message.

Throws:

StorageException - If a storage service error occurred.

getMessageId

public final String getMessageId()

Gets the message ID.

Returns:

A String which contains the message ID.

getMessageType

protected final QueueMessageType getMessageType()

Gets the message type.

Returns:

A QueueMessageType value which represents the message type.

getNextVisibleTime

public final Date getNextVisibleTime()

Gets the time that the message will next be visible.

Returns:

A java.util.Date with the time that the message will next be visible.

getPopReceipt

public final String getPopReceipt()

Gets the message's pop receipt.

Returns:

A String which contains the message's pop receipt.

setDequeueCount

protected final void setDequeueCount(int dequeueCount)

Sets the dequeue count.

Parameters:

dequeueCount - An int which contains the dequeue count.

setExpirationTime

protected final void setExpirationTime(final Date expirationTime)

Sets the expiration time for the message.

Parameters:

expirationTime - The java.util.Date which represents the expiration time to set on the message.

setInsertionTime

protected final void setInsertionTime(Date insertionTime)

Sets the representing the time the message was added to the queue.

Parameters:

insertionTime - The java.util.Date representing the time the message was added to the queue.

setMessageContent

public final void setMessageContent(final byte[] content)

Sets the content of the message as a array.

Parameters:

content - A byte array which contains the content of the message.

setMessageContent

public final void setMessageContent(final String content)

Sets the content of the message as a .

Parameters:

content - A String which contains the content of the message.

setMessageId

protected final void setMessageId(String id)

Sets the message ID.

Parameters:

id - A String which represents the message ID.

setMessageType

protected final void setMessageType(final QueueMessageType messageType)

Sets the message's type

Parameters:

messageType - A QueueMessageType value which represents the message type.

setNextVisibleTime

protected final void setNextVisibleTime(final Date nextVisibleTime)

Sets the time for the message to become visible in the queue.

Parameters:

nextVisibleTime - A java.util.Date with the time that the message will next be visible.

setPopReceipt

protected final void setPopReceipt(final String popReceipt)

Sets the message's pop receipt.

Parameters:

popReceipt - A String which contains the message's pop receipt.

Applies to