Package com.carfey.ops.api.embedded
Class NotificationManager
- java.lang.Object
-
- com.carfey.ops.api.embedded.AbstractAPIManager
-
- com.carfey.ops.api.embedded.NotificationManager
-
public class NotificationManager extends AbstractAPIManager
Class to manage notifications, notification subscriptions and templates using the Obsidian public embedded API. SeeAbstractAPIManagerfor 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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.carfey.ops.api.embedded.AbstractAPIManager
AbstractAPIManager.ActionCallable
-
-
Constructor Summary
Constructors Constructor Description NotificationManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SubscriberaddSubscriber(SubscriberUpdateRequest request, java.lang.String auditUser)Creates a new subscriber with the supplied configuration.TemplateaddTemplate(TemplateUpdateRequest request, java.lang.String auditUser)Creates a new template with the supplied configuration.SubscriberdeleteSubscriber(long subscriberId, java.lang.String auditUser)Deletes the requested subscriber.TemplatedeleteTemplate(long templateId, java.lang.String auditUser)Deletes the requested template.NotificationgetNotification(long id)Describe the notification with the supplied ID.SubscribergetSubscriber(long subscriberId)Loads details on an existing subscriber.TemplategetTemplate(long templateId)Loads details on an existing template.NotificationListinglistNotifications(NotificationListingParameters parameters)Searches/lists notifications which were triggered for events.SubscriberListinglistSubscribers()Lists configured subscribers.TemplateListinglistTemplates()Lists configured templates.SubscriberupdateSubscriber(long subscriberId, SubscriberUpdateRequest request, java.lang.String auditUser)Updates the requested subscriber with the supplied configuration.TemplateupdateTemplate(long templateId, TemplateUpdateRequest request, java.lang.String auditUser)Updates the requested template with the supplied configuration.-
Methods inherited from class com.carfey.ops.api.embedded.AbstractAPIManager
addParameter, runApiTarget, validateRequired, withTransaction
-
-
-
-
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
NotificationListingmatching 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
Notificationwith 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 templateauditUser- 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 updaterequest- the template to saveauditUser- 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 deleteauditUser- 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 subscriberauditUser- 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 updaterequest- the subscriber to saveauditUser- 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 deleteauditUser- 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
-
-