Notification
Last Updated:2020-09-21
The MCT service uses queue notification service (QNS) for notification, and will push messages to the developer server when the task status of the MCT is transferred.
Create Notification
If you need to create a notification, you can refer to the following codes:
public void createNotification(MediaClient client, String name, String endpoint) {
client.createNotification(name, endpoint);
}
Query Specified Notification
If you want to query the created notifications, you can refer to the following code:
public void getNotification(MediaClient client, String name) {
GetNotificationResponse notification = client.getNotification(name);
System.out.println(notification.getName());
System.out.println(notification.getEndpoint());
}
Query the Notification of Current User
If you want to query all the notifications created by the current user, you can refer to the following code:
public void ListNotification(MediaClient client) {
List<Notification> notifications = mediaClient.listNotification().getNotifications();
for (Notification notifciation : notifications) {
System.out.println(notifciation.getName());
System.out.println(notifciation.getEndpoint());
}
}
Delete Notification
If you need to delete a certain notification, you can refer to the following code:
public void deleteNotification(MediaClient client, String name) {
client.deleteNotification(name);
}