NotificationsServiceImpl (gCube Notifications Portlet 1.4.0-SNAPSHOT API)
Date: 2015-11-19

org.gcube.portlets.user.notifications.server

## Class NotificationsServiceImpl

- java.lang.Object
- - javax.servlet.GenericServlet
  - - javax.servlet.http.HttpServlet
    - - com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
      - - com.google.gwt.user.server.rpc.RemoteServiceServlet
        - - org.gcube.portlets.user.notifications.server.NotificationsServiceImpl

- All Implemented Interfaces:
    com.google.gwt.user.client.rpc.RemoteService, com.google.gwt.user.server.rpc.SerializationPolicyProvider, Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, NotificationsService

      public class NotificationsServiceImpl
      extends com.google.gwt.user.server.rpc.RemoteServiceServlet
      implements NotificationsService

  The server side implementation of the RPC service.
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet

      `perThreadRequest, perThreadResponse`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NotificationsServiceImpl()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()`
    `String` | `getDevelopmentUser()` set the user in development mode
    `org.gcube.portal.databook.shared.UserInfo` | `getUserInfo()`
    `LinkedHashMap<String,ArrayList<NotificationPreference>>` | `getUserNotificationPreferences()`
    `HashMap<Date,ArrayList<org.gcube.portal.databook.shared.Notification>>` | `getUserNotifications()` returns the notifications separated per day
    `HashMap<Date,ArrayList<org.gcube.portal.databook.shared.Notification>>` | `getUserNotificationsByRange(int from, int quantity)` returns the notifications in the range separated per day
    `void` | `init()` connect to cassandra at startup
    `boolean` | `setAllUserNotificationsRead()` this sets all the notifications for this user read
    `boolean` | `setUserNotificationPreferences(Map<org.gcube.portal.databook.shared.NotificationType,org.gcube.portal.databook.shared.NotificationChannelType[]> enabledChannels)`

    - ### Methods inherited from class com.google.gwt.user.server.rpc.RemoteServiceServlet

      `checkPermutationStrongName, doGetSerializationPolicy, getCodeServerPolicyUrl, getRequestModuleBasePath, getSerializationPolicy, init, loadPolicyFromCodeServer, onAfterResponseSerialized, onBeforeRequestDeserialized, processCall, processCall, processPost, shouldCompressResponse`

    - ### Methods inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet

      `doPost, doUnexpectedFailure, getPermutationStrongName, getThreadLocalRequest, getThreadLocalResponse, onAfterRequestDeserialized, readContent`

    - ### Methods inherited from class javax.servlet.http.HttpServlet

      `doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service`

    - ### Methods inherited from class javax.servlet.GenericServlet

      `getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NotificationsServiceImpl

          public NotificationsServiceImpl()

  - ### Method Detail

    - #### init

          public void init()

      connect to cassandra at startup
      Overrides:
        `init` in class `javax.servlet.GenericServlet`

    - #### destroy

          public void destroy()

      Specified by:
        `destroy` in interface `javax.servlet.Servlet`
      Overrides:
        `destroy` in class `javax.servlet.GenericServlet`

    - #### getDevelopmentUser

          public String getDevelopmentUser()

      set the user in development mode
      Returns:

    - #### getUserInfo

          public org.gcube.portal.databook.shared.UserInfo getUserInfo()

      Specified by:
        `getUserInfo` in interface `NotificationsService`

    - #### getUserNotifications

          public HashMap<Date,ArrayList<org.gcube.portal.databook.shared.Notification>> getUserNotifications()

      returns the notifications separated per day
      Specified by:
        `getUserNotifications` in interface `NotificationsService`

    - #### getUserNotificationsByRange

          public HashMap<Date,ArrayList<org.gcube.portal.databook.shared.Notification>> getUserNotificationsByRange(int from,
                                                                                                           int quantity)

      returns the notifications in the range separated per day
      Specified by:
        `getUserNotificationsByRange` in interface `NotificationsService`

    - #### setAllUserNotificationsRead

          public boolean setAllUserNotificationsRead()

      this sets all the notifications for this user read
      Specified by:
        `setAllUserNotificationsRead` in interface `NotificationsService`

    - #### getUserNotificationPreferences

          public LinkedHashMap<String,ArrayList<NotificationPreference>> getUserNotificationPreferences()

      Specified by:
        `getUserNotificationPreferences` in interface `NotificationsService`

    - #### setUserNotificationPreferences

          public boolean setUserNotificationPreferences(Map<org.gcube.portal.databook.shared.NotificationType,org.gcube.portal.databook.shared.NotificationChannelType[]> enabledChannels)

      Specified by:
        `setUserNotificationPreferences` in interface `NotificationsService`

Copyright © 2015. All Rights Reserved.