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 Summary
Constructors Constructor Description PrivacyServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
anonymizeBrowsingData(String profileId)
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)Boolean
anonymizeProfile(String profileId, String scope)
This method will "anonymize" a profile by removing from the associated profile all the properties that have been defined as "denied properties".Boolean
deleteProfile(String profileId)
Deletes the current profile (but has no effect on sessions and events).Boolean
deleteProfileData(String profileId, boolean purgeData)
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.Profile
getAnonymousProfile(Profile profile)
Build a new anonymous profile (but doesn't persist it in the persistence service).List<String>
getDeniedProperties(String profileId)
Gets the list of denied properties.List<String>
getDeniedPropertyDistribution(String profileId)
This method doesn't do anything anymore please don't use itList<String>
getFilteredEventTypes(String profileId)
Retrieve the list of events that the profile has deactivated.List<String>
getFilteredEventTypes(Profile profile)
Retrieve the list of events that the profile has deactivated.ServerInfo
getServerInfo()
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.List<ServerInfo>
getServerInfos()
Retrieves the list of the server information objects, that include extensions.Boolean
isRequireAnonymousBrowsing(String profileId)
Tests if the anonymous browsing flag is set of the specified profile.Boolean
isRequireAnonymousBrowsing(Profile profile)
Tests if the anonymous browsing flag is set of the specified profile.Boolean
removeProperty(String profileId, String propertyName)
Removes a property from the specified profile.void
setBundleWatcher(BundleWatcher bundleWatcher)
Boolean
setDeniedProperties(String profileId, List<String> propertyNames)
Sets the list of denied properties.Boolean
setDeniedPropertyDistribution(String profileId, List<String> propertyNames)
This method doesn't do anything anymore please don't use itvoid
setEventService(EventService eventService)
Boolean
setFilteredEventTypes(String profileId, List<String> eventTypes)
Set the list of filtered event types for a profile.void
setPersistenceService(PersistenceService persistenceService)
void
setProfileService(ProfileService profileService)
Boolean
setRequireAnonymousBrowsing(String profileId, boolean anonymous, String scope)
Controls the activation/deactivation of anonymous browsing.
-
-
-
Method Detail
-
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 interfacePrivacyService
- 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 interfacePrivacyService
- 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 interfacePrivacyService
- 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 interfacePrivacyService
- 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 interfacePrivacyService
- 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 interfacePrivacyService
- Parameters:
profileId
- the identifier of the profilepurgeData
- 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 interfacePrivacyService
- Parameters:
profileId
- the identifier of the profile on which to set the anonymous browsing property flaganonymous
- 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 interfacePrivacyService
- 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 interfacePrivacyService
- 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 interfacePrivacyService
- 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 interfacePrivacyService
- 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 interfacePrivacyService
- 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 interfacePrivacyService
- Parameters:
profileId
- the identifier of the profile on which to filter the eventseventTypes
- 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 interfacePrivacyService
- 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 interfacePrivacyService
- Parameters:
profileId
- the profile for which to see the denied propertiespropertyNames
- 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 interfacePrivacyService
- 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 interfacePrivacyService
- Parameters:
profileId
- the identifier of the profilepropertyNames
- 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 interfacePrivacyService
- Parameters:
profileId
- the identifier of the profilepropertyName
- the name of the property to remove- Returns:
- true if sucessfull, false otherwise
-
-