Class NotificationManager


  • public class NotificationManager
    extends AbstractAPIManager
    Class to manage notifications, notification subscriptions and templates using the Obsidian public embedded API. See AbstractAPIManager for details on how transactions are managed within all requests.

    Example:

        NotificationListing listing = new NotificationManager().listNotifications(null);
        System.out.println("Notifications: " + listing);
     
    Since:
    3.0
    See Also:
    Embedded API Wiki, REST API Wiki, Carfey Date
    • Constructor Detail

      • NotificationManager

        public NotificationManager()
    • Method Detail

      • listNotifications

        public NotificationListing listNotifications​(NotificationListingParameters parameters)
                                              throws ValidationException,
                                                     java.lang.Exception
        Searches/lists notifications which were triggered for events.
        Parameters:
        parameters - options for searching notifications (defaulted if null)
        Returns:
        the NotificationListing matching the supplied parameter (never null)
        Throws:
        ValidationException - A validation error which prevents the action from succeeding.
        java.lang.Exception - Any other type of unexpected exception.
        Since:
        3.0
      • getNotification

        public Notification getNotification​(long id)
                                     throws MissingEntityException,
                                            java.lang.Exception
        Describe the notification with the supplied ID.
        Parameters:
        id - notification's unique ID.
        Returns:
        the Notification with the supplied ID.
        Throws:
        MissingEntityException - If the notification with the requested ID does not exist.
        java.lang.Exception - Any other type of unexpected exception.
        Since:
        3.0
      • listTemplates

        public TemplateListing listTemplates()
                                      throws java.lang.Exception
        Lists configured templates.
        Returns:
        the full TemplateListing
        Throws:
        java.lang.Exception - Any type of unexpected exception.
        Since:
        3.0
      • getTemplate

        public Template getTemplate​(long templateId)
                             throws MissingEntityException,
                                    java.lang.Exception
        Loads details on an existing template.
        Parameters:
        templateId - ID of the template to load
        Returns:
        the configured Template
        Throws:
        MissingEntityException - If the template with the requested ID does not exist.
        java.lang.Exception - Any other type of unexpected exception.
        Since:
        3.0
      • addTemplate

        public Template addTemplate​(TemplateUpdateRequest request,
                                    java.lang.String auditUser)
                             throws ValidationException,
                                    java.lang.Exception
        Creates a new template with the supplied configuration.
        Parameters:
        request - the template
        auditUser - Optional user that is marked in audit columns. Defaults to "embeddedAPI".
        Returns:
        the updated Template
        Throws:
        ValidationException - A validation error which prevents the action from succeeding.
        java.lang.Exception - Any other type of unexpected exception.
        Since:
        3.0
      • updateTemplate

        public Template updateTemplate​(long templateId,
                                       TemplateUpdateRequest request,
                                       java.lang.String auditUser)
                                throws ValidationException,
                                       MissingEntityException,
                                       java.lang.Exception
        Updates the requested template with the supplied configuration.
        Parameters:
        templateId - ID of the template to update
        request - the template to save
        auditUser - Optional user that is marked in audit columns. Defaults to "embeddedAPI".
        Returns:
        the updated Template
        Throws:
        ValidationException - A validation error which prevents the action from succeeding.
        MissingEntityException - If the template with the requested ID does not exist.
        java.lang.Exception - Any other type of unexpected exception.
        Since:
        3.0
      • deleteTemplate

        public Template deleteTemplate​(long templateId,
                                       java.lang.String auditUser)
                                throws ValidationException,
                                       MissingEntityException,
                                       java.lang.Exception
        Deletes the requested template.
        Parameters:
        templateId - ID of the template to delete
        auditUser - Optional user that is marked in audit columns. Defaults to "embeddedAPI".
        Returns:
        the deleted Template
        Throws:
        ValidationException - A validation error which prevents the action from succeeding.
        MissingEntityException - If the template with the requested ID does not exist.
        java.lang.Exception - Any other type of unexpected exception.
        Since:
        3.0
      • listSubscribers

        public SubscriberListing listSubscribers()
                                          throws java.lang.Exception
        Lists configured subscribers.
        Returns:
        the full SubscriberListing
        Throws:
        java.lang.Exception - Any type of unexpected exception.
        Since:
        3.0
      • getSubscriber

        public Subscriber getSubscriber​(long subscriberId)
                                 throws MissingEntityException,
                                        java.lang.Exception
        Loads details on an existing subscriber.
        Parameters:
        subscriberId - ID of the subscriber to load
        Returns:
        the configured Subscriber
        Throws:
        MissingEntityException - If the subscriber with the requested ID does not exist.
        java.lang.Exception - Any other type of unexpected exception.
        Since:
        3.0
      • addSubscriber

        public Subscriber addSubscriber​(SubscriberUpdateRequest request,
                                        java.lang.String auditUser)
                                 throws ValidationException,
                                        java.lang.Exception
        Creates a new subscriber with the supplied configuration.
        Parameters:
        request - the subscriber
        auditUser - Optional user that is marked in audit columns. Defaults to "embeddedAPI".
        Returns:
        the updated Subscriber
        Throws:
        ValidationException - A validation error which prevents the action from succeeding.
        java.lang.Exception - Any other type of unexpected exception.
        Since:
        3.0
      • updateSubscriber

        public Subscriber updateSubscriber​(long subscriberId,
                                           SubscriberUpdateRequest request,
                                           java.lang.String auditUser)
                                    throws ValidationException,
                                           MissingEntityException,
                                           java.lang.Exception
        Updates the requested subscriber with the supplied configuration.
        Parameters:
        subscriberId - ID of the subscriber to update
        request - the subscriber to save
        auditUser - Optional user that is marked in audit columns. Defaults to "embeddedAPI".
        Returns:
        the updated Subscriber
        Throws:
        ValidationException - A validation error which prevents the action from succeeding.
        MissingEntityException - If the subscriber with the requested ID does not exist.
        java.lang.Exception - Any other type of unexpected exception.
        Since:
        3.0
      • deleteSubscriber

        public Subscriber deleteSubscriber​(long subscriberId,
                                           java.lang.String auditUser)
                                    throws ValidationException,
                                           MissingEntityException,
                                           java.lang.Exception
        Deletes the requested subscriber.
        Parameters:
        subscriberId - ID of the subscriber to delete
        auditUser - Optional user that is marked in audit columns. Defaults to "embeddedAPI".
        Returns:
        the deleted Subscriber
        Throws:
        ValidationException - A validation error which prevents the action from succeeding.
        MissingEntityException - If the subscriber with the requested ID does not exist.
        java.lang.Exception - Any other type of unexpected exception.
        Since:
        3.0