You can get a list of all application scope topic. If there are more than 50 topics, you need to get the topic list in multiple pages with the pagination.
The following is the sample code for getting a list of all application scope topics.
This is the brief explanation of the sample code:
Execute the listTopics method to get a list of topics.
Execute the getResult method to get the topic list as a List.
Execute the hasNext method to check if there exist more topics to get. If there are ones, execute the getPaginationKey to get a key and execute the listTopics again with this key.
Getting a list of group-scope topics
You can get a list of all topics in the specified group scope. If there are more than 50 topics, you need to get the topic list in multiple pages with the pagination.
The following is the sample code for getting a list of all topics in a group scope.
This is the brief explanation of the sample code:
Execute the listTopics method to get a list of topics.
Execute the getResult method to get the topic list as a List.
Execute the hasNext method to check if there exist more topics to get. If there are ones, execute the getPaginationKey to get a key and execute the listTopics again with this key.
Getting a list of user-scope topics
You can get a list of all topics in the specified user scope. If there are more than 50 topics, you need to get the topic list in multiple pages with the pagination.
The following is the sample code for getting a list of all topics in a user scope.
This is the brief explanation of the sample code:
Execute the listTopics method to get a list of topics.
Execute the getResult method to get the topic list as a List.
Execute the hasNext method to check if there exist more topics to get. If there are ones, execute the getPaginationKey to get a key and execute the listTopics again with this key.