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: 25886 $ $Date: 2023-09-12 18:05:57 -0300 (Tue, 12 Sep 2023) $
-
-
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(java.util.List<ISearchQueryFilter> filters)
Put filter for user activity list.void
anonymizeMonitorUser(@NotNull java.lang.String visitorId)
Anonymize the monitor user with the given visitorId.void
deleteMonitorUser(@NotNull java.lang.String visitorId)
Delete the monitor user with the given visitorId.void
deleteMonitorUserActivities(@NotNull java.lang.String visitorId)
Delete the activities of the monitor user with the given visitorId.Response
downloadSegmentationCSV(java.lang.String jsonData, java.util.List<java.lang.String> fields, java.lang.Character columnSeparator)
Returns a CSV file containing the users in a given segmentation list.static org.json.JSONObject
getEventProperties(SessionConfig sessionConfig, ITransaction transaction, java.util.Map<java.lang.String,IMonitorField> fields, java.util.Map<java.lang.String,java.lang.Object> lum_monitor, IMonitorEvent event, boolean removeUser)
Returns the event fields values.Response
getNextActivities(java.lang.String visitorId, java.lang.Integer page, java.lang.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(@NotBlank java.lang.String id)
Return segmentation by id.Response
getSegmentations(java.lang.String name)
Returns the segmentations list.Response
getUserDetails(java.lang.String visitorId)
Returns the user details.void
getUserInfoTXT(java.lang.String visitorId, java.lang.String activities, HttpServletResponse response)
Returns the user details.Response
getUsers(java.lang.String jsonData, @javax.validation.constraints.Min(1L),@javax.validation.constraints.Max(50L) int maxSize, @javax.validation.constraints.Min(1L) 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(java.lang.String body, @NotBlank java.lang.String id)
Quick save operation for segmentation.Response
updateMonitorUserAttributes(@javax.validation.constraints.NotNull long visitorId, java.lang.String saveType, @NotNull java.lang.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") java.lang.String jsonData, @FormParam("maxSize") @DefaultValue("50") @Min(1L) @Max(50L) @javax.validation.constraints.Min(1L),@javax.validation.constraints.Max(50L) int maxSize, @FormParam("startAt") @Min(1L) @DefaultValue("1") @javax.validation.constraints.Min(1L) 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") java.lang.String jsonData, @FormParam("field") java.util.List<java.lang.String> fields, @FormParam("columnSeparator") @DefaultValue(";") java.lang.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") java.lang.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") java.lang.String visitorId, @QueryParam("activities") java.lang.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") java.lang.String visitorId, @PathParam("page") java.lang.Integer page, @QueryParam("firstEventDateMilliseconds") java.lang.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(java.util.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, java.util.Map<java.lang.String,IMonitorField> fields, java.util.Map<java.lang.String,java.lang.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(java.lang.String body, @PathParam("id") @NotBlank @NotBlank java.lang.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 @NotBlank java.lang.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") java.lang.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") @javax.validation.constraints.NotNull long visitorId, @PathParam("saveType") java.lang.String saveType, @NotNull @NotNull java.lang.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") @NotNull java.lang.String visitorId) throws java.lang.Exception
Delete the monitor user with the given visitorId.- Parameters:
visitorId
- the visitor identifier of the monitor user.- Throws:
java.lang.Exception
- Since:
- 12.3.0
-
anonymizeMonitorUser
@Path("/user/{visitorId}/anonymize") @POST public void anonymizeMonitorUser(@NotNull @PathParam("visitorId") @NotNull java.lang.String visitorId) throws java.lang.Exception
Anonymize the monitor user with the given visitorId.- Parameters:
visitorId
- the visitor identifier of the monitor user.- Throws:
java.lang.Exception
- Since:
- 12.3.0
-
deleteMonitorUserActivities
@Path("/user/{visitorId}/activities") @DELETE public void deleteMonitorUserActivities(@NotNull @PathParam("visitorId") @NotNull java.lang.String visitorId) throws java.lang.Exception
Delete the activities of the monitor user with the given visitorId.- Parameters:
visitorId
- the visitor identifier of the monitor user.- Throws:
java.lang.Exception
- Since:
- 12.3.0
-
-