public class CloudQueueMessage extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
dequeueCount
Holds the dequeue count.
|
protected Date |
expirationTime
Holds the time that the message expires.
|
protected String |
id
Holds the message ID.
|
protected Date |
insertionTime
Holds the time that the message was added to the queue.
|
protected String |
messageContent
Holds the message content.
|
protected QueueMessageType |
messageType
Holds the message type.
|
protected Date |
nextVisibleTime
Holds the time that the message will next be visible.
|
protected String |
popReceipt
Holds the message's pop receipt.
|
Constructor and Description |
---|
CloudQueueMessage(byte[] content)
Initializes a new instance of the CloudQueueMessage class with an array
of
byte containing the message. |
CloudQueueMessage(String content)
Initializes a new instance of the CloudQueueMessage class with a string
containing the message.
|
Modifier and Type | Method and Description |
---|---|
int |
getDequeueCount()
Gets the dequeue count.
|
Date |
getExpirationTime()
Gets the time that the message expires.
|
String |
getId()
Gets the message ID.
|
Date |
getInsertionTime()
Gets the time that the message was added to the queue.
|
byte[] |
getMessageContentAsByte()
Gets the content of the message as a byte array.
|
String |
getMessageContentAsString()
Gets the content of the message as a string.
|
protected String |
getMessageContentForTransfer(boolean shouldEncodeMessage)
Gets the content of the message for transfer (internal use only).
|
Date |
getNextVisibleTime()
Gets the time that the message will next be visible.
|
String |
getPopReceipt()
Gets the message's pop receipt.
|
void |
setExpirationTime(Date expirationTime)
Sets the expiration time for the message.
|
void |
setMessageContent(byte[] content)
Sets the content of the message as an array of
byte . |
void |
setMessageContent(String content)
Sets the content of the message as a
String . |
void |
setNextVisibleTime(Date nextVisibleTime)
Sets the time for the message to become visible in the queue.
|
protected String id
protected String popReceipt
protected Date insertionTime
protected Date expirationTime
protected Date nextVisibleTime
protected String messageContent
protected int dequeueCount
protected QueueMessageType messageType
public CloudQueueMessage(byte[] content)
byte
containing the message.content
- The array of byte
that contains the message.public CloudQueueMessage(String content)
content
- The String
that contains the message.public final int getDequeueCount()
public final Date getExpirationTime()
public final String getId()
String
that contains the message ID.public final Date getInsertionTime()
public final byte[] getMessageContentAsByte() throws StorageException
byte
with the content of the message.StorageException
- If a storage service error occurred.public final String getMessageContentAsString() throws StorageException
String
with the content of the message.StorageException
- If a storage service error occurred.protected final String getMessageContentForTransfer(boolean shouldEncodeMessage) throws StorageException
String
with the content of the message.StorageException
public final Date getNextVisibleTime()
java.util.Date
with the time that the message will
next be visible.public final String getPopReceipt()
String
containing the message's pop receipt.public final void setExpirationTime(Date expirationTime)
expirationTime
- The java.util.Date
representing the expiration
time to set on the message.public final void setMessageContent(byte[] content)
byte
.content
- The content of the message.public final void setMessageContent(String content)
String
.content
- The content of the message.public final void setNextVisibleTime(Date nextVisibleTime)
nextVisibleTime
- The java.util.Date
representing the time to set
for the message to be visible./**
* Copyright Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/