Interface NotificationService

All Superinterfaces:
com.appiancorp.services.ContextSensitiveService, Service

@Deprecated public interface NotificationService extends com.appiancorp.services.ContextSensitiveService
Deprecated.
The Notification functionality will be removed in a future release. Use the Tempo Interface for similar functionality.
Defines methods for retrieving application specific notfications, configuring notifications and sending notifications of various types.

Notifications may be sent to users and groups, and can be configured to be sent to email or to the portal application, or both. The frequency with which notifications are sent to email, or the length of time that notifications persist in the portal application, are also configurable.

Methods of service classes can all throw the unchecked exception ServiceException if any system-level error (for example, server failure) occurs, and will in general throw a checked exception (InvalidXXXException) when an entity to be retrieved is inaccessible, instead of returning null. All checked exceptions extend AppianException.

All API's that use Application ID and Notification Type ID should only use valid ID's that can be obtained by making a call to getApplications()

It may be necessary to retrieve a subset of results as opposed to an entire collection, and also to sort the subset by some property of the returned object. "Paging" methods which return a ResultPage are provided in certain instances for this purpose. The ResultPage will contain the sorted subset of results (via Result.getResults()), and the total number of items in the available result set (via ResultPage.getAvailableItems()).

It may also be necessary to retrieve some results, even if all results cannot be retrieved (for instance, some of the entities corresponding to a list of entity IDs may no longer exist). Methods which return a ResultList are provided for this purpose. The Result.getResults() method in this case will return all results which can be retrieved. In addition, there will be a list of result codes (ResultList.getResultCodes()) that represent the successful retrieval of an entity, or, if the entity could not be retrieved, the reason for the failure. See the CODE_XXX constants in ResultList for details.

See Also:
  • Field Details

    • getApplications$UPDATES

      static final boolean getApplications$UPDATES
      Deprecated.
      See Also:
    • getNotificationCustomAttributes$UPDATES

      static final boolean getNotificationCustomAttributes$UPDATES
      Deprecated.
      See Also:
    • getMedia$UPDATES

      static final boolean getMedia$UPDATES
      Deprecated.
      See Also:
    • getMediaForType$UPDATES

      static final boolean getMediaForType$UPDATES
      Deprecated.
      See Also:
    • getTypePrefsForUser$UPDATES

      static final boolean getTypePrefsForUser$UPDATES
      Deprecated.
      See Also:
    • saveNotificationRuleForUser$UPDATES

      static final boolean saveNotificationRuleForUser$UPDATES
      Deprecated.
      See Also:
    • notify$UPDATES

      static final boolean notify$UPDATES
      Deprecated.
      See Also:
    • getApplicationsPaging$UPDATES

      static final boolean getApplicationsPaging$UPDATES
      Deprecated.
      See Also:
    • getNotificationCustomAttributesPaging$UPDATES

      static final boolean getNotificationCustomAttributesPaging$UPDATES
      Deprecated.
      See Also:
    • getMediaPaging$UPDATES

      static final boolean getMediaPaging$UPDATES
      Deprecated.
      See Also:
    • getMediaForTypePaging$UPDATES

      static final boolean getMediaForTypePaging$UPDATES
      Deprecated.
      See Also:
    • getTypePrefsForUserPaging$UPDATES

      static final boolean getTypePrefsForUserPaging$UPDATES
      Deprecated.
      See Also:
    • getApplicationName$UPDATES

      static final boolean getApplicationName$UPDATES
      Deprecated.
      See Also:
    • getWorkspace$UPDATES

      static final boolean getWorkspace$UPDATES
      Deprecated.
      See Also:
    • getDefaultFormat$UPDATES

      static final boolean getDefaultFormat$UPDATES
      Deprecated.
      See Also:
    • setDefaultFormat$UPDATES

      static final boolean setDefaultFormat$UPDATES
      Deprecated.
      See Also:
  • Method Details

    • getApplications

      @Deprecated Application[] getApplications()
      Get all registered Application objects.
      Returns:
      an array of Application with names, IDs and notification types for the application. The notification types and application names are listed in PortalNotificationService.
      Throws:
      ServiceException - if any system-level error occurs
    • getNotificationCustomAttributes

      @Deprecated Attribute[] getNotificationCustomAttributes(int typeId_)
      Gets custom Attribute objects for specified Notification type.
      Parameters:
      typeId_ - ID of the Notification type.
      Returns:
      an array of Attribute objects, each of which contains the parameters for the specified Notification type. See PortalNotificationService.notify(java.lang.String[], java.lang.Long[], java.lang.String, java.lang.String, java.util.Map) for the list of custom attributes per notification type. Each attribute will have its label field populated with the appropriate value.
      Throws:
      ServiceException - if any system-level error occurs
    • getMedia

      @Deprecated Medium[] getMedia()
      Gets the media to which Notifications can be sent.
      Returns:
      an array of Medium, which contains the medium name, id and options. Currently the generic options are not used. Timing is currently the only specific option, i.e. the interval of time to wait until the Notification is sent which can be immediately, hourly, daily, weekly.
      Throws:
      ServiceException - if any system-level error occurs
    • getMediaForType

      @Deprecated Medium[] getMediaForType(int typeId_)
      Gets the media to which Notifications of the specified type can be sent.
      Parameters:
      typeId_ - ID of the Notification type
      Returns:
      an array of Medium, which contains the medium name, ID and options. Currently the generic options are not used. Timing is currently the only specific option, i.e. the interval of time to wait until the notification is sent, which can be immediately, hourly, daily, weekly.
      Throws:
      ServiceException - if any system-level error occurs
    • getTypePrefsForUser

      @Deprecated NotificationRule[] getTypePrefsForUser(String user_, int appId_, int typeId_)
      Gets the user preferences for the Notification type
      Parameters:
      user_ - the username of the User whose preferences are to be retrieved
      appId_ - the ID of the Application of the Notification type
      typeId_ - the ID of the Notification type, which will be unique across applications
      Returns:
      NotificationRule with the Application ID and name, the Notification type ID and name, the Medium ID and name, and the conditions. The "conditions" is a double array of strings, where every row is a String[3] with comparison operator id, attribute ID and value against which the Attribute value will be compared
      Throws:
      ServiceException - if any system-level error occurs
    • saveNotificationRuleForUser

      void saveNotificationRuleForUser(String user_, int type_, int[] media_, String[] conditions_, String[] settings_)
      Deprecated.
      Saves the Notification rules for the given user
      Parameters:
      user_ - the username of the user
      type_ - the ID of the Notification type.
      media_ - the IDs of the media types. Use getMedia() for valid types. If conditions or settings differ in length from media, then media determines the length of conditions and settings used.
      conditions_ - Each element in the string array will be comma- separated triplets of comparison operator IDs, attribute ID, and the values to compare against. If no conditions are being set, an empty array should be passed. To see available attribute IDs and operator IDs use getNotificationCustomAttributesPaging(int, int, int, Integer, Integer) and browse the returned Attribute object.
      settings_ - the time intervals at which all Notification will be sent. If no time intervals are being set, an empty array should be passed. The array size depends on the number of rules (see NotificationRule) for given notification type. Each element of an array is a string of comma separated triplet: ",type,parameter". The first value is always empty. The type is one of constant values of OPTION_XXX in com.appiancorp.ap2.ns.Option. If the Notification media type is Portal the parameter specifies the number of days for the message to persist. If the Notification media type is Email the parameter specifies the timing of the email - 1: Immediate, 2: Hourly Bulk Email, 3: Daily Bulk Email, 4: Weekly Bulk Email.
      Throws:
      ServiceException - if any system-level error occurs
    • saveNotificationRuleForUser

      void saveNotificationRuleForUser(String user_, int type_, int[] media_, String[] conditions_, String[] settings_, List<Integer> hiddenMedia)
      Deprecated.
    • notify

      @Deprecated void notify(String[] users_, Long[] groups_, String appName_, String ntfType_, Map attributes_) throws InvalidNotificationTypeException
      Send a notification to specific users and groups
      Parameters:
      users_ - the usernames of those to be notified. If no users are to be notified, this value should be an empty String array, not null.
      groups_ - the groupIds of those to be notified. If no groups are to be notified, this value should be an empty String array, not null.
      appName_ - the Application name of the Notification. See the XXX_NOTIFICATION_APPLICATION constants in PortalNotificationService for valid values
      ntfType_ - the name of the Notification type. See the XXX_NOTIFICATION_TYPE constants in PortalNotificationService for valid values
      attributes_ - the attributes of the notification. The map keys correspond to Attribute labels. For example, for the PortalNotificationService.COLLABORATION_SEND_LINK_NOTIFICATION_TYPE, a key in the attribute map would be "sender" The values of the keys are the values to be displayed in the Notification (eg. the sender's username).
      Throws:
      InvalidNotificationException - if the Notification does not exist
      InvalidNotificationTypeException - if an invalid Notification type is specified
      ServiceException - if any system-level error occurs
      See Also:
    • getApplicationsPaging

      ResultPage getApplicationsPaging(int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_)
      Deprecated.
      Returns all registered Application objects
      Parameters:
      startPosition_ - the index into the collection of total results at which to start. Negative numbers are treated as zeros.
      batchSize_ - the number of results to return. Use Constants.COUNT_ALL to return the entire collection, but this is STRONGLY discouraged.
      sortProperty_ - the property by which the results will be sorted. This is one of the SORT_BY_XXX constants in Application.
      sortOrder_ - The order in which to sort the returned Application objects. This is either Constants.SORT_ORDER_ASCENDING or Constants.SORT_ORDER_DESCENDING
      Returns:
      a ResultPage containing an array of Application objects
      Throws:
      ServiceException - if any system-level error occurs
    • getNotificationCustomAttributesPaging

      ResultPage getNotificationCustomAttributesPaging(int typeId_, int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_)
      Deprecated.
      Get Notification custom attribute values
      Parameters:
      typeId_ - ID of the Notification type.
      startPosition_ - the index into the collection of total results at which to start. Negative numbers are treated as zeros.
      batchSize_ - the number of results to return. Use Constants.COUNT_ALL to return the entire collection, but this is STRONGLY discouraged.
      sortProperty_ - the property by which the results will be sorted. This is one of the SORT_BY_XXX constants in Attribute.
      sortOrder_ - The order in which to sort the returned Attribute objects. This is either Constants.SORT_ORDER_ASCENDING or Constants.SORT_ORDER_DESCENDING
      Returns:
      a ResultPage which contains the array of Attribute objects
      Throws:
      ServiceException - if any system-level error occurs
    • getMediaPaging

      ResultPage getMediaPaging(int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_)
      Deprecated.
      Gets the media to which Notifications can be sent.
      Parameters:
      startPosition_ - the index into the collection of total results at which to start. Negative numbers are treated as zeros.
      batchSize_ - the number of results to return. Use Constants.COUNT_ALL to return the entire collection, but this is STRONGLY discouraged.
      sortProperty_ - the property by which the results will be sorted. This is one of the SORT_BY_XXX constants in Medium.
      sortOrder_ - The order in which to sort the returned Medium objects. This is either Constants.SORT_ORDER_ASCENDING or Constants.SORT_ORDER_DESCENDING
      Returns:
      a ResultPage which contains the array of Medium objects Currently the generic options are not used, and Timing is the only specific option, i.e. the interval of time to wait until the Notification is sent which can be immediately, hourly, daily, weekly.
      Throws:
      ServiceException - if any system-level error occurs
    • getMediaForTypePaging

      ResultPage getMediaForTypePaging(int typeId_, int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_)
      Deprecated.
      Gets the media to which Notifications of the specified type can be sent.
      Parameters:
      typeId_ - ID of the Notification type
      startPosition_ - the index into the collection of total results at which to start. Negative numbers are treated as zeros.
      batchSize_ - the number of results to return. Use Constants.COUNT_ALL to return the entire collection, but this is STRONGLY discouraged.
      sortProperty_ - the property by which the results will be sorted. This is one of the SORT_BY_XXX constants in Medium.
      sortOrder_ - The order in which to sort the returned Medium objects. This is either Constants.SORT_ORDER_ASCENDING or Constants.SORT_ORDER_DESCENDING
      Returns:
      a ResultPage which contains the array of Medium, which contains the medium name, id and options. Currently the generic options are not used, and Timing is the only specific option, i.e. the interval of time to wait until the Notification is sent which can be immediately, hourly, daily, weekly.
      Throws:
      ServiceException - if any system-level error occurs
    • getTypePrefsForUserPaging

      ResultPage getTypePrefsForUserPaging(String user_, int appId_, int typeId_, int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_)
      Deprecated.
      Gets the user preferences for the Notification type
      Parameters:
      user_ - the username of the user whose preferences are to be retrieved
      appId_ - ID of the Application for the Notification type
      typeId_ - ID of the Notification type, which will be unique across all Application objects
      startPosition_ - the index into the collection of total results at which to start. Negative numbers are treated as zeros.
      batchSize_ - the number of results to return. Use Constants.COUNT_ALL to return the entire collection, but this is STRONGLY discouraged.
      sortProperty_ - the property by which the results will be sorted. This is one of the SORT_BY_XXX constants in NotificationRule.
      sortOrder_ - The order in which to sort the returned UserPreferences objects. This is either Constants.SORT_ORDER_ASCENDING or Constants.SORT_ORDER_DESCENDING
      Returns:
      a ResultPage containing an array of NotificationRule with the Application ID and name, the Notification type ID and name, the medium ID and name, and the conditions. The conditions is a double array of strings, where every row is a String[3] with comparison operator id, attribute id and value against which the Attribute value will be compared
      Throws:
      ServiceException - if any system-level error occurs
    • getApplicationName

      String getApplicationName()
      Deprecated.
      Gets the name of the application on which this service is running.
      Returns:
      the name of the Application
      Throws:
      ServiceException - if any system-level error occurs
    • getWorkspace

      String[] getWorkspace()
      Deprecated.
      Gets the current memory profile for the workspace.
      Returns:
      array of Strings of length 4 describing memory usage:
      • [0]Used - Memory Used by the Server so far for storage
      • [1]Allocated - Memory allocated for use. Often if a large data item was allocated by a server and subsequently freed, this value will be large compared to "Used". If nearly all memory allocated is in use, this value will be close to (but always higher than) "Used"
      • [2]Mapped - is the space used by memory-mapped files
      • [3]Available - is the total available memory for the Server process
      Note: All usage statistics are in Bytes.
      Throws:
      ServiceException - if any system-level error occurs
    • getDefaultFormat

      Deprecated.
      Since i18n, the notifications server no longer formats dates (the raw timestamps are sent to the JSPs), so no formats should be set on the server.
      Parameters:
      name_ - A string identifying the type of display format, one of: "date", "time", or "timezone".
      Returns:
      Returns the display format for the given format name.
      Throws:
      InvalidParameterException - if the name_ is not recognized
      NullPointerException - if the name_ is null
    • setDefaultFormat

      @Deprecated void setDefaultFormat(String name_, String format_) throws InvalidParameterException, NullPointerException
      Deprecated.
      Since i18n, the notifications server no longer formats dates (the raw timestamps are sent to the JSPs), therefore this method no longer affects the formatting.
      Parameters:
      name_ - A string identifying the type of display format, one of: "date", "time", or "timezone".
      format_ - The display format to use for the given format name.
      Throws:
      InvalidParameterException - if the name_ is not recognized
      NullPointerException - if the name_ or format_ is null