com.aliyun.mns.client
类 DefaultMNSClient

java.lang.Object
  继承者 com.aliyun.mns.client.DefaultMNSClient
所有已实现的接口:
MNSClient

public class DefaultMNSClient
extends Object
implements MNSClient


构造方法摘要
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对象。
 
方法摘要
 void addHeader(String key, String value)
           
 void close()
          关闭 client
 CloudQueue createQueue(QueueMeta queueMeta)
          创建队列
 AsyncResult<String> createQueueAsync(QueueMeta queueMeta, AsyncCallback<String> callback)
           
 CloudTopic createTopic(TopicMeta meta)
          根据Topic的meta数据,创建CloudTopic对象,用于后续的消息发送等
 CloudQueue getQueueRef(String queueName)
          根据队列的URL创建CloudQueue对象,后于后续对改对象的创建、查询等
 CloudTopic getTopicRef(String topicName)
          根据Tpoic的URL创建CloudTopic对象,后于后续对改对象的创建、查询等
 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)
           
 void open()
          打开 client
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

DefaultMNSClient

public DefaultMNSClient(String endpoint,
                        String accessId,
                        String accessKey)
使用指定的MNS Endpoint构造一个新的MNSClient对象。

参数:
endpoint - MNS服务的Endpoint。
accessId - 访问MNS的Access ID。
accessKey - 访问MNS的Access Key。

DefaultMNSClient

public DefaultMNSClient(String endpoint,
                        String accessId,
                        String accessKey,
                        ClientConfiguration config)
使用指定的MNS Endpoint和配置构造一个新的MNSClient对象。

参数:
endpoint - MNS服务的Endpoint。
accessId - 访问MNS的Access ID。
accessKey - 访问MNS的Access Key。
config - 客户端配置 ClientConfiguration

DefaultMNSClient

protected DefaultMNSClient(ServiceCredentials credentials,
                           ServiceClient serviceClient,
                           String endpoint)
方法详细信息

close

public void close()
从接口 MNSClient 复制的描述
关闭 client

指定者:
接口 MNSClient 中的 close

open

public void open()
从接口 MNSClient 复制的描述
打开 client

指定者:
接口 MNSClient 中的 open

isOpen

public boolean isOpen()
从接口 MNSClient 复制的描述
检查client是否为打开状态

指定者:
接口 MNSClient 中的 isOpen
返回:
true if client is open, else false

getQueueRef

public CloudQueue getQueueRef(String queueName)
从接口 MNSClient 复制的描述
根据队列的URL创建CloudQueue对象,后于后续对改对象的创建、查询等

指定者:
接口 MNSClient 中的 getQueueRef
返回:
CloudQueue object

addHeader

public void addHeader(String key,
                      String value)

createQueueAsync

public AsyncResult<String> createQueueAsync(QueueMeta queueMeta,
                                            AsyncCallback<String> callback)

createQueue

public CloudQueue createQueue(QueueMeta queueMeta)
                       throws ClientException,
                              ServiceException
创建队列

指定者:
接口 MNSClient 中的 createQueue
参数:
queueMeta - 队列属性
返回:
CloudQueue object
抛出:
ClientException
ServiceException

listQueueURL

public PagingListResult<String> listQueueURL(String prefix,
                                             String marker,
                                             Integer retNumber)
                                      throws ClientException,
                                             ServiceException
列举队列

指定者:
接口 MNSClient 中的 listQueueURL
参数:
prefix - 队列名前缀
marker - 列举的起始位置,""表示从第一个开始,也可以是前一次列举返回的marker
retNumber - 最多返回的个数
返回:
返回队列URL列表及marker
抛出:
ClientException
ServiceException

listQueue

public PagingListResult<QueueMeta> listQueue(String prefix,
                                             String marker,
                                             Integer retNumber)
                                      throws ClientException,
                                             ServiceException
列举队列

指定者:
接口 MNSClient 中的 listQueue
参数:
prefix - 队列名前缀
marker - 列举的起始位置,""表示从第一个开始,也可以是前一次列举返回的marker
retNumber - 最多返回的个数
返回:
返回队列属性列表及marker
抛出:
ClientException
ServiceException

getTopicRef

public CloudTopic getTopicRef(String topicName)
根据Tpoic的URL创建CloudTopic对象,后于后续对改对象的创建、查询等

指定者:
接口 MNSClient 中的 getTopicRef
参数:
topicName - topic name
返回:
CloudTpoic对象

createTopic

public CloudTopic createTopic(TopicMeta meta)
根据Topic的meta数据,创建CloudTopic对象,用于后续的消息发送等

指定者:
接口 MNSClient 中的 createTopic
参数:
meta - CloudTpoic的meta数据
返回:
CloudTpoic对象

listTopic

public PagingListResult<TopicMeta> listTopic(String prefix,
                                             String marker,
                                             Integer retNumber)
                                      throws ClientException,
                                             ServiceException
指定者:
接口 MNSClient 中的 listTopic
参数:
prefix - topic name前缀
marker - topic的起始位置,""表示从第一个开始,也可以是前一次列举返回的marker
retNumber - 最多返回的个数
返回:
topic meta列表及marker数据
抛出:
ClientException
ServiceException

listTopicURL

public PagingListResult<String> listTopicURL(String prefix,
                                             String marker,
                                             Integer retNumber)
                                      throws ClientException,
                                             ServiceException
指定者:
接口 MNSClient 中的 listTopicURL
参数:
prefix - topic name前缀
marker - topic的起始位置,""表示从第一个开始,也可以是前一次列举返回的marker
retNumber - 最多返回的个数
返回:
topic url列表及marker数据
抛出:
ClientException
ServiceException


Copyright © 2016. All Rights Reserved.