public abstract class AbstractJdbcNotificationService extends AbstractNotificationService
INotificationService implementations that pull notifications from JDBC
data sources using common patterns.usernameFinder| Constructor and Description |
|---|
AbstractJdbcNotificationService() |
| Modifier and Type | Method and Description |
|---|---|
org.jasig.portlet.notice.NotificationResponse |
executeQuery(java.lang.String username,
org.springframework.jdbc.core.namedparam.SqlParameterSource sqlParameterSource,
org.springframework.jdbc.core.ResultSetExtractor<org.jasig.portlet.notice.NotificationResponse> resultSetExtractor) |
org.jasig.portlet.notice.NotificationResponse |
fetch(javax.servlet.http.HttpServletRequest request)
Returns an empty collection and logs the event.
|
org.jasig.portlet.notice.NotificationResponse |
fetch(javax.portlet.PortletRequest req)
Provide the current collection of Notifications information for the user
represented by the
PortletRequest. |
org.jasig.portlet.notice.NotificationResponse |
fetchFromCacheOrSupplier(java.lang.String username,
java.util.function.Supplier<org.jasig.portlet.notice.NotificationResponse> supplier) |
protected abstract org.springframework.jdbc.core.ResultSetExtractor<org.jasig.portlet.notice.NotificationResponse> |
getResultSetExtractor(javax.servlet.http.HttpServletRequest request)
Subclasses must override this method to provide a custom
ResultSetExtractor. |
protected abstract org.springframework.jdbc.core.ResultSetExtractor<org.jasig.portlet.notice.NotificationResponse> |
getResultSetExtractor(javax.portlet.PortletRequest req)
Subclasses must override this method to provide a custom
ResultSetExtractor. |
protected org.springframework.jdbc.core.namedparam.SqlParameterSource |
getSqlParameterSource(javax.servlet.http.HttpServletRequest request)
General-purpose implementation of this method that wraps the OIDC Id token in an
SqlParameterSource. |
protected org.springframework.jdbc.core.namedparam.SqlParameterSource |
getSqlParameterSource(javax.portlet.PortletRequest req)
General-purpose implementation of this method that wraps the
PortletRequest.USER_INFO
map in a MapSqlParameterSource. |
void |
init() |
void |
invoke(javax.portlet.ActionRequest req,
javax.portlet.ActionResponse res,
boolean refresh)
Subclasses of
AbstractNotificationService that need to perform
some logic within this method should override it. |
void |
setCache(net.sf.ehcache.Cache cache) |
void |
setDataSource(javax.sql.DataSource dataSource) |
void |
setRequiredParameters(java.util.Set<java.lang.String> requiredParameters)
Implementors may may call this method to specify parameters that must be present in
the
SqlParameterSource. |
void |
setSql(java.lang.String sql) |
collect, createServiceUserWindowSpecificCacheKey, getName, isValid, prepareErrorResponse, setNamepublic void setDataSource(javax.sql.DataSource dataSource)
public void setSql(java.lang.String sql)
public void setCache(net.sf.ehcache.Cache cache)
public void setRequiredParameters(java.util.Set<java.lang.String> requiredParameters)
SqlParameterSource.@PostConstruct public void init()
public void invoke(javax.portlet.ActionRequest req,
javax.portlet.ActionResponse res,
boolean refresh)
AbstractNotificationServiceAbstractNotificationService that need to perform
some logic within this method should override it.invoke in interface INotificationServiceinvoke in class AbstractNotificationServicereq - The current ActionRequestres - The current ActionResponserefresh - If true, the service should expire any cached datapublic org.jasig.portlet.notice.NotificationResponse fetch(javax.portlet.PortletRequest req)
INotificationServicePortletRequest.req - The PortletRequestpublic org.jasig.portlet.notice.NotificationResponse fetch(javax.servlet.http.HttpServletRequest request)
AbstractNotificationServiceINotificationService should override this method. The log entries this method
produces are an indication that the service subclass is not ready for the post-Portlet API
world.fetch in interface INotificationServicefetch in class AbstractNotificationServicerequest - The REST requestprotected org.springframework.jdbc.core.namedparam.SqlParameterSource getSqlParameterSource(javax.portlet.PortletRequest req)
PortletRequest.USER_INFO
map in a MapSqlParameterSource. Subclasses may override this method to
provide a custom SqlParameterSource when needed.protected org.springframework.jdbc.core.namedparam.SqlParameterSource getSqlParameterSource(javax.servlet.http.HttpServletRequest request)
SqlParameterSource. Subclasses may override this method to provide a custom
SqlParameterSource when needed.protected abstract org.springframework.jdbc.core.ResultSetExtractor<org.jasig.portlet.notice.NotificationResponse> getResultSetExtractor(javax.portlet.PortletRequest req)
ResultSetExtractor.protected abstract org.springframework.jdbc.core.ResultSetExtractor<org.jasig.portlet.notice.NotificationResponse> getResultSetExtractor(javax.servlet.http.HttpServletRequest request)
ResultSetExtractor.public org.jasig.portlet.notice.NotificationResponse fetchFromCacheOrSupplier(java.lang.String username,
java.util.function.Supplier<org.jasig.portlet.notice.NotificationResponse> supplier)
public org.jasig.portlet.notice.NotificationResponse executeQuery(java.lang.String username,
org.springframework.jdbc.core.namedparam.SqlParameterSource sqlParameterSource,
org.springframework.jdbc.core.ResultSetExtractor<org.jasig.portlet.notice.NotificationResponse> resultSetExtractor)