| Modifier | Constructor and Description |
|---|---|
protected |
DefaultMNSClient(ServiceCredentials credentials,
ServiceClient serviceClient,
String endpoint) |
|
DefaultMNSClient(String endpoint,
String accessId,
String accessKey)
使用指定的MNS Endpoint构造一个新的
MNSClient对象。 |
|
DefaultMNSClient(String endpoint,
String accessId,
String accessKey,
ClientConfiguration config)
使用指定的MNS Endpoint和配置构造一个新的
MNSClient对象。 |
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(String key,
String value) |
AsyncResult<PagingListResult<QueueMeta>> |
asyncListQueue(String prefix,
String marker,
Integer retNumber,
boolean withMeta,
AsyncCallback<PagingListResult<QueueMeta>> callback) |
void |
close()
关闭 client, close之后这个client的资源可能随时被释放
|
CloudPullTopic |
createPullTopic(TopicMeta topicMeta,
Vector<String> queueNameList)
Creates cloud pull topic.
|
CloudPullTopic |
createPullTopic(TopicMeta topicMeta,
Vector<String> queueNameList,
boolean needCreateQueue,
QueueMeta queueMetaTemplate)
Creates cloud pull topic.
|
CloudPullTopic |
createPullTopic(TopicMeta topicMeta,
Vector<String> queueNameList,
boolean needCreateQueue,
QueueMeta queueMetaTemplate,
Vector<String> tagList)
Creates cloud pull topic.
|
CloudQueue |
createQueue(QueueMeta queueMeta)
创建队列
|
AsyncResult<String> |
createQueueAsync(QueueMeta queueMeta,
AsyncCallback<String> callback) |
CloudTopic |
createTopic(TopicMeta meta)
根据Topic的meta数据,创建CloudTopic对象,用于后续的消息发送等
|
TransactionQueue |
createTransQueue(QueueMeta queueMeta)
Creates transaction queue with default message life time and delayTime
|
TransactionQueue |
createTransQueue(QueueMeta queueMeta,
TransactionChecker checker)
Creates transaction queue with default message life time and delayTime
|
TransactionQueue |
createTransQueue(QueueMeta queueMeta,
TransactionChecker checker,
long lifeTime,
long delayTime)
Creates transaction queue.
|
AccountAttributes |
GetAccountAttributes()
获取当前用户的账号级别属性
|
CloudQueue |
getQueueRef(String queueName)
根据队列的URL创建CloudQueue对象,后于后续对改对象的创建、查询等
|
int |
getServiceClientHashCode() |
CloudTopic |
getTopicRef(String topicName)
根据Tpoic的URL创建CloudTopic对象,后于后续对改对象的创建、查询等
|
TransactionQueue |
getTransQueueRef(String queueName,
TransactionChecker checker)
Get reference to a transaction queue object by given queue name.
|
boolean |
isOpen()
检查client是否为打开状态
|
PagingListResult<QueueMeta> |
listQueue(String prefix,
String marker,
Integer retNumber)
列举队列
|
PagingListResult<String> |
listQueueURL(String prefix,
String marker,
Integer retNumber)
列举队列
|
PagingListResult<TopicMeta> |
listTopic(String prefix,
String marker,
Integer retNumber) |
PagingListResult<String> |
listTopicURL(String prefix,
String marker,
Integer retNumber) |
OpenServiceResponse |
openService()
开通 mns
|
void |
SetAccountAttributes(AccountAttributes accountAttributes)
设置当前用户的账号级别属性
|
public DefaultMNSClient(String endpoint, String accessId, String accessKey)
MNSClient对象。endpoint - MNS服务的Endpoint。accessId - 访问MNS的Access ID。accessKey - 访问MNS的Access Key。public DefaultMNSClient(String endpoint, String accessId, String accessKey, ClientConfiguration config)
MNSClient对象。endpoint - MNS服务的Endpoint。accessId - 访问MNS的Access ID。accessKey - 访问MNS的Access Key。config - 客户端配置 ClientConfiguration。protected DefaultMNSClient(ServiceCredentials credentials, ServiceClient serviceClient, String endpoint)
public int getServiceClientHashCode()
public void close()
MNSClientpublic boolean isOpen()
MNSClientpublic void SetAccountAttributes(AccountAttributes accountAttributes) throws ServiceException, ClientException
MNSClientSetAccountAttributes in interface MNSClientaccountAttributes - objectServiceException - exceptionClientException - exceptionpublic AccountAttributes GetAccountAttributes() throws ServiceException, ClientException
MNSClientGetAccountAttributes in interface MNSClientServiceException - exceptionClientException - exceptionpublic CloudQueue getQueueRef(String queueName)
MNSClientgetQueueRef in interface MNSClientqueueName - exceptionpublic AsyncResult<String> createQueueAsync(QueueMeta queueMeta, AsyncCallback<String> callback)
public CloudQueue createQueue(QueueMeta queueMeta) throws ClientException, ServiceException
createQueue in interface MNSClientqueueMeta - 队列属性ClientException - exceptionServiceException - exceptionpublic TransactionQueue getTransQueueRef(String queueName, TransactionChecker checker)
MNSClientgetTransQueueRef in interface MNSClientqueueName - queueNamechecker - TransactionChecker to check the transaction message status.public TransactionQueue createTransQueue(QueueMeta queueMeta, TransactionChecker checker, long lifeTime, long delayTime) throws ClientException, ServiceException
MNSClientdelayTime should be bigger than lifetime to make sure that that message will not be visible to consumer by default.
createTransQueue in interface MNSClientqueueMeta - queue properties.checker - TransactionChecker to check the transaction message status.lifeTime - message life time in secondsdelayTime - message delay time in secondsClientException - exceptionServiceException - exception
The product no longer supports this functionpublic TransactionQueue createTransQueue(QueueMeta queueMeta, TransactionChecker checker) throws ClientException, ServiceException
MNSClientcreateTransQueue in interface MNSClientqueueMeta - queue properties.checker - TransactionChecker to check the transaction message status.ClientException - exceptionServiceException - exception
The product no longer supports this functionpublic TransactionQueue createTransQueue(QueueMeta queueMeta) throws ClientException, ServiceException
MNSClientcreateTransQueue in interface MNSClientqueueMeta - queue properties.ClientException - exceptionServiceException - exception
The product no longer supports this functionpublic CloudPullTopic createPullTopic(TopicMeta topicMeta, Vector<String> queueNameList, boolean needCreateQueue, QueueMeta queueMetaTemplate) throws ClientException, ServiceException
MNSClientcreatePullTopic in interface MNSClienttopicMeta - topic properties.queueNameList - the queue name list which are going to be endpoint of new created topic.needCreateQueue - flag to indicate that if we need to create the queue in the queueNameList.queueMetaTemplate - the queueMeta template used to create queues in queueNamelist if need.ClientException - exceptionServiceException - exceptionpublic CloudPullTopic createPullTopic(TopicMeta topicMeta, Vector<String> queueNameList, boolean needCreateQueue, QueueMeta queueMetaTemplate, Vector<String> tagList) throws ClientException, ServiceException
MNSClientcreatePullTopic in interface MNSClienttopicMeta - topic properties.queueNameList - the queue name list which are going to be endpoint of new created topic.needCreateQueue - flag to indicate that if we need to create the queue in the queueNameList.queueMetaTemplate - the queueMeta template used to create queues in queueNamelist if need.tagList - the filter tag list for each consumer queue.ClientException - exceptionServiceException - exceptionpublic CloudPullTopic createPullTopic(TopicMeta topicMeta, Vector<String> queueNameList) throws ClientException, ServiceException
MNSClientcreatePullTopic in interface MNSClienttopicMeta - topic properties.queueNameList - the queue name list which are going to be endpoint of new created topic.ClientException - exceptionServiceException - exceptionpublic PagingListResult<String> listQueueURL(String prefix, String marker, Integer retNumber) throws ClientException, ServiceException
MNSClientlistQueueURL in interface MNSClientprefix - 队列名前缀marker - 列举的起始位置,""表示从第一个开始,也可以是前一次列举返回的markerretNumber - 最多返回的个数ClientException - exceptionServiceException - exceptionpublic PagingListResult<QueueMeta> listQueue(String prefix, String marker, Integer retNumber) throws ClientException, ServiceException
MNSClientlistQueue in interface MNSClientprefix - 队列名前缀marker - 列举的起始位置,""表示从第一个开始,也可以是前一次列举返回的markerretNumber - 最多返回的个数ClientException - exceptionServiceException - exceptionpublic AsyncResult<PagingListResult<QueueMeta>> asyncListQueue(String prefix, String marker, Integer retNumber, boolean withMeta, AsyncCallback<PagingListResult<QueueMeta>> callback) throws ClientException, ServiceException
ClientExceptionServiceExceptionpublic CloudTopic getTopicRef(String topicName)
MNSClientgetTopicRef in interface MNSClienttopicName - topic namepublic CloudTopic createTopic(TopicMeta meta)
MNSClientcreateTopic in interface MNSClientmeta - CloudTpoic的meta数据public PagingListResult<TopicMeta> listTopic(String prefix, String marker, Integer retNumber) throws ClientException, ServiceException
listTopic in interface MNSClientprefix - topic name前缀marker - topic的起始位置,""表示从第一个开始,也可以是前一次列举返回的markerretNumber - 最多返回的个数ClientException - exceptionServiceException - exceptionpublic PagingListResult<String> listTopicURL(String prefix, String marker, Integer retNumber) throws ClientException, ServiceException
listTopicURL in interface MNSClientprefix - topic name前缀marker - topic的起始位置,""表示从第一个开始,也可以是前一次列举返回的markerretNumber - 最多返回的个数ClientException - exceptionServiceException - exceptionpublic OpenServiceResponse openService()
MNSClientopenService in interface MNSClientCopyright © 2024. All Rights Reserved.