Interface IUserSegmentationManagerSPI

    • Method Detail

      • saveSegmentation

        String saveSegmentation​(String name,
                                String serviceInstanceId,
                                org.json.JSONObject segmentationFilter)
                         throws PortalException
        Save the given segmentation and returns the identifier of the segmentation added or updated. The affected segmentation will not have an attached group.
        Parameters:
        name - the segmentation name.
        serviceInstanceId - the service instance identifier.
        segmentationFilter - the segmentation filter.
        Returns:
        the identifier of the segmentation added or updated.
        Throws:
        PortalException
        Since:
        11.2.0
      • updateSegmentation

        IUserSegmentation updateSegmentation​(String id,
                                             String serviceInstanceId,
                                             org.json.JSONObject filter)
                                      throws PortalException
        Updates the given segmentation with the given filters. Does not change anything about an attached group.
        Parameters:
        id - the segmentation identifier.
        serviceInstanceId - the service instance identifier.
        filter - the segmentation filter.
        Returns:
        updated entity.
        Throws:
        PortalException
        Since:
        11.2.0
      • deleteSegmentations

        void deleteSegmentations​(Collection<String> ids,
                                 String serviceInstanceId)
                          throws PortalException
        Delete the given segmentations.
        Parameters:
        ids - the segmentation identifiers.
        serviceInstanceId - the service instance identifier.
        Throws:
        PortalException
        Since:
        11.2.0
      • deleteSegmentationsByServiceInstanceId

        void deleteSegmentationsByServiceInstanceId​(String serviceInstanceId)
                                             throws PortalException
        Deletes all segmentations of the given service instance.
        Parameters:
        serviceInstanceId - the service instance identifier.
        Throws:
        PortalException
        Since:
        11.2.0
      • findByServiceInstanceAndLikeName

        List<IUserSegmentation> findByServiceInstanceAndLikeName​(String name,
                                                                 String serviceInstanceId)
                                                          throws PortalException
        Returns the segmentations of the given service instance that matches the given name parameter.
        Parameters:
        name - the segmentation name.
        serviceInstanceId - the service instance identifier.
        Returns:
        the segmentations of the given service instance that matches the given name parameter.
        Throws:
        PortalException
        Since:
        11.2.0
      • getById

        IUserSegmentation getById​(String id)
                           throws PortalException
        Returns the segmentation with the given identifier or null if no segmentation exists with the given identifier.
        Parameters:
        id - the segmentation identifier.
        Returns:
        the segmentation with the given identifier or null if no segmentation exists with the given identifier.
        Throws:
        PortalException
        Since:
        11.2.0
      • getByServiceInstance

        List<IUserSegmentation> getByServiceInstance​(String serviceInstanceId)
                                              throws PortalException
        Returns the segmentations of the given service instance.
        Parameters:
        serviceInstanceId - the service instance identifier.
        Returns:
        the segmentations of the given service instance.
        Throws:
        PortalException
        Since:
        11.2.0
      • isMember

        boolean isMember​(Collection<String> segmentationIds,
                         String monitorUserId)
                  throws PortalException
        Verifies if a user is a member of one of the specified segmentations.
        The given user identifier refers to monitor user, not to the portal user.
        Parameters:
        segmentationIds - the segmentation identifiers.
        monitorUserId - the monitor user identifier.
        Returns:
        true if the user is member of any of the segmentations, false otherwise.
        Throws:
        PortalException
        Since:
        11.2.0
      • getPortalMembers

        Collection<String> getPortalMembers​(String segmentationId)
                                     throws PortalException
        Returns the segmentation members. The members are monitor users.
        Parameters:
        segmentationId - the segmentation identifier.
        Returns:
        a collection of segmentation member identifiers.
        Throws:
        PortalException
        Since:
        12.0.0
      • getMemberSegmentations

        Collection<String> getMemberSegmentations​(String monitorUserId)
                                           throws PortalException
        Returns a collection of segmentations of the given user.
        Parameters:
        monitorUserId - the monitor user identifier.
        Returns:
        a collection of segmentations of the given user.
        Throws:
        PortalException
        Since:
        11.2.0
      • getMemberSegmentations

        Collection<String> getMemberSegmentations​(String monitorUserId,
                                                  boolean useSessionCache)
                                           throws PortalException
        Returns a collection of segmentations of the given user.
        Parameters:
        monitorUserId - the monitor user identifier.
        useSessionCache - indicates whether session cache should be used.
        Returns:
        a collection of segmentations of the given user.
        Throws:
        PortalException
        Since:
        11.2.0
      • getPortalMemberSegmentations

        default Collection<String> getPortalMemberSegmentations​(String portalUserId)
                                                         throws PortalException
        Returns a collection of segmentations of the given (portal) user.
        Parameters:
        monitorUserId - the portal user identifier.
        Returns:
        a collection of segmentations of the given (portal) user.
        Throws:
        PortalException
        Since:
        11.2.0
      • getPortalMemberSegmentations

        Collection<String> getPortalMemberSegmentations​(String portalUserId,
                                                        boolean useSessionCache)
                                                 throws PortalException
        Returns a collection of segmentations of the given (portal) user.
        Parameters:
        monitorUserId - the portal user identifier.
        Returns:
        a collection of segmentations of the given (portal) user.
        Throws:
        PortalException
        Since:
        11.2.0
      • getSegmentationsThatNeedToHaveMembershipUpdated

        Collection<IUserSegmentation> getSegmentationsThatNeedToHaveMembershipUpdated()
                                                                               throws PortalException
        Returns a collection of user segmentations that must have the memberships updated.
        Returns:
        a collection of user segmentations that must have the memberships updated.
        Throws:
        PortalException
        Since:
        11.2.0