public abstract class AbstractAnyUserUpdateService<U extends User,E,S> extends SecurableService
User
(Logged in or Guest) supports generic user related methods.
See SecurableService.query(String, Object)
and query(String, String, String, String)
.Modifier and Type | Field and Description |
---|---|
protected Map<String,SoftReference<Map>> |
userActivity |
applicationContext, CACHE, NO_CACHE, request, response
Constructor and Description |
---|
AbstractAnyUserUpdateService() |
AbstractAnyUserUpdateService(boolean checkAuthFiltered) |
Modifier and Type | Method and Description |
---|---|
void |
cleanRedundantSessions(Set<String> keepSessionIds,
S session)
Opportunity to clean redundant sessions
|
protected abstract S |
getSession() |
Map<String,Map> |
getUserActivityMap(S session) |
protected abstract UserSessionAdapter<?,S,U> |
getUserSessionAdapter() |
void |
ping(String action)
A way the User-Agent / Browser can let the server know the user is active and update its last active state
|
Object |
query(String contextNameId,
String actionId,
String json,
String jsonBody)
Example: http://host/services/anyuser/userAction/all/contactUs?p={'fname':'xxxx','lname':'yyyy'...} http://host/services/anyuser/userAction/all/contactUs?p={'fname':'xxxx','lname':'yyyy'...} Note: This method supports JSON data as a query param and a form param. |
Object |
queryWithinContext(String contextNameId,
String actionId,
String json,
String jsonBody)
Same as
query(String, String, String, String) except that in addition to the Query, the user object is passed automatically
in session to the Array or Map of parameters. |
protected void |
setPingUserData(Map<String,Object> activityMapForSession,
S session) |
checkAuthFilterInvoked, filter, query
filter, getCacheDef, getTestString, query
protected Map<String,SoftReference<Map>> userActivity
public AbstractAnyUserUpdateService()
public AbstractAnyUserUpdateService(boolean checkAuthFiltered)
protected abstract UserSessionAdapter<?,S,U> getUserSessionAdapter()
protected abstract S getSession()
@GET @Path(value="ping") @Consumes(value="text/plain") @Produces(value="text/plain") public void ping(@QueryParam(value="action") String action) throws Exception
action
- as the last action details passed from the User AgentException
@POST @Path(value="userAction/{contextNameId}/{actionId}") @Produces(value="application/json") public Object query(@PathParam(value="contextNameId") String contextNameId, @PathParam(value="actionId") String actionId, @QueryParam(value="p") String json, @FormParam(value="f") String jsonBody) throws Exception
contextNameId
- as String; a classification for the manner in which the Query is called. Can allow for better and custom security or context related aspects.actionId
- as String (should match a Spring Transformer bean id that accepts an Object array as params)p
- as Query Param JSON Object String that is converted into a Map or Array of variables @nullable truef
- as Form Param JSON Object String that is converted into a Map or Array of variables @nullable trueException
@POST @Path(value="userContextAction/{contextNameId}/{actionId}") @Produces(value="application/json") public Object queryWithinContext(@PathParam(value="contextNameId") String contextNameId, @PathParam(value="actionId") String actionId, @QueryParam(value="p") String json, @FormParam(value="f") String jsonBody) throws Exception
query(String, String, String, String)
except that in addition to the Query, the user object is passed automatically
in session to the Array or Map of parameters. This method also adds a User
object as sessionUser in the Map or @ the end of the array orcontextNameId
- as String; a classification for the manner in which the Query is called. Can allow for better and custom security or context related aspects.actionId
- as String (should match a Spring Transformer bean id that accepts an Object array as params)p
- as Query Param JSON Object String that is converted into a Map or Array of variables @nullable truef
- as Form Param JSON Object String that is converted into a Map or Array of variables @nullable trueException
public Map<String,Map> getUserActivityMap(S session) throws AuthorizationException
session
- Session demanding the infoAuthorizationException
public void cleanRedundantSessions(Set<String> keepSessionIds, S session) throws AuthorizationException
AuthorizationException
Copyright © 2018. All rights reserved.