Class ProfileServiceImpl
- java.lang.Object
-
- org.apache.unomi.services.impl.profiles.ProfileServiceImpl
-
- All Implemented Interfaces:
EventListener,ProfileService,org.osgi.framework.BundleListener,org.osgi.framework.SynchronousBundleListener
public class ProfileServiceImpl extends Object implements ProfileService, org.osgi.framework.SynchronousBundleListener
-
-
Field Summary
-
Fields inherited from interface org.apache.unomi.api.services.ProfileService
PERSONAL_IDENTIFIER_TAG_NAME
-
-
Constructor Summary
Constructors Constructor Description ProfileServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddAliasToProfile(String profileID, String alias, String clientID)Adds the alias to the profile.voidbatchProfilesUpdate(BatchUpdate update)Update all profiles in batch according to the specifiedBatchUpdatevoidbundleChanged(org.osgi.framework.BundleEvent event)PersonacreatePersona(String personaId)Creates a persona with the specified identifier and automatically creates an associated session with it.voiddelete(String profileId, boolean persona)Removes the profile (or persona if thepersonaparameter is set totrue) identified by the specified identifier.booleandeletePropertyType(String propertyId)Deletes the property type identified by the specified identifier.StringexportProfilesPropertiesToCsv(Query query)Creates a String containing comma-separated values (CSV) formatted version of profiles matching the specified query.PartialList<ProfileAlias>findProfileAliases(String profileId, int offset, int size, String sortBy)Find profile aliases which have the specified property with the specified value, ordered according to the specifiedsortByString and paged: onlysizeof them are retrieved, starting with theoffset-th one.PartialList<Profile>findProfilesByPropertyValue(String propertyName, String propertyValue, int offset, int size, String sortBy)Find profiles which have the specified property with the specified value, ordered according to the specifiedsortByString and paged: onlysizeof them are retrieved, starting with theoffset-th one.PartialList<Session>findProfileSessions(String profileId)Retrieves sessions associated with the profile identified by the specified identifier.longgetAllProfilesCount()Retrieves the number of unique profiles.Set<PropertyType>getExistingProperties(String tag, String itemType)Retrieves the existing property types for the specified type as defined by the Item subclass public fieldITEM_TYPEand with the specified tag.Set<PropertyType>getExistingProperties(String tag, String itemType, boolean systemTag)Retrieves the existing property types for the specified type as defined by the Item subclass public fieldITEM_TYPEand with the specified tag (system or regular) TODO: move to a different classPartialList<Session>getPersonaSessions(String personaId, int offset, int size, String sortBy)Retrieves the sessions associated with the persona identified by the specified identifier, ordered according to the specifiedsortByString and and paged: onlysizeof them are retrieved, starting with theoffset-th one.PartialList<Session>getProfileSessions(String profileId, String query, int offset, int size, String sortBy)Retrieves the sessions associated with the profile identified by the specified identifier that match the specified query (if specified), ordered according to the specifiedsortByString and and paged: onlysizeof them are retrieved, starting with theoffset-th one.PropertyTypegetPropertyType(String id)Retrieves the property type identified by the specified identifier.Collection<PropertyType>getPropertyTypeByMapping(String propertyName)TODOSet<PropertyType>getPropertyTypeBySystemTag(String tag)Retrieves all property types with the specified system tag TODO: move to a different classSet<PropertyType>getPropertyTypeByTag(String tag)Retrieves all property types with the specified tag TODO: move to a different classStringgetPropertyTypeMapping(String fromPropertyTypeId)TODOMap<String,Collection<PropertyType>>getTargetPropertyTypes()Retrieves all known property types.Collection<PropertyType>getTargetPropertyTypes(String target)Retrieves all the property types associated with the specified target.Profileload(String profileId)Retrieves the profile identified by the specified identifier.PersonaloadPersona(String personaId)Retrieves the persona identified by the specified identifier.PersonaWithSessionsloadPersonaWithSessions(String personaId)Retrieves the persona identified by the specified identifier and all its associated sessionsSessionloadSession(String sessionId)Retrieves the session identified by the specified identifier.SessionloadSession(String sessionId, Date dateHint)Retrieves the session identified by the specified identifier.booleanmatchCondition(Condition condition, Profile profile, Session session)Checks whether the specified profile and/or session satisfy the specified condition.ProfilemergeProfiles(Profile masterProfile, List<Profile> profilesToMerge)Merges the specified profiles into the provided so-called master profile, merging properties according to thePropertyMergeStrategyTypespecified on theirPropertyType.voidpostConstruct()voidpreDestroy()voidpurgeEventItems(int existsNumberOfDays)Purge (delete) event itemsvoidpurgeMonthlyItems(int existsNumberOfMonths)Deprecated.voidpurgeProfiles(int inactiveNumberOfDays, int existsNumberOfDays)Purge (delete) profiles example: Purge profile inactive since 10 days only: purgeProfiles(10, 0); example: Purge profile created since 30 days only: purgeProfiles(0, 30);voidpurgeSessionItems(int existsNumberOfDays)Purge (delete) session itemsvoidrefresh()Forces a refresh of the profile service, to load data from persistence immediately instead of waiting for scheduled tasks to execute.voidreloadPropertyTypes(boolean refresh)ProfileAliasremoveAliasFromProfile(String profileID, String alias, String clientID)Removes the alias from the profile.voidremoveProfileSessions(String profileId)Removes all sessions of the specified profileProfilesave(Profile profile)Saves the specified profile in the context server.ProfilesaveOrMerge(Profile profile)Merge the specified profile properties in an existing profile,or save new profile if it does not exist yetPersonasavePersona(Persona profile)Persists the specifiedPersonain the context server.PersonaWithSessionssavePersonaWithSessions(PersonaWithSessions personaToSave)Save a persona with its sessions.SessionsaveSession(Session session)Saves the specified session.<T extends Profile>
PartialList<T>search(Query query, Class<T> clazz)Retrieves profiles or personas matching the specified query.PartialList<Session>searchSessions(Query query)Retrieves sessions matching the specified query.voidsetBundleContext(org.osgi.framework.BundleContext bundleContext)voidsetDefinitionsService(DefinitionsService definitionsService)voidsetForceRefreshOnSave(boolean forceRefreshOnSave)voidsetPersistenceService(PersistenceService persistenceService)voidsetPropertiesRefreshInterval(long propertiesRefreshInterval)booleansetPropertyType(PropertyType property)Persists the specified property type in the context server.voidsetPropertyTypeTarget(URL predefinedPropertyTypeURL, PropertyType propertyType)This function will try to set the target on the property type if not set already, based on the file URLvoidsetPurgeEventExistTime(Integer purgeEventExistTime)voidsetPurgeProfileExistTime(Integer purgeProfileExistTime)voidsetPurgeProfileInactiveTime(Integer purgeProfileInactiveTime)voidsetPurgeProfileInterval(Integer purgeProfileInterval)voidsetPurgeSessionExistTime(Integer purgeSessionExistTime)voidsetPurgeSessionsAndEventsTime(Integer purgeSessionsAndEventsTime)Deprecated.voidsetSchedulerService(SchedulerService schedulerService)voidsetSegmentService(SegmentService segmentService)
-
-
-
Method Detail
-
setBundleContext
public void setBundleContext(org.osgi.framework.BundleContext bundleContext)
-
setPersistenceService
public void setPersistenceService(PersistenceService persistenceService)
-
setDefinitionsService
public void setDefinitionsService(DefinitionsService definitionsService)
-
setSchedulerService
public void setSchedulerService(SchedulerService schedulerService)
-
setSegmentService
public void setSegmentService(SegmentService segmentService)
-
setForceRefreshOnSave
public void setForceRefreshOnSave(boolean forceRefreshOnSave)
-
setPropertiesRefreshInterval
public void setPropertiesRefreshInterval(long propertiesRefreshInterval)
-
postConstruct
public void postConstruct()
-
preDestroy
public void preDestroy()
-
setPurgeProfileExistTime
public void setPurgeProfileExistTime(Integer purgeProfileExistTime)
-
setPurgeProfileInactiveTime
public void setPurgeProfileInactiveTime(Integer purgeProfileInactiveTime)
-
setPurgeSessionsAndEventsTime
@Deprecated public void setPurgeSessionsAndEventsTime(Integer purgeSessionsAndEventsTime)
Deprecated.
-
setPurgeProfileInterval
public void setPurgeProfileInterval(Integer purgeProfileInterval)
-
setPurgeSessionExistTime
public void setPurgeSessionExistTime(Integer purgeSessionExistTime)
-
setPurgeEventExistTime
public void setPurgeEventExistTime(Integer purgeEventExistTime)
-
reloadPropertyTypes
public void reloadPropertyTypes(boolean refresh)
-
purgeProfiles
public void purgeProfiles(int inactiveNumberOfDays, int existsNumberOfDays)Description copied from interface:ProfileServicePurge (delete) profiles example: Purge profile inactive since 10 days only: purgeProfiles(10, 0); example: Purge profile created since 30 days only: purgeProfiles(0, 30);- Specified by:
purgeProfilesin interfaceProfileService- Parameters:
inactiveNumberOfDays- will purge profiles with no visits since this number of days (0 or negative value, will have no effect)existsNumberOfDays- will purge profiles created since this number of days (0 or negative value, will have no effect)
-
purgeSessionItems
public void purgeSessionItems(int existsNumberOfDays)
Description copied from interface:ProfileServicePurge (delete) session items- Specified by:
purgeSessionItemsin interfaceProfileService- Parameters:
existsNumberOfDays- will purge sessions created since this number of days (0 or negative value, will have no effect)
-
purgeEventItems
public void purgeEventItems(int existsNumberOfDays)
Description copied from interface:ProfileServicePurge (delete) event items- Specified by:
purgeEventItemsin interfaceProfileService- Parameters:
existsNumberOfDays- will purge events created since this number of days (0 or negative value, will have no effect)
-
purgeMonthlyItems
@Deprecated public void purgeMonthlyItems(int existsNumberOfMonths)
Deprecated.Description copied from interface:ProfileServiceUse purgeSessionItems and purgeEventItems to remove rollover items instead- Specified by:
purgeMonthlyItemsin interfaceProfileService- Parameters:
existsNumberOfMonths- used to remove monthly indices older than this number of months
-
getAllProfilesCount
public long getAllProfilesCount()
Description copied from interface:ProfileServiceRetrieves the number of unique profiles.- Specified by:
getAllProfilesCountin interfaceProfileService- Returns:
- the number of unique profiles.
-
search
public <T extends Profile> PartialList<T> search(Query query, Class<T> clazz)
Description copied from interface:ProfileServiceRetrieves profiles or personas matching the specified query.- Specified by:
searchin interfaceProfileService- Type Parameters:
T- the specific sub-type ofProfileto retrieve- Parameters:
query- aQueryspecifying which elements to retrieveclazz- the class of elements to retrieve- Returns:
- a
PartialListofTinstances matching the specified query
-
searchSessions
public PartialList<Session> searchSessions(Query query)
Description copied from interface:ProfileServiceRetrieves sessions matching the specified query.- Specified by:
searchSessionsin interfaceProfileService- Parameters:
query- aQueryspecifying which elements to retrieve- Returns:
- a
PartialListof sessions matching the specified query
-
setPropertyType
public boolean setPropertyType(PropertyType property)
Description copied from interface:ProfileServicePersists the specified property type in the context server. TODO: move to a different class- Specified by:
setPropertyTypein interfaceProfileService- Parameters:
property- the property type to persist- Returns:
trueif the property type was properly created,falseotherwise (for example, if the property type already existed
-
deletePropertyType
public boolean deletePropertyType(String propertyId)
Description copied from interface:ProfileServiceDeletes the property type identified by the specified identifier. TODO: move to a different class- Specified by:
deletePropertyTypein interfaceProfileService- Parameters:
propertyId- the identifier of the property type to delete- Returns:
trueif the property type was properly deleted,falseotherwise
-
getExistingProperties
public Set<PropertyType> getExistingProperties(String tag, String itemType)
Description copied from interface:ProfileServiceRetrieves the existing property types for the specified type as defined by the Item subclass public fieldITEM_TYPEand with the specified tag. TODO: move to a different class- Specified by:
getExistingPropertiesin interfaceProfileService- Parameters:
tag- the tag we're interested initemType- the String representation of the item type we want to retrieve the count of, as defined by its class'ITEM_TYPEfield- Returns:
- all property types defined for the specified item type and with the specified tag
-
getExistingProperties
public Set<PropertyType> getExistingProperties(String tag, String itemType, boolean systemTag)
Description copied from interface:ProfileServiceRetrieves the existing property types for the specified type as defined by the Item subclass public fieldITEM_TYPEand with the specified tag (system or regular) TODO: move to a different class- Specified by:
getExistingPropertiesin interfaceProfileService- Parameters:
tag- the tag we're interested initemType- the String representation of the item type we want to retrieve the count of, as defined by its class'ITEM_TYPEfieldsystemTag- whether the specified is a system tag or a regular one- Returns:
- all property types defined for the specified item type and with the specified tag
-
exportProfilesPropertiesToCsv
public String exportProfilesPropertiesToCsv(Query query)
Description copied from interface:ProfileServiceCreates a String containing comma-separated values (CSV) formatted version of profiles matching the specified query.- Specified by:
exportProfilesPropertiesToCsvin interfaceProfileService- Parameters:
query- the query specifying which profiles to export- Returns:
- a CSV-formatted String version of the profiles matching the specified query
-
findProfilesByPropertyValue
public PartialList<Profile> findProfilesByPropertyValue(String propertyName, String propertyValue, int offset, int size, String sortBy)
Description copied from interface:ProfileServiceFind profiles which have the specified property with the specified value, ordered according to the specifiedsortByString and paged: onlysizeof them are retrieved, starting with theoffset-th one. TODO: replace with version using a query instead of separate parameters TODO: remove as it's unused?- Specified by:
findProfilesByPropertyValuein interfaceProfileService- Parameters:
propertyName- the name of the property we're interested inpropertyValue- the value of the property we want profiles to haveoffset- zero or a positive integer specifying the position of the first profile in the total ordered collection of matching profilessize- a positive integer specifying how many matching profiles should be retrieved or-1if all of them should be retrievedsortBy- an optional (nullif no sorting is required) String of comma (,) separated property names on which ordering should be performed, ordering elements according to the property order in the String, considering each in turn and moving on to the next one in case of equality of all preceding ones. Each property name is optionally followed by a column (:) and an order specifier:ascordesc.- Returns:
- a
PartialListof matching profiles
-
load
public Profile load(String profileId)
Description copied from interface:ProfileServiceRetrieves the profile identified by the specified identifier.- Specified by:
loadin interfaceProfileService- Parameters:
profileId- the identifier of the profile to retrieve- Returns:
- the profile identified by the specified identifier or
nullif no such profile exists
-
save
public Profile save(Profile profile)
Description copied from interface:ProfileServiceSaves the specified profile in the context server.- Specified by:
savein interfaceProfileService- Parameters:
profile- the profile to be saved- Returns:
- the newly saved profile
-
addAliasToProfile
public void addAliasToProfile(String profileID, String alias, String clientID)
Description copied from interface:ProfileServiceAdds the alias to the profile.- Specified by:
addAliasToProfilein interfaceProfileService- Parameters:
profileID- the identifier of the profilealias- the alias which should be linked with of the profileclientID- the identifier of the client
-
removeAliasFromProfile
public ProfileAlias removeAliasFromProfile(String profileID, String alias, String clientID)
Description copied from interface:ProfileServiceRemoves the alias from the profile.- Specified by:
removeAliasFromProfilein interfaceProfileService- Parameters:
profileID- the identifier of the profilealias- the alias which should be unlinked from the profileclientID- the identifier of the client
-
findProfileAliases
public PartialList<ProfileAlias> findProfileAliases(String profileId, int offset, int size, String sortBy)
Description copied from interface:ProfileServiceFind profile aliases which have the specified property with the specified value, ordered according to the specifiedsortByString and paged: onlysizeof them are retrieved, starting with theoffset-th one.- Specified by:
findProfileAliasesin interfaceProfileService- Parameters:
profileId- the identifier of the profileoffset- zero or a positive integer specifying the position of the first profile in the total ordered collection of matching profilessize- a positive integer specifying how many matching profiles should be retrieved or-1if all of them should be retrievedsortBy- an optional (nullif no sorting is required) String of comma (,) separated property names on which ordering should be performed, ordering elements according to the property order in the String, considering each in turn and moving on to the next one in case of equality of all preceding ones. Each property name is optionally followed by a column (:) and an order specifier:ascordesc.- Returns:
- a
PartialListof matching profiles
-
saveOrMerge
public Profile saveOrMerge(Profile profile)
Description copied from interface:ProfileServiceMerge the specified profile properties in an existing profile,or save new profile if it does not exist yet- Specified by:
saveOrMergein interfaceProfileService- Parameters:
profile- the profile to be saved- Returns:
- the newly saved or merged profile or null if the save or merge operation failed.
-
savePersona
public Persona savePersona(Persona profile)
Description copied from interface:ProfileServicePersists the specifiedPersonain the context server.- Specified by:
savePersonain interfaceProfileService- Parameters:
profile- the persona to persist- Returns:
- the newly persisted persona
-
delete
public void delete(String profileId, boolean persona)
Description copied from interface:ProfileServiceRemoves the profile (or persona if thepersonaparameter is set totrue) identified by the specified identifier.- Specified by:
deletein interfaceProfileService- Parameters:
profileId- the identifier of the profile or persona to deletepersona-trueif the specified identifier is supposed to refer to a persona,falseif it is supposed to refer to a profile
-
mergeProfiles
public Profile mergeProfiles(Profile masterProfile, List<Profile> profilesToMerge)
Description copied from interface:ProfileServiceMerges the specified profiles into the provided so-called master profile, merging properties according to thePropertyMergeStrategyTypespecified on theirPropertyType.- Specified by:
mergeProfilesin interfaceProfileService- Parameters:
masterProfile- the profile into which the specified profiles will be mergedprofilesToMerge- the list of profiles to merge into the specified master profile- Returns:
- the merged profile
-
getProfileSessions
public PartialList<Session> getProfileSessions(String profileId, String query, int offset, int size, String sortBy)
Description copied from interface:ProfileServiceRetrieves the sessions associated with the profile identified by the specified identifier that match the specified query (if specified), ordered according to the specifiedsortByString and and paged: onlysizeof them are retrieved, starting with theoffset-th one. TODO: use a Query object instead of distinct parameter- Specified by:
getProfileSessionsin interfaceProfileService- Parameters:
profileId- the identifier of the profile we want to retrieve sessions fromquery- a String of text used for fulltext filtering which sessions we are interested in ornull(or an empty String) if we want to retrieve all sessionsoffset- zero or a positive integer specifying the position of the first session in the total ordered collection of matching sessionssize- a positive integer specifying how many matching sessions should be retrieved or-1if all of them should be retrievedsortBy- an optional (nullif no sorting is required) String of comma (,) separated property names on which ordering should be performed, ordering elements according to the property order in the String, considering each in turn and moving on to the next one in case of equality of all preceding ones. Each property name is optionally followed by a column (:) and an order specifier:ascordesc.- Returns:
- a
PartialListof matching sessions
-
getPropertyTypeMapping
public String getPropertyTypeMapping(String fromPropertyTypeId)
Description copied from interface:ProfileServiceTODO- Specified by:
getPropertyTypeMappingin interfaceProfileService- Parameters:
fromPropertyTypeId- fromPropertyTypeId- Returns:
- property type mapping
-
loadSession
public Session loadSession(String sessionId, Date dateHint)
Description copied from interface:ProfileServiceRetrieves the session identified by the specified identifier.- Specified by:
loadSessionin interfaceProfileService- Parameters:
sessionId- the identifier of the session to be retrieveddateHint- a Date helping in identifying where the item is located- Returns:
- the session identified by the specified identifier
-
loadSession
public Session loadSession(String sessionId)
Description copied from interface:ProfileServiceRetrieves the session identified by the specified identifier.- Specified by:
loadSessionin interfaceProfileService- Parameters:
sessionId- the identifier of the session to be retrieved- Returns:
- the session identified by the specified identifier
-
saveSession
public Session saveSession(Session session)
Description copied from interface:ProfileServiceSaves the specified session.- Specified by:
saveSessionin interfaceProfileService- Parameters:
session- the session to be saved- Returns:
- the newly saved session
-
findProfileSessions
public PartialList<Session> findProfileSessions(String profileId)
Description copied from interface:ProfileServiceRetrieves sessions associated with the profile identified by the specified identifier.- Specified by:
findProfileSessionsin interfaceProfileService- Parameters:
profileId- the profile id for which we want to retrieve the sessions- Returns:
- a
PartialListof the profile's sessions
-
removeProfileSessions
public void removeProfileSessions(String profileId)
Description copied from interface:ProfileServiceRemoves all sessions of the specified profile- Specified by:
removeProfileSessionsin interfaceProfileService- Parameters:
profileId- identifier of the profile that we want to remove it's sessions
-
matchCondition
public boolean matchCondition(Condition condition, Profile profile, Session session)
Description copied from interface:ProfileServiceChecks whether the specified profile and/or session satisfy the specified condition.- Specified by:
matchConditionin interfaceProfileService- Parameters:
condition- the condition we're testing against which might or might not have profile- or session-specific sub-conditionsprofile- the profile we're testingsession- the session we're testing- Returns:
trueif the profile and/or sessions match the specified condition,falseotherwise
-
batchProfilesUpdate
public void batchProfilesUpdate(BatchUpdate update)
Description copied from interface:ProfileServiceUpdate all profiles in batch according to the specifiedBatchUpdate- Specified by:
batchProfilesUpdatein interfaceProfileService- Parameters:
update- the batch update specification
-
loadPersona
public Persona loadPersona(String personaId)
Description copied from interface:ProfileServiceRetrieves the persona identified by the specified identifier.- Specified by:
loadPersonain interfaceProfileService- Parameters:
personaId- the identifier of the persona to retrieve- Returns:
- the persona associated with the specified identifier or
nullif no such persona exists.
-
loadPersonaWithSessions
public PersonaWithSessions loadPersonaWithSessions(String personaId)
Description copied from interface:ProfileServiceRetrieves the persona identified by the specified identifier and all its associated sessions- Specified by:
loadPersonaWithSessionsin interfaceProfileService- Parameters:
personaId- the identifier of the persona to retrieve- Returns:
- a
PersonaWithSessionsinstance with the persona identified by the specified identifier and all its associated sessions
-
createPersona
public Persona createPersona(String personaId)
Description copied from interface:ProfileServiceCreates a persona with the specified identifier and automatically creates an associated session with it.- Specified by:
createPersonain interfaceProfileService- Parameters:
personaId- the identifier to use for the new persona- Returns:
- the newly created persona
-
getTargetPropertyTypes
public Collection<PropertyType> getTargetPropertyTypes(String target)
Description copied from interface:ProfileServiceRetrieves all the property types associated with the specified target. TODO: move to a different class- Specified by:
getTargetPropertyTypesin interfaceProfileService- Parameters:
target- the target for which we want to retrieve the associated property types- Returns:
- a collection of all the property types associated with the specified target
-
getTargetPropertyTypes
public Map<String,Collection<PropertyType>> getTargetPropertyTypes()
Description copied from interface:ProfileServiceRetrieves all known property types. TODO: move to a different class TODO: use Map instead of HashMap- Specified by:
getTargetPropertyTypesin interfaceProfileService- Returns:
- a Map associating targets as keys to related
PropertyTypes
-
getPropertyTypeByTag
public Set<PropertyType> getPropertyTypeByTag(String tag)
Description copied from interface:ProfileServiceRetrieves all property types with the specified tag TODO: move to a different class- Specified by:
getPropertyTypeByTagin interfaceProfileService- Parameters:
tag- the tag name marking property types we want to retrieve- Returns:
- a Set of the property types with the specified tag
-
getPropertyTypeBySystemTag
public Set<PropertyType> getPropertyTypeBySystemTag(String tag)
Description copied from interface:ProfileServiceRetrieves all property types with the specified system tag TODO: move to a different class- Specified by:
getPropertyTypeBySystemTagin interfaceProfileService- Parameters:
tag- the system tag name marking property types we want to retrieve- Returns:
- a Set of the property types with the specified system tag
-
getPropertyTypeByMapping
public Collection<PropertyType> getPropertyTypeByMapping(String propertyName)
Description copied from interface:ProfileServiceTODO- Specified by:
getPropertyTypeByMappingin interfaceProfileService- Parameters:
propertyName- the property name- Returns:
- list of property types
-
getPropertyType
public PropertyType getPropertyType(String id)
Description copied from interface:ProfileServiceRetrieves the property type identified by the specified identifier. TODO: move to a different class- Specified by:
getPropertyTypein interfaceProfileService- Parameters:
id- the identifier of the property type to retrieve- Returns:
- the property type identified by the specified identifier or
nullif no such property type exists
-
getPersonaSessions
public PartialList<Session> getPersonaSessions(String personaId, int offset, int size, String sortBy)
Description copied from interface:ProfileServiceRetrieves the sessions associated with the persona identified by the specified identifier, ordered according to the specifiedsortByString and and paged: onlysizeof them are retrieved, starting with theoffset-th one.- Specified by:
getPersonaSessionsin interfaceProfileService- Parameters:
personaId- the persona idoffset- zero or a positive integer specifying the position of the first session in the total ordered collection of matching sessionssize- a positive integer specifying how many matching sessions should be retrieved or-1if all of them should be retrievedsortBy- an optional (nullif no sorting is required) String of comma (,) separated property names on which ordering should be performed, ordering elements according to the property order in the String, considering each in turn and moving on to the next one in case of equality of all preceding ones. Each property name is optionally followed by a column (:) and an order specifier:ascordesc.- Returns:
- a
PartialListof sessions for the persona identified by the specified identifier
-
savePersonaWithSessions
public PersonaWithSessions savePersonaWithSessions(PersonaWithSessions personaToSave)
Description copied from interface:ProfileServiceSave a persona with its sessions.- Specified by:
savePersonaWithSessionsin interfaceProfileService- Parameters:
personaToSave- the persona object containing all the persona information and sessions- Returns:
- the persona with sessions
-
setPropertyTypeTarget
public void setPropertyTypeTarget(URL predefinedPropertyTypeURL, PropertyType propertyType)
Description copied from interface:ProfileServiceThis function will try to set the target on the property type if not set already, based on the file URL- Specified by:
setPropertyTypeTargetin interfaceProfileService- Parameters:
predefinedPropertyTypeURL- the URL to extract the target from if the target is not yet. By default it will use the 5's part after a "/" characterpropertyType- the property type to register
-
bundleChanged
public void bundleChanged(org.osgi.framework.BundleEvent event)
- Specified by:
bundleChangedin interfaceorg.osgi.framework.BundleListener
-
refresh
public void refresh()
Description copied from interface:ProfileServiceForces a refresh of the profile service, to load data from persistence immediately instead of waiting for scheduled tasks to execute. Warning : this may have serious impacts on performance so it should only be used in specific scenarios such as integration tests.- Specified by:
refreshin interfaceProfileService
-
-