Class UserTrackingServiceImpl
java.lang.Object
org.opencastproject.usertracking.impl.UserTrackingServiceImpl
- All Implemented Interfaces:
UserTrackingService,org.osgi.service.cm.ManagedService
public class UserTrackingServiceImpl
extends Object
implements UserTrackingService, org.osgi.service.cm.ManagedService
Implementation of org.opencastproject.usertracking.api.UserTrackingService
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DBSessionprotected DBSessionFactorystatic final Stringprotected javax.persistence.EntityManagerFactoryThe factory used to generate the entity managerstatic final Stringstatic final Stringstatic final StringJPA persistence unit namestatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Activation callback to be executed once all dependencies are setaddUserFootprint(UserAction action, UserSession session) Adds a new annotation to the database and returns the event with an updated annotationId, to make sure the annotationId stays uniqueaddUserTrackingEvent(UserAction a, UserSession session) Adds a new tracking event to the database and returns the event with an updated annotationId, to make sure the annotationId stays uniquegetFootprints(String mediapackageId, String userId) Returns a list of footprints, if a userId is passed only the footprints of that user are returned.getReport(int offset, int limit) Returns a reportReturns a reportgetUserAction(Long id) Get a single user action by its identifier.getUserActions(int offset, int limit) Returns annotationsgetUserActionsByDay(String day, int offset, int limit) Returns annotations of a given day (YYYYMMDD)getUserActionsByType(String type, int offset, int limit) Returns annotations of a given keygetUserActionsByTypeAndDay(String type, String day, int offset, int limit) Returns annotations of a given key and daygetUserActionsByTypeAndMediapackageId(String type, String mediapackageId, int offset, int limit) Returns annotations of a given key and mediapackage idgetUserActionsByTypeAndMediapackageIdByDate(String type, String mediapackageId, int offset, int limit) Returns annotations of a given key and mediapackage id ordered by date.getUserActionsByTypeAndMediapackageIdByDescendingDate(String type, String mediapackageId, int offset, int limit) Returns annotations of a given key and mediapackage id ordered descending by date.booleanReturns the flag turning user tracking on or off.intReturns the views of a mediapackagevoidsetDBSessionFactory(DBSessionFactory dbSessionFactory) voidupdated(Dictionary props)
-
Field Details
-
PERSISTENCE_UNIT
JPA persistence unit name- See Also:
-
FOOTPRINT_KEY
- See Also:
-
DETAILED_TRACKING
- See Also:
-
IP_LOGGING
- See Also:
-
USER_LOGGING
- See Also:
-
SESSION_LOGGING
- See Also:
-
emf
protected javax.persistence.EntityManagerFactory emfThe factory used to generate the entity manager -
dbSessionFactory
-
db
-
-
Constructor Details
-
UserTrackingServiceImpl
public UserTrackingServiceImpl()
-
-
Method Details
-
setDBSessionFactory
-
activate
public void activate()Activation callback to be executed once all dependencies are set -
updated
- Specified by:
updatedin interfaceorg.osgi.service.cm.ManagedService- Throws:
org.osgi.service.cm.ConfigurationException
-
getViews
Description copied from interface:UserTrackingServiceReturns the views of a mediapackage- Specified by:
getViewsin interfaceUserTrackingService- Parameters:
mediapackageId- the mediapackeId- Returns:
- the views
-
addUserFootprint
public UserAction addUserFootprint(UserAction action, UserSession session) throws UserTrackingException Description copied from interface:UserTrackingServiceAdds a new annotation to the database and returns the event with an updated annotationId, to make sure the annotationId stays unique- Specified by:
addUserFootprintin interfaceUserTrackingService- Parameters:
action- The UserAction that will be added to the databasesession- The UserSession associated with this footprint- Returns:
- the updated annotation, with a new ID. NULL if there are errors while adding the annotation.
- Throws:
UserTrackingException- if the user tracking service encounters an error
-
addUserTrackingEvent
public UserAction addUserTrackingEvent(UserAction a, UserSession session) throws UserTrackingException Description copied from interface:UserTrackingServiceAdds a new tracking event to the database and returns the event with an updated annotationId, to make sure the annotationId stays unique- Specified by:
addUserTrackingEventin interfaceUserTrackingService- Parameters:
a- The UserAction that will be added to the databasesession- The UserSession associated with this footprint- Returns:
- the updated annotation, with a new ID. NULL if there are errors while adding the annotation.
- Throws:
UserTrackingException- if the user tracking service encounters an error
-
getUserActions
Description copied from interface:UserTrackingServiceReturns annotations- Specified by:
getUserActionsin interfaceUserTrackingService- Parameters:
offset- the offsetlimit- the limit- Returns:
- the annotation list
-
getUserActionsByType
Description copied from interface:UserTrackingServiceReturns annotations of a given key- Specified by:
getUserActionsByTypein interfaceUserTrackingService- Parameters:
type- The annotation keyoffset- the offsetlimit- the limit- Returns:
- the annotation list
-
getUserActionsByTypeAndMediapackageId
public UserActionList getUserActionsByTypeAndMediapackageId(String type, String mediapackageId, int offset, int limit) Description copied from interface:UserTrackingServiceReturns annotations of a given key and mediapackage id- Specified by:
getUserActionsByTypeAndMediapackageIdin interfaceUserTrackingService- Parameters:
type- the annotation keymediapackageId- the mediapackage idoffset- the offsetlimit- the limit- Returns:
- the annotation list
-
getUserActionsByTypeAndDay
Description copied from interface:UserTrackingServiceReturns annotations of a given key and day- Specified by:
getUserActionsByTypeAndDayin interfaceUserTrackingService- Parameters:
type- the annotation keyday- the dayoffset- the offsetlimit- the limit- Returns:
- the annotation list
-
getUserActionsByTypeAndMediapackageIdByDate
public UserActionList getUserActionsByTypeAndMediapackageIdByDate(String type, String mediapackageId, int offset, int limit) Description copied from interface:UserTrackingServiceReturns annotations of a given key and mediapackage id ordered by date.- Specified by:
getUserActionsByTypeAndMediapackageIdByDatein interfaceUserTrackingService- Parameters:
type- the annotation keymediapackageId- the mediapackage idoffset- the offsetlimit- the limit- Returns:
- the annotation list
-
getUserActionsByTypeAndMediapackageIdByDescendingDate
public UserActionList getUserActionsByTypeAndMediapackageIdByDescendingDate(String type, String mediapackageId, int offset, int limit) Description copied from interface:UserTrackingServiceReturns annotations of a given key and mediapackage id ordered descending by date.- Specified by:
getUserActionsByTypeAndMediapackageIdByDescendingDatein interfaceUserTrackingService- Parameters:
type- the annotation keymediapackageId- the mediapackage idoffset- the offsetlimit- the limit- Returns:
- the annotation list
-
getUserActionsByDay
Description copied from interface:UserTrackingServiceReturns annotations of a given day (YYYYMMDD)- Specified by:
getUserActionsByDayin interfaceUserTrackingService- Parameters:
day- The day in the format of YYYYMMDDoffset- the offsetlimit- the limit- Returns:
- the annotation list
-
getReport
Description copied from interface:UserTrackingServiceReturns a report- Specified by:
getReportin interfaceUserTrackingService- Parameters:
offset- the offsetlimit- the limit- Returns:
- the report
-
getReport
Description copied from interface:UserTrackingServiceReturns a report- Specified by:
getReportin interfaceUserTrackingService- Parameters:
from- The from day keyto- The to day keyoffset- the offsetlimit- the limit- Returns:
- the report
- Throws:
ParseException
-
getFootprints
Description copied from interface:UserTrackingServiceReturns a list of footprints, if a userId is passed only the footprints of that user are returned.- Specified by:
getFootprintsin interfaceUserTrackingService- Parameters:
mediapackageId- The mediapackageIduserId- The userId is optional- Returns:
- the footprintList
-
getUserAction
Get a single user action by its identifier.- Specified by:
getUserActionin interfaceUserTrackingService- Parameters:
id- the user action identifier- Returns:
- the user action
- Throws:
UserTrackingException- if the user tracking service encounters an errorNotFoundException- if the no user action with this identifier exists- See Also:
-
getUserTrackingEnabled
public boolean getUserTrackingEnabled()Returns the flag turning user tracking on or off. Turning user tracking off disables the detailed information gathering, but does *not* disable footprint gathering.- Specified by:
getUserTrackingEnabledin interfaceUserTrackingService- Returns:
- True if detailed user tracking should be gathered, false otherwise
- See Also:
-