Class UserSegmentationRestAPI
- java.lang.Object
-
- lumis.portal.monitor.impl.AbstractMonitorResource
-
- lumis.service.analytics.usersegmentation.rest.UserSegmentationRestAPI
-
@Path("/lumis/service/analytics/usersegmentation/{si:[a-fA-F0-9]{32}}/rest") public class UserSegmentationRestAPI extends AbstractMonitorResource
User segmentation resource.- Since:
- 11.0.0
- Version:
- $Revision: 24476 $ $Date: 2021-04-28 11:28:23 -0300 (Wed, 28 Apr 2021) $
-
-
Field Summary
-
Fields inherited from class lumis.portal.monitor.impl.AbstractMonitorResource
app
-
-
Constructor Summary
Constructors Constructor Description UserSegmentationRestAPI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
addUsersActivityFilters(List<ISearchQueryFilter> filters)
Put filter for user activity list.void
anonymizeMonitorUser(String visitorId)
Anonymize the monitor user with the given visitorId.void
deleteMonitorUser(String visitorId)
Delete the monitor user with the given visitorId.void
deleteMonitorUserActivities(String visitorId)
Delete the activities of the monitor user with the given visitorId.Response
downloadSegmentationCSV(String jsonData, List<String> fields, Character columnSeparator)
Returns a CSV file containing the users in a given segmentation list.static org.json.JSONObject
getEventProperties(SessionConfig sessionConfig, ITransaction transaction, Map<String,IMonitorField> fields, Map<String,Object> lum_monitor, IMonitorEvent event, boolean removeUser)
Returns the event fields values.Response
getNextActivities(String visitorId, Integer page, Long firstEventDateMilli, lumis.service.analytics.usersegmentation.rest.UserSegmentationRestAPI.NextActivitiesRequest bodyRequest)
Returns only activities of user for be appended in the activities of user.Response
getSegmentation(String id)
Return segmentation by id.Response
getSegmentations(String name)
Returns the segmentations list.Response
getUserDetails(String visitorId)
Returns the user details.void
getUserInfoTXT(String visitorId, String activities, HttpServletResponse response)
Returns the user details.Response
getUsers(String jsonData, int maxSize, int startAt)
Returns the users list based on the given filters.static org.json.JSONObject
parseToJsonObject(UserSegmentation userSegmentation)
Receives a entity and returns a json client format.Response
saveSegmentation(String body, String id)
Quick save operation for segmentation.Response
updateMonitorUserAttributes(long visitorId, String saveType, String reqData)
Update monitor user attributes.-
Methods inherited from class lumis.portal.monitor.impl.AbstractMonitorResource
checkModeManagePermission, checkModeManagePermission, checkModeViewPermission, checkModeViewPermission, checkViewServiceInstancePermission
-
-
-
-
Method Detail
-
getUsers
@Path("/users") @POST @Produces("application/json") public Response getUsers(@FormParam("filters") String jsonData, @FormParam("maxSize") @DefaultValue("50") @Min(1L) @Max(50L) int maxSize, @FormParam("startAt") @Min(1L) @DefaultValue("1") int startAt) throws PortalException
Returns the users list based on the given filters.- Parameters:
jsonData
- the JSON data of applied filters.maxSize
- the maximum number of hits of the query.startAt
- the number of first hit of the query.serviceInstanceId
- the service instance identifier.- Returns:
- the users list based on the given filters.
- Throws:
PortalException
- Since:
- 11.0.0
-
downloadSegmentationCSV
@Path("/users/csv") @POST @Produces("text/csv") public Response downloadSegmentationCSV(@FormParam("filters") String jsonData, @FormParam("field") List<String> fields, @FormParam("columnSeparator") @DefaultValue(";") Character columnSeparator) throws PortalException
Returns a CSV file containing the users in a given segmentation list.- Parameters:
jsonData
- the JSON data of applied filters in the segmentation.fields
- the service instance identifier.- Returns:
- the users list based on the given filters.
- Throws:
PortalException
- Since:
- 11.1.0
-
getUserDetails
@Path("/user/{visitorId}") @GET @Produces("application/json") public Response getUserDetails(@PathParam("visitorId") String visitorId) throws PortalException
Returns the user details.- Parameters:
jsonData
- the JSON data of applied filters.- Returns:
- the users list based on the given filters.
- Throws:
PortalException
- Since:
- 11.0.0
-
getUserInfoTXT
@Path("/user/{visitorId}/user.txt") @GET @Produces("text/plain") public void getUserInfoTXT(@PathParam("visitorId") String visitorId, @QueryParam("activities") String activities, @Context HttpServletResponse response)
Returns the user details.- Parameters:
jsonData
- the JSON data of applied filters.- Since:
- 12.3.0
-
getNextActivities
@Path("/user/{visitorId}/activities/{page}") @POST @Produces("application/json") @Consumes("application/json") public Response getNextActivities(@PathParam("visitorId") String visitorId, @PathParam("page") Integer page, @QueryParam("firstEventDateMilliseconds") Long firstEventDateMilli, lumis.service.analytics.usersegmentation.rest.UserSegmentationRestAPI.NextActivitiesRequest bodyRequest) throws PortalException
Returns only activities of user for be appended in the activities of user.- Parameters:
visitorId
- the visitor user identifier.page
- the page of pagination.firstEventDateMilli
- the oldest event date time in the top of event activities list. It avoids to newest events mess up the pagination.- Returns:
- the next block of activities.
- Throws:
PortalException
- Since:
- 12.1.0
-
addUsersActivityFilters
public static void addUsersActivityFilters(List<ISearchQueryFilter> filters) throws PortalObjectNotFoundException
Put filter for user activity list. We have this list in user segmentation and event analytics graph.- Parameters:
filters
- the filter list to receive more filters.- Throws:
PortalObjectNotFoundException
- Since:
- 12.2.0
-
getEventProperties
public static org.json.JSONObject getEventProperties(SessionConfig sessionConfig, ITransaction transaction, Map<String,IMonitorField> fields, Map<String,Object> lum_monitor, IMonitorEvent event, boolean removeUser) throws PortalException, ManagerException
Returns the event fields values.- Parameters:
sessionConfig
- the current session.transaction
- the transaction.fields
- the fields.lum_monitor
- the map with values.event
- the events.removeUser
- choose if will remove lum_user from properties list.- Returns:
- the event fields values.
- Throws:
PortalException
ManagerException
- Since:
- 14.0.0
-
saveSegmentation
@Path("/segmentation/{id:[a-fA-F0-9]{32}}") @PUT @Consumes("application/json") @Produces("application/json") public Response saveSegmentation(String body, @PathParam("id") @NotBlank String id)
Quick save operation for segmentation.- Parameters:
segmentationFilter
- the segmentation filter.id
- the segmentation identifier.- Returns:
- the response.
- Throws:
PortalException
- Since:
- 11.1.0
-
getSegmentation
@Path("/segmentation/{id:[a-fA-F0-9]{32}}") @GET @Consumes("application/json") @Produces("application/json") public Response getSegmentation(@PathParam("id") @NotBlank String id)
Return segmentation by id.- Parameters:
id
- the segmentation identifier.- Returns:
- the response.
- Since:
- 11.1.0
-
parseToJsonObject
public static org.json.JSONObject parseToJsonObject(UserSegmentation userSegmentation)
Receives a entity and returns a json client format.- Parameters:
userSegmentation
- the entity.- Returns:
- the json object.
- Since:
- 11.1.0
-
getSegmentations
@Path("/segmentations") @GET @Produces("application/json") public Response getSegmentations(@QueryParam("name") String name) throws PortalException
Returns the segmentations list.- Returns:
- the response.
- Throws:
PortalException
- Since:
- 11.1.0
-
updateMonitorUserAttributes
@Path("/user/{visitorId:\\d+}/attributes/{saveType:(un)?trusted}") @POST @Consumes("application/json") public Response updateMonitorUserAttributes(@NotNull @PathParam("visitorId") long visitorId, @PathParam("saveType") String saveType, @NotNull String reqData) throws PortalException
Update monitor user attributes. Wrapper forMonitorV1Resource.updateMonitorUser(String, String)
.- Parameters:
visitorId
- the monitor user visitor identifierreqData
- the requested data- Returns:
- the response
- Throws:
PortalException
- Since:
- 12.0.0
-
deleteMonitorUser
@Path("/user/{visitorId}") @DELETE public void deleteMonitorUser(@NotNull @PathParam("visitorId") String visitorId) throws Exception
Delete the monitor user with the given visitorId.- Parameters:
visitorId
- the visitor identifier of the monitor user.- Throws:
Exception
- Since:
- 12.3.0
-
anonymizeMonitorUser
@Path("/user/{visitorId}/anonymize") @POST public void anonymizeMonitorUser(@NotNull @PathParam("visitorId") String visitorId) throws Exception
Anonymize the monitor user with the given visitorId.- Parameters:
visitorId
- the visitor identifier of the monitor user.- Throws:
Exception
- Since:
- 12.3.0
-
deleteMonitorUserActivities
@Path("/user/{visitorId}/activities") @DELETE public void deleteMonitorUserActivities(@NotNull @PathParam("visitorId") String visitorId) throws Exception
Delete the activities of the monitor user with the given visitorId.- Parameters:
visitorId
- the visitor identifier of the monitor user.- Throws:
Exception
- Since:
- 12.3.0
-
-