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 BooleananonymizeBrowsingData(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)BooleananonymizeProfile(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".BooleandeleteProfile(String profileId)Deletes the current profile (but has no effect on sessions and events).BooleandeleteProfileData(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.ProfilegetAnonymousProfile(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.ServerInfogetServerInfo()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.BooleanisRequireAnonymousBrowsing(String profileId)Tests if the anonymous browsing flag is set of the specified profile.BooleanisRequireAnonymousBrowsing(Profile profile)Tests if the anonymous browsing flag is set of the specified profile.BooleanremoveProperty(String profileId, String propertyName)Removes a property from the specified profile.voidsetBundleWatcher(BundleWatcher bundleWatcher)BooleansetDeniedProperties(String profileId, List<String> propertyNames)Sets the list of denied properties.BooleansetDeniedPropertyDistribution(String profileId, List<String> propertyNames)This method doesn't do anything anymore please don't use itvoidsetEventService(EventService eventService)BooleansetFilteredEventTypes(String profileId, List<String> eventTypes)Set the list of filtered event types for a profile.voidsetPersistenceService(PersistenceService persistenceService)voidsetProfileService(ProfileService profileService)BooleansetRequireAnonymousBrowsing(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:PrivacyServiceRetrieves 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:
getServerInfoin interfacePrivacyService- Returns:
- a ServerInfo object with all the server information
-
getServerInfos
public List<ServerInfo> getServerInfos()
Description copied from interface:PrivacyServiceRetrieves 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:
getServerInfosin interfacePrivacyService- Returns:
- a list of ServerInfo objects with all the server information
-
deleteProfile
public Boolean deleteProfile(String profileId)
Description copied from interface:PrivacyServiceDeletes 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:
deleteProfilein 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:PrivacyServiceThis method will "anonymize" a profile by removing from the associated profile all the properties that have been defined as "denied properties".- Specified by:
anonymizeProfilein 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:PrivacyServiceThis 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:
anonymizeBrowsingDatain 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:PrivacyServiceThis 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:
deleteProfileDatain 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:PrivacyServiceControls 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:
setRequireAnonymousBrowsingin 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:PrivacyServiceTests if the anonymous browsing flag is set of the specified profile.- Specified by:
isRequireAnonymousBrowsingin 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:PrivacyServiceTests if the anonymous browsing flag is set of the specified profile.- Specified by:
isRequireAnonymousBrowsingin 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:PrivacyServiceBuild 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:
getAnonymousProfilein 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:PrivacyServiceRetrieve 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:
getFilteredEventTypesin 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:PrivacyServiceRetrieve 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:
getFilteredEventTypesin 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:PrivacyServiceSet 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:
setFilteredEventTypesin 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:PrivacyServiceGets the list of denied properties. These are properties marked with a personal identifier tag.- Specified by:
getDeniedPropertiesin 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:PrivacyServiceSets the list of denied properties.- Specified by:
setDeniedPropertiesin 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:PrivacyServiceThis method doesn't do anything anymore please don't use it- Specified by:
getDeniedPropertyDistributionin 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:PrivacyServiceThis method doesn't do anything anymore please don't use it- Specified by:
setDeniedPropertyDistributionin 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:PrivacyServiceRemoves a property from the specified profile. This change is persisted.- Specified by:
removePropertyin interfacePrivacyService- Parameters:
profileId- the identifier of the profilepropertyName- the name of the property to remove- Returns:
- true if sucessfull, false otherwise
-
-