Class PrivacyServiceImpl
java.lang.Object
org.apache.unomi.privacy.internal.PrivacyServiceImpl
- All Implemented Interfaces:
PrivacyService
Privacy service implementation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionanonymizeBrowsingData
(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)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".deleteProfile
(String profileId) Deletes the current profile (but has no effect on sessions and events).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.getAnonymousProfile
(Profile profile) Build a new anonymous profile (but doesn't persist it in the persistence service).getDeniedProperties
(String profileId) Gets the list of denied properties.getDeniedPropertyDistribution
(String profileId) This method doesn't do anything anymore please don't use itgetFilteredEventTypes
(String profileId) Retrieve the list of events that the profile has deactivated.getFilteredEventTypes
(Profile profile) Retrieve the list of events that the profile has deactivated.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.Retrieves the list of the server information objects, that include extensions.isRequireAnonymousBrowsing
(String profileId) Tests if the anonymous browsing flag is set of the specified profile.isRequireAnonymousBrowsing
(Profile profile) Tests if the anonymous browsing flag is set of the specified profile.removeProperty
(String profileId, String propertyName) Removes a property from the specified profile.void
setBundleWatcher
(BundleWatcher bundleWatcher) setDeniedProperties
(String profileId, List<String> propertyNames) Sets the list of denied properties.setDeniedPropertyDistribution
(String profileId, List<String> propertyNames) This method doesn't do anything anymore please don't use itvoid
setEventService
(EventService eventService) setFilteredEventTypes
(String profileId, List<String> eventTypes) Set the list of filtered event types for a profile.void
setPersistenceService
(PersistenceService persistenceService) void
setProfileService
(ProfileService profileService) setRequireAnonymousBrowsing
(String profileId, boolean anonymous, String scope) Controls the activation/deactivation of anonymous browsing.
-
Constructor Details
-
PrivacyServiceImpl
public PrivacyServiceImpl()
-
-
Method Details
-
setPersistenceService
-
setProfileService
-
setEventService
-
setBundleWatcher
-
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
-