public interface ProfileService
Modifier and Type | Field and Description |
---|---|
static String |
PERSONAL_IDENTIFIER_TAG_NAME |
Modifier and Type | Method and Description |
---|---|
void |
addAliasToProfile(String profileID,
String alias,
String clientID) |
void |
batchProfilesUpdate(BatchUpdate update)
Update all profiles in batch according to the specified
BatchUpdate |
Persona |
createPersona(String personaId)
Creates a persona with the specified identifier and automatically creates an associated session with it.
|
void |
delete(String profileId,
boolean persona)
Removes the profile (or persona if the
persona parameter is set to true ) identified by the specified identifier. |
boolean |
deletePropertyType(String propertyId)
Deletes the property type identified by the specified identifier.
|
String |
exportProfilesPropertiesToCsv(Query query)
Creates a String containing comma-separated values (CSV) formatted version of profiles matching the specified query.
|
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 specified
sortBy String and paged: only
size of them are retrieved, starting with the offset -th one. |
PartialList<Session> |
findProfileSessions(String profileId)
Retrieves sessions associated with the profile identified by the specified identifier.
|
long |
getAllProfilesCount()
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 field
ITEM_TYPE and 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
field
ITEM_TYPE and with the specified tag (system or regular)
TODO: move to a different class |
PartialList<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 specified
sortBy String and and paged: only
size of them are retrieved, starting with the offset -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 specified
sortBy String and and paged: only size of them are retrieved, starting with the offset -th one. |
PropertyType |
getPropertyType(String id)
Retrieves the property type identified by the specified identifier.
|
Collection<PropertyType> |
getPropertyTypeByMapping(String propertyName)
TODO
|
Set<PropertyType> |
getPropertyTypeBySystemTag(String tag)
Retrieves all property types with the specified system tag
TODO: move to a different class
|
Set<PropertyType> |
getPropertyTypeByTag(String tag)
Retrieves all property types with the specified tag
TODO: move to a different class
|
String |
getPropertyTypeMapping(String fromPropertyTypeId)
TODO
|
Map<String,Collection<PropertyType>> |
getTargetPropertyTypes()
Retrieves all known property types.
|
Collection<PropertyType> |
getTargetPropertyTypes(String target)
Retrieves all the property types associated with the specified target.
|
Profile |
load(String profileId)
Retrieves the profile identified by the specified identifier.
|
Persona |
loadPersona(String personaId)
Retrieves the persona identified by the specified identifier.
|
PersonaWithSessions |
loadPersonaWithSessions(String personaId)
Retrieves the persona identified by the specified identifier and all its associated sessions
|
Session |
loadSession(String sessionId,
Date dateHint)
Retrieves the session identified by the specified identifier.
|
boolean |
matchCondition(Condition condition,
Profile profile,
Session session)
Checks whether the specified profile and/or session satisfy the specified condition.
|
Profile |
mergeProfiles(Profile masterProfile,
List<Profile> profilesToMerge)
Merges the specified profiles into the provided so-called master profile, merging properties according to the
PropertyMergeStrategyType specified on their PropertyType . |
void |
refresh()
Forces a refresh of the profile service, to load data from persistence immediately instead of waiting for
scheduled tasks to execute.
|
void |
removeProfileSessions(String profileId)
Removes all sessions of the specified profile
|
Profile |
save(Profile profile)
Saves the specified profile in the context server.
|
Profile |
saveOrMerge(Profile profile)
Merge the specified profile properties in an existing profile,or save new profile if it does not exist yet
|
Persona |
savePersona(Persona persona)
Persists the specified
Persona in the context server. |
PersonaWithSessions |
savePersonaWithSessions(PersonaWithSessions personaToSave)
Save a persona with its sessions.
|
Session |
saveSession(Session session)
Saves the specified session.
|
<T extends Profile> |
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.
|
boolean |
setPropertyType(PropertyType property)
Persists the specified property type in the context server.
|
void |
setPropertyTypeTarget(URL predefinedPropertyTypeURL,
PropertyType propertyType)
This function will try to set the target on the property type if not set already, based on the file URL
|
static final String PERSONAL_IDENTIFIER_TAG_NAME
long getAllProfilesCount()
<T extends Profile> PartialList<T> search(Query query, Class<T> clazz)
T
- the specific sub-type of Profile
to retrievequery
- a Query
specifying which elements to retrieveclazz
- the class of elements to retrievePartialList
of T
instances matching the specified queryPartialList<Session> searchSessions(Query query)
query
- a Query
specifying which elements to retrievePartialList
of sessions matching the specified queryString exportProfilesPropertiesToCsv(Query query)
query
- the query specifying which profiles to exportPartialList<Profile> findProfilesByPropertyValue(String propertyName, String propertyValue, int offset, int size, String sortBy)
sortBy
String and paged: only
size
of them are retrieved, starting with the offset
-th one.
TODO: replace with version using a query instead of separate parameters
TODO: remove as it's unused?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 -1
if all of them should be retrievedsortBy
- an optional (null
if 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: asc
or desc
.PartialList
of matching profilesProfile mergeProfiles(Profile masterProfile, List<Profile> profilesToMerge)
PropertyMergeStrategyType
specified on their PropertyType
.masterProfile
- the profile into which the specified profiles will be mergedprofilesToMerge
- the list of profiles to merge into the specified master profileProfile load(String profileId)
profileId
- the identifier of the profile to retrievenull
if no such profile existsProfile save(Profile profile)
profile
- the profile to be savedProfile saveOrMerge(Profile profile)
profile
- the profile to be savedvoid delete(String profileId, boolean persona)
persona
parameter is set to true
) identified by the specified identifier.profileId
- the identifier of the profile or persona to deletepersona
- true
if the specified identifier is supposed to refer to a persona, false
if it is supposed to refer to a profilePartialList<Session> getProfileSessions(String profileId, String query, int offset, int size, String sortBy)
sortBy
String and and paged: only size
of them are retrieved, starting with the offset
-th one.
TODO: use a Query object instead of distinct parameterprofileId
- 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 or null
(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 -1
if all of them should be retrievedsortBy
- an optional (null
if 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: asc
or desc
.PartialList
of matching sessionsSession loadSession(String sessionId, Date dateHint)
sessionId
- the identifier of the session to be retrieveddateHint
- a Date helping in identifying where the item is locatedSession saveSession(Session session)
session
- the session to be savedPartialList<Session> findProfileSessions(String profileId)
profileId
- the profile id for which we want to retrieve the sessionsPartialList
of the profile's sessionsvoid removeProfileSessions(String profileId)
profileId
- identifier of the profile that we want to remove it's sessionsboolean matchCondition(Condition condition, Profile profile, Session session)
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 testingtrue
if the profile and/or sessions match the specified condition, false
otherwisevoid batchProfilesUpdate(BatchUpdate update)
BatchUpdate
update
- the batch update specificationPersona loadPersona(String personaId)
personaId
- the identifier of the persona to retrievenull
if no such persona exists.Persona savePersona(Persona persona)
Persona
in the context server.persona
- the persona to persistPersonaWithSessions loadPersonaWithSessions(String personaId)
personaId
- the identifier of the persona to retrievePersonaWithSessions
instance with the persona identified by the specified identifier and all its associated sessionsPersona createPersona(String personaId)
personaId
- the identifier to use for the new personaPartialList<Session> getPersonaSessions(String personaId, int offset, int size, String sortBy)
sortBy
String and and paged: only
size
of them are retrieved, starting with the offset
-th one.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 -1
if all of them should be retrievedsortBy
- an optional (null
if 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: asc
or desc
.PartialList
of sessions for the persona identified by the specified identifierPersonaWithSessions savePersonaWithSessions(PersonaWithSessions personaToSave)
personaToSave
- the persona object containing all the persona information and sessionsCollection<PropertyType> getTargetPropertyTypes(String target)
target
- the target for which we want to retrieve the associated property typesMap<String,Collection<PropertyType>> getTargetPropertyTypes()
PropertyType
sSet<PropertyType> getPropertyTypeByTag(String tag)
tag
- the tag name marking property types we want to retrieveSet<PropertyType> getPropertyTypeBySystemTag(String tag)
tag
- the system tag name marking property types we want to retrieveString getPropertyTypeMapping(String fromPropertyTypeId)
fromPropertyTypeId
- fromPropertyTypeIdCollection<PropertyType> getPropertyTypeByMapping(String propertyName)
propertyName
- the property namePropertyType getPropertyType(String id)
id
- the identifier of the property type to retrievenull
if no such property type existsboolean setPropertyType(PropertyType property)
property
- the property type to persisttrue
if the property type was properly created, false
otherwise (for example, if the property type already existedvoid setPropertyTypeTarget(URL predefinedPropertyTypeURL, PropertyType propertyType)
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 registerboolean deletePropertyType(String propertyId)
propertyId
- the identifier of the property type to deletetrue
if the property type was properly deleted, false
otherwiseSet<PropertyType> getExistingProperties(String tag, String itemType)
ITEM_TYPE
and with the specified tag.
TODO: move to a different classtag
- 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_TYPE
fieldSet<PropertyType> getExistingProperties(String tag, String itemType, boolean systemTag)
ITEM_TYPE
and with the specified tag (system or regular)
TODO: move to a different classtag
- 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_TYPE
fieldsystemTag
- whether the specified is a system tag or a regular onevoid refresh()
Copyright © 2014–2022 Apache Software Foundation. All rights reserved.