Interface IUserSegmentationManagerSPI

    • Method Detail

      • saveSegmentation

        java.lang.String saveSegmentation​(java.lang.String name,
                                          java.lang.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​(java.lang.String id,
                                             java.lang.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​(java.util.Collection<java.lang.String> ids,
                                 java.lang.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​(java.lang.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

        java.util.List<IUserSegmentation> findByServiceInstanceAndLikeName​(java.lang.String name,
                                                                           java.lang.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​(java.lang.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

        java.util.List<IUserSegmentation> getByServiceInstance​(java.lang.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​(java.util.Collection<java.lang.String> segmentationIds,
                         java.lang.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

        java.util.Collection<java.lang.String> getPortalMembers​(java.lang.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

        java.util.Collection<java.lang.String> getMemberSegmentations​(java.lang.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

        java.util.Collection<java.lang.String> getMemberSegmentations​(java.lang.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 java.util.Collection<java.lang.String> getPortalMemberSegmentations​(java.lang.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

        java.util.Collection<java.lang.String> getPortalMemberSegmentations​(java.lang.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

        java.util.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
      • init

        void init()
        Initializes the user segmentation manager.
        Since:
        17.0.0
      • shutdown

        void shutdown()
        Shuts down the user segmentation manager.
        Since:
        17.0.0
      • restartExecutorService

        void restartExecutorService()
        Restarts the user segmentation manager executor.
        Since:
        17.0.0