public interface QueueContract extends JerseyFilterableService<QueueContract>
QueueService. These
methods associate a Configuration with the implementation, so the
methods on the instance of QueueContract all work with a
particular storage account.| Modifier and Type | Method and Description |
|---|---|
void |
clearMessages(String queue)
Deletes all messages in the named queue.
|
void |
clearMessages(String queue,
QueueServiceOptions options)
Deletes all messages in the named queue, using the specified options.
|
void |
createMessage(String queue,
String messageText)
Appends a message with the specified text to the tail of the named queue
in the storage account.
|
void |
createMessage(String queue,
String messageText,
CreateMessageOptions options)
Appends a message with the specified text to the tail of the named queue
in the storage account, using the specified options.
|
void |
createQueue(String queue)
Creates a queue in the storage account with the specified queue name.
|
void |
createQueue(String queue,
CreateQueueOptions options)
Creates a queue in the storage account with the specified queue name,
using the specified options.
|
void |
deleteMessage(String queue,
String messageId,
String popReceipt)
Deletes the message in the named queue with the specified message ID and
pop receipt value.
|
void |
deleteMessage(String queue,
String messageId,
String popReceipt,
QueueServiceOptions options)
Deletes the message in the named queue with the specified message ID and
popReceipt value, using the specified options.
|
void |
deleteQueue(String queue)
Deletes the queue in the storage account with the specified queue name.
|
void |
deleteQueue(String queue,
QueueServiceOptions options)
Deletes the queue in the storage account with the specified queue name,
using the specified options.
|
GetQueueMetadataResult |
getQueueMetadata(String queue)
Gets the metadata for the named queue in the storage account.
|
GetQueueMetadataResult |
getQueueMetadata(String queue,
QueueServiceOptions options)
Gets the metadata for the named queue in the storage account, using the
specified options.
|
GetServicePropertiesResult |
getServiceProperties()
Gets the service properties of the queue.
|
GetServicePropertiesResult |
getServiceProperties(QueueServiceOptions options)
Gets the service properties of the queue, using the specified options.
|
ListMessagesResult |
listMessages(String queue)
Retrieves the first message from head of the named queue in the storage
account.
|
ListMessagesResult |
listMessages(String queue,
ListMessagesOptions options)
Retrieves up to 32 messages from the head of the named queue in the
storage account, using the specified options.
|
ListQueuesResult |
listQueues()
Gets a list of the queues in the storage account.
|
ListQueuesResult |
listQueues(ListQueuesOptions options)
Gets a list of the queues in the storage account, using the specified
options.
|
PeekMessagesResult |
peekMessages(String queue)
Peeks a message from the named queue.
|
PeekMessagesResult |
peekMessages(String queue,
PeekMessagesOptions options)
Peeks messages from the named queue, using the specified options.
|
void |
setQueueMetadata(String queue,
HashMap<String,String> metadata)
Sets the specified metadata on the named queue in the storage account.
|
void |
setQueueMetadata(String queue,
HashMap<String,String> metadata,
QueueServiceOptions options)
Sets the specified metadata on the named queue in the storage account,
using the specified options.
|
void |
setServiceProperties(ServiceProperties serviceProperties)
Sets the service properties of the queue.
|
void |
setServiceProperties(ServiceProperties serviceProperties,
QueueServiceOptions options)
Sets the service properties of the queue, using the specified options.
|
UpdateMessageResult |
updateMessage(String queue,
String messageId,
String popReceipt,
String messageText,
int visibilityTimeoutInSeconds)
Updates the message in the named queue with the specified message ID and
pop receipt value to have the specified message text and visibility
timeout value.
|
UpdateMessageResult |
updateMessage(String queue,
String messageId,
String popReceipt,
String messageText,
int visibilityTimeoutInSeconds,
QueueServiceOptions options)
Updates the message in the named queue with the specified message ID and
pop receipt value to have the specified message text and visibility
timeout value, using the specified options.
|
withFilterwithRequestFilterFirst, withRequestFilterLast, withResponseFilterFirst, withResponseFilterLastGetServicePropertiesResult getServiceProperties() throws ServiceException
GetServicePropertiesResult reference to the queue
service properties.ServiceException - if an error occurs accessing the storage service.GetServicePropertiesResult getServiceProperties(QueueServiceOptions options) throws ServiceException
options parameter to specify the
server timeout for the operation.options - A QueueServiceOptions instance containing options for
the request.GetServicePropertiesResult reference to the queue
service properties.ServiceException - if an error occurs accessing the storage service.void setServiceProperties(ServiceProperties serviceProperties) throws ServiceException
serviceProperties - A ServiceProperties instance containing the queue
service properties to set.ServiceException - if an error occurs accessing the storage service.void setServiceProperties(ServiceProperties serviceProperties, QueueServiceOptions options) throws ServiceException
options parameter to specify the
server timeout for the operation.serviceProperties - A ServiceProperties instance containing the queue
service properties to set.options - A QueueServiceOptions instance containing options for
the request.ServiceException - if an error occurs accessing the storage service.void createQueue(String queue) throws ServiceException
queue - A String containing the name of the queue to create.ServiceException - if an error occurs in the storage service.void createQueue(String queue, CreateQueueOptions options) throws ServiceException
options
parameter to specify the server timeout for the operation.queue - A String containing the name of the queue to create.options - A QueueServiceOptions instance containing options for
the request.ServiceException - if an error occurs in the storage service.void deleteQueue(String queue) throws ServiceException
queue - A String containing the name of the queue to delete.ServiceException - if an error occurs in the storage service.void deleteQueue(String queue, QueueServiceOptions options) throws ServiceException
options
parameter to specify the server timeout for the operation.queue - A String containing the name of the queue to delete.options - A QueueServiceOptions instance containing options for
the request.ServiceException - if an error occurs in the storage service.ListQueuesResult listQueues() throws ServiceException
ListQueuesResult reference to the queues returned.ServiceException - if an error occurs in the storage service.ListQueuesResult listQueues(ListQueuesOptions options) throws ServiceException
options parameter to specify
the server timeout for the operation, the prefix for queue names to
match, the marker for the beginning of the queues to list, the maximum
number of results to return, and whether to include queue metadata with
the results.options - A ListQueuesOptions instance containing options for
the request.ListQueuesResult reference to the queues returned.ServiceException - if an error occurs in the storage service.GetQueueMetadataResult getQueueMetadata(String queue) throws ServiceException
String pairs
that is opaque to the server.queue - A String containing the name of the queue to get the
metadata for.GetQueueMetadataResult reference to the metadata for
the queue.ServiceException - if an error occurs in the storage service.GetQueueMetadataResult getQueueMetadata(String queue, QueueServiceOptions options) throws ServiceException
options parameter
to specify the server timeout for the operation. Queue metadata is a
user-defined collection of key-value String pairs that is opaque
to the server.queue - A String containing the name of the queue to get the
metadata for.options - A QueueServiceOptions instance containing options for
the request.ListQueuesResult reference to the queues returned.ServiceException - if an error occurs in the storage service.void setQueueMetadata(String queue, HashMap<String,String> metadata) throws ServiceException
String
pairs that is opaque to the server.queue - A String containing the name of the queue to set the
metadata on.metadata - A HashMap of metadata key-value
String pairs to set on the queue.ServiceException - if an error occurs in the storage service.void setQueueMetadata(String queue, HashMap<String,String> metadata, QueueServiceOptions options) throws ServiceException
options
parameter to specify the server timeout for the operation. Queue metadata
is a user-defined collection of key-value String pairs that is
opaque to the server.queue - A String containing the name of the queue to set the
metadata on.metadata - A HashMap of metadata key-value
String pairs to set on the queue.options - A QueueServiceOptions instance containing options for
the request.ServiceException - if an error occurs in the storage service.void createMessage(String queue, String messageText) throws ServiceException
queue - A String containing the name of the queue to append
the message to.messageText - A String containing the text of the message to append
to the queue.ServiceException - if an error occurs in the storage service.void createMessage(String queue, String messageText, CreateMessageOptions options) throws ServiceException
options parameter to specify the server
timeout for the operation, the message visibility timeout, and the
message time to live in the queue.queue - A String containing the name of the queue to append
the message to.messageText - A String containing the text of the message to append
to the queue.options - A CreateMessageOptions instance containing options for
the request.ServiceException - if an error occurs in the storage service.UpdateMessageResult updateMessage(String queue, String messageId, String popReceipt, String messageText, int visibilityTimeoutInSeconds) throws ServiceException
queue - A String containing the name of the queue with the
message to update.messageId - A String containing the ID of the message to update.popReceipt - A String containing the pop receipt for the message
returned by a call to updateMessage or listMessages.messageText - A String containing the updated text to set for the
message.visibilityTimeoutInSeconds - The new visibility timeout to set on the message, in seconds.UpdateMessageResult reference to the updated message
result returned.ServiceException - if an error occurs in the storage service.UpdateMessageResult updateMessage(String queue, String messageId, String popReceipt, String messageText, int visibilityTimeoutInSeconds, QueueServiceOptions options) throws ServiceException
options parameter to specify the server
timeout for the operation.queue - A String containing the name of the queue with the
message to update.messageId - A String containing the ID of the message to update.popReceipt - A String containing the pop receipt for the message
returned by a call to updateMessage or listMessages.messageText - A String containing the updated text to set for the
message.visibilityTimeoutInSeconds - The new visibility timeout to set on the message, in seconds.options - A QueueServiceOptions instance containing options for
the request.UpdateMessageResult reference to the updated message
result returned.ServiceException - if an error occurs in the storage service.void deleteMessage(String queue, String messageId, String popReceipt) throws ServiceException
queue - A String containing the name of the queue with the
message to delete.messageId - A String containing the ID of the message to delete.popReceipt - A String containing the pop receipt for the message
returned by a call to updateMessage or listMessages.ServiceException - if an error occurs in the storage service.void deleteMessage(String queue, String messageId, String popReceipt, QueueServiceOptions options) throws ServiceException
options parameter to specify the server
timeout for the operation.queue - A String containing the name of the queue with the
message to delete.messageId - A String containing the ID of the message to delete.popReceipt - A String containing the pop receipt for the message
returned by a call to updateMessage or listMessages.options - A QueueServiceOptions instance containing options for
the request.ServiceException - if an error occurs in the storage service.ListMessagesResult listMessages(String queue) throws ServiceException
deleteMessage. If message processing will take longer than the
visibility timeout period, use the
updateMessage method to extend the visibility timeout. The message will
become visible in the queue again when the timeout completes if it is not
deleted.
To get a list of multiple messages from the head of the queue, call the
listMessages(String, ListMessagesOptions) method
with options set specifying the number of messages to return.
queue - A String containing the name of the queue to get the
message from.ListMessagesResult reference to the message result
returned.ServiceException - if an error occurs in the storage service.ListMessagesResult listMessages(String queue, ListMessagesOptions options) throws ServiceException
options parameter to specify the server
timeout for the operation, the number of messages to retrieve, and the
visibility timeout to set on the retrieved messages. When message
processing is complete, each message must be deleted with a call to
deleteMessage. If message processing takes longer than the default
timeout period, use the
updateMessage method to extend the visibility timeout. Each message will
become visible in the queue again when the timeout completes if it is not
deleted.queue - A String containing the name of the queue to get the
messages from.options - A ListMessagesOptions instance containing options for
the request.ListMessagesResult reference to the message result
returned.ServiceException - if an error occurs in the storage service.PeekMessagesResult peekMessages(String queue) throws ServiceException
queue - A String containing the name of the queue to peek the
message from.PeekMessagesResult reference to the message result
returned.ServiceException - if an error occurs in the storage service.PeekMessagesResult peekMessages(String queue, PeekMessagesOptions options) throws ServiceException
options parameter
to specify the server timeout for the operation and the number of
messages to retrieve.queue - A String containing the name of the queue to peek the
message from.options - A PeekMessagesOptions instance containing options for
the request.PeekMessagesResult reference to the message result
returned.ServiceException - if an error occurs in the storage service.void clearMessages(String queue) throws ServiceException
queue - A String containing the name of the queue to delete
all messages from.ServiceException - if an error occurs in the storage service.void clearMessages(String queue, QueueServiceOptions options) throws ServiceException
options parameter to specify the server
timeout for the operation.queue - A String containing the name of the queue to delete
all messages from.options - A QueueServiceOptions instance containing options for
the request.ServiceException - if an error occurs in the storage service./**
* 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.
*/