Class PrivacyServiceImpl

java.lang.Object
org.apache.unomi.privacy.internal.PrivacyServiceImpl
All Implemented Interfaces:
PrivacyService

public class PrivacyServiceImpl extends Object implements PrivacyService
Privacy service implementation
  • Constructor Details

    • PrivacyServiceImpl

      public PrivacyServiceImpl()
  • Method Details

    • setPersistenceService

      public void setPersistenceService(PersistenceService persistenceService)
    • setProfileService

      public void setProfileService(ProfileService profileService)
    • setEventService

      public void setEventService(EventService eventService)
    • setBundleWatcher

      public void setBundleWatcher(BundleWatcher bundleWatcher)
    • getServerInfo

      public ServerInfo getServerInfo()
      Description copied from interface: PrivacyService
      Retrieves the default base Apache Unomi server information, including the name and version of the server, build time information and the event types if recognizes as well as the capabilities supported by the system. For more detailed information about the system and extensions use the getServerInfos method.
      Specified by:
      getServerInfo in interface PrivacyService
      Returns:
      a ServerInfo object with all the server information
    • getServerInfos

      public List<ServerInfo> getServerInfos()
      Description copied from interface: PrivacyService
      Retrieves the list of the server information objects, that include extensions. Each object includes the name and version of the server, build time information and the event types if recognizes as well as the capabilities supported by the system.
      Specified by:
      getServerInfos in interface PrivacyService
      Returns:
      a list of ServerInfo objects with all the server information
    • deleteProfile

      public Boolean deleteProfile(String profileId)
      Description copied from interface: PrivacyService
      Deletes the current profile (but has no effect on sessions and events). This will delete the persisted profile and replace it with a new empty one with the same profileId.
      Specified by:
      deleteProfile in interface PrivacyService
      Parameters:
      profileId - the identifier of the profile to delete and replace
      Returns:
      true if the deletion was successful
    • anonymizeProfile

      public Boolean anonymizeProfile(String profileId, String scope)
      Description copied from interface: PrivacyService
      This method will "anonymize" a profile by removing from the associated profile all the properties that have been defined as "denied properties".
      Specified by:
      anonymizeProfile in interface PrivacyService
      Parameters:
      profileId - the identifier of the profile that needs to be anonymized.
      scope - The scope will be used to send events, once for the anonymizeProfile event, the other for the profileUpdated event
      Returns:
      true if the profile had some properties purged, false otherwise
    • anonymizeBrowsingData

      public Boolean anonymizeBrowsingData(String profileId)
      Description copied from interface: PrivacyService
      This method will anonymize browsing data by creating an anonymous profile for the current profile, and then re-associating all the profile's sessions and events with the new anonymous profile todo this method does not anonymize any session or event properties that may contain profile data (such as the login event)
      Specified by:
      anonymizeBrowsingData in interface PrivacyService
      Parameters:
      profileId - the identifier of the profile on which to perform the anonymizations of the browsing data
      Returns:
      true if the operation was successful, false otherwise
    • deleteProfileData

      public Boolean deleteProfileData(String profileId, boolean purgeData)
      Description copied from interface: PrivacyService
      This method will perform two operations, first it will call the anonymizeBrowsingData method on the specified profile, and then it will delete the profile from the persistence service.
      Specified by:
      deleteProfileData in interface PrivacyService
      Parameters:
      profileId - the identifier of the profile
      purgeData - flag that indicates whether to purge the profile's data
      Returns:
      true if the operation was successful, false otherwise
    • setRequireAnonymousBrowsing

      public Boolean setRequireAnonymousBrowsing(String profileId, boolean anonymous, String scope)
      Description copied from interface: PrivacyService
      Controls the activation/deactivation of anonymous browsing. This method will simply set a system property called requireAnonymousProfile that will be then use to know if we should associate browsing data with the main profile or the associated anonymous profile. Note that changing this setting will also reset the goals and pastEvents system properties for the profile.
      Specified by:
      setRequireAnonymousBrowsing in interface PrivacyService
      Parameters:
      profileId - the identifier of the profile on which to set the anonymous browsing property flag
      anonymous - the value of the anonymous browsing flag.
      scope - a scope used to send a profileUpdated event internally
      Returns:
      true if successful, false otherwise
    • isRequireAnonymousBrowsing

      public Boolean isRequireAnonymousBrowsing(String profileId)
      Description copied from interface: PrivacyService
      Tests if the anonymous browsing flag is set of the specified profile.
      Specified by:
      isRequireAnonymousBrowsing in interface PrivacyService
      Parameters:
      profileId - the identifier of the profile on which we want to retrieve the anonymous browsing flag
      Returns:
      true if successful, false otherwise
    • isRequireAnonymousBrowsing

      public Boolean isRequireAnonymousBrowsing(Profile profile)
      Description copied from interface: PrivacyService
      Tests if the anonymous browsing flag is set of the specified profile.
      Specified by:
      isRequireAnonymousBrowsing in interface PrivacyService
      Parameters:
      profile - the profile on which we want to retrieve the anonymous browsing flag
      Returns:
      true if successful, false otherwise
    • getAnonymousProfile

      public Profile getAnonymousProfile(Profile profile)
      Description copied from interface: PrivacyService
      Build a new anonymous profile (but doesn't persist it in the persistence service). This will also copy the profile properties from the passed profile that are not listed as denied properties.
      Specified by:
      getAnonymousProfile in interface PrivacyService
      Parameters:
      profile - the profile for which to create the anonymous profile
      Returns:
      a newly created (but not persisted) profile for the passed profile.
    • getFilteredEventTypes

      public List<String> getFilteredEventTypes(String profileId)
      Description copied from interface: PrivacyService
      Retrieve the list of events that the profile has deactivated. For each profile a visitor may indicate that he doesn't want some events to be collected. This method retrieves this list from the specified profile
      Specified by:
      getFilteredEventTypes in interface PrivacyService
      Parameters:
      profileId - the identifier for the profile for which we want to retrieve the list of forbidden event types
      Returns:
      a list of event types
    • getFilteredEventTypes

      public List<String> getFilteredEventTypes(Profile profile)
      Description copied from interface: PrivacyService
      Retrieve the list of events that the profile has deactivated. For each profile a visitor may indicate that he doesn't want some events to be collected. This method retrieves this list from the specified profile
      Specified by:
      getFilteredEventTypes in interface PrivacyService
      Parameters:
      profile - the profile for which we want to retrieve the list of forbidden event types
      Returns:
      a list of event types
    • setFilteredEventTypes

      public Boolean setFilteredEventTypes(String profileId, List<String> eventTypes)
      Description copied from interface: PrivacyService
      Set the list of filtered event types for a profile. This is the list of event types that the visitor has specified he does not want the server to collect.
      Specified by:
      setFilteredEventTypes in interface PrivacyService
      Parameters:
      profileId - the identifier of the profile on which to filter the events
      eventTypes - a list of event types that will be filter for the profile
      Returns:
      true if successfull, false otherwise.
    • getDeniedProperties

      public List<String> getDeniedProperties(String profileId)
      Description copied from interface: PrivacyService
      Gets the list of denied properties. These are properties marked with a personal identifier tag.
      Specified by:
      getDeniedProperties in interface PrivacyService
      Parameters:
      profileId - the identified of the profile
      Returns:
      a list of profile properties identifiers that are marked as personally identifying
    • setDeniedProperties

      public Boolean setDeniedProperties(String profileId, List<String> propertyNames)
      Description copied from interface: PrivacyService
      Sets the list of denied properties.
      Specified by:
      setDeniedProperties in interface PrivacyService
      Parameters:
      profileId - the profile for which to see the denied properties
      propertyNames - the property names to be denied
      Returns:
      null all the time, this method is not used and is marked as deprecated
    • getDeniedPropertyDistribution

      public List<String> getDeniedPropertyDistribution(String profileId)
      Description copied from interface: PrivacyService
      This method doesn't do anything anymore please don't use it
      Specified by:
      getDeniedPropertyDistribution in interface PrivacyService
      Parameters:
      profileId - the identifier of the profile
      Returns:
      do not use
    • setDeniedPropertyDistribution

      public Boolean setDeniedPropertyDistribution(String profileId, List<String> propertyNames)
      Description copied from interface: PrivacyService
      This method doesn't do anything anymore please don't use it
      Specified by:
      setDeniedPropertyDistribution in interface PrivacyService
      Parameters:
      profileId - the identifier of the profile
      propertyNames - do not use
      Returns:
      do not use
    • removeProperty

      public Boolean removeProperty(String profileId, String propertyName)
      Description copied from interface: PrivacyService
      Removes a property from the specified profile. This change is persisted.
      Specified by:
      removeProperty in interface PrivacyService
      Parameters:
      profileId - the identifier of the profile
      propertyName - the name of the property to remove
      Returns:
      true if sucessfull, false otherwise