com.jalios.jcms.tracking
Class ReaderTrackerManager

java.lang.Object
  extended by com.jalios.jcms.db.BasicDBListener
      extended by com.jalios.jcms.tracking.ReaderTrackerManager
All Implemented Interfaces:
DBConstants, DBListener, PluginComponent, JaliosConstants

public class ReaderTrackerManager
extends BasicDBListener
implements JaliosConstants, DBConstants


Nested Class Summary
 class ReaderTrackerManager.CacheEntry
           
 
Field Summary
static String REVISION
           
 
Fields inherited from interface com.jalios.util.JaliosConstants
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR
 
Fields inherited from interface com.jalios.jcms.db.DBConstants
ALL_CATEGORIES_SET_FIELD, AUTH_GRP_SET_FIELD, AUTH_MBR_SET_FIELD, AUTHOR_ID_FIELD, CATEGORIES_SET_FIELD, CDATE_FIELD, CHANNEL_JCMSDB_PROP, DBDATA_URID, HAS_NO_READ_RIGHTS, HIBERNATE_MAPPING_ADATE, HIBERNATE_MAPPING_AUTHOR, HIBERNATE_MAPPING_CDATE, HIBERNATE_MAPPING_EDATE, HIBERNATE_MAPPING_MDATE, HIBERNATE_MAPPING_PDATE, HIBERNATE_MAPPING_PSTATUS, HIBERNATE_MAPPING_TITLE, HIBERNATE_MAPPING_WORKFLOW_ID, HIBERNATE_MAPPING_WORKSPACE_ID, MDATE_FIELD, PSTATUS_FIELD, ROW_ID_FIELD, SCROLL_FETCH_SIZE, WORKFLOW_ID_FIELD, WORKSPACE_ID_FIELD
 
Method Summary
 void anonymizeAllReaderTracker(Member mbr)
           
 int getAccessCount(List<ReaderTracker> list)
          Returns the sum of access count for the list of ReaderTracker.
 int getAccessCount(Publication pub)
          Returns the sum of access count for the given publication.
static ReaderTrackerManager getInstance()
           
 Set<ReaderTrackerEntry> getMergedReaderTrackerSet(List<ReaderTracker> readerList, ReaderTrackerEntry.Sort Sort, boolean isReverse)
          Returns a List of ReaderTrackerEntry which merges a ReaderTracker List to avoid duplicates
 Set<ReaderTrackerEntry> getMergedReaderTrackerSet(Publication pub, ReaderTrackerEntry.Sort Sort, boolean isReverse)
           
 int getReaderCount(Publication pub)
          Returns the reader count for the given publication.
 ReaderTracker getReaderTracker(Publication pub, Member mbr)
          Returns the ReaderTracker for the given Publication and the given Member.
 List getReaderTrackerList(Publication pub)
          Returns the reader list for the given publication.
 List getReaderTrackerList(Publication pub, String orderBy, boolean reverse)
           
 void invalidateAllCacheEntries()
          Invalidate all the cache entries.
 void invalidateCacheEntry(Publication pub)
          Invalidate the cache entries for the given publication
 boolean isReader(Publication pub, Member mbr)
          Returns true if the given publication has been read by the given member.
 void onPostDelete(DBData data, org.hibernate.event.PostDeleteEvent event, boolean firstTime)
           
 void onPostInsert(DBData data, org.hibernate.event.PostInsertEvent event, boolean firstTime)
           
 void onPostUpdate(DBData data, org.hibernate.event.PostUpdateEvent event, boolean firstTime)
           
 void removeAllReaderTracker(Member mbr, boolean anonymize)
          Removes all the ReaderTracekr bound to the given member ; and optionally report all the access of this member as anonymous access.
 void removeAllReaderTracker(Publication pub)
          Removes all the ReaderTracker bound to the given publication.
 void track(Publication pub, Member mbr)
          Tracks the given member for the given publication.
 
Methods inherited from class com.jalios.jcms.db.BasicDBListener
getAdateFromState, getAuthorIdFromState, getCdateFromState, getEdateFromState, getMdateFromState, getPdateFromState, getPrePstatus, getPrePstatus, getPstatusFromState, hasNoChange, hasNoChange, init, onPreUpdate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Method Detail

getInstance

public static ReaderTrackerManager getInstance()

getReaderCount

public int getReaderCount(Publication pub)
Returns the reader count for the given publication.

Parameters:
pub - the publication
Returns:
the reader count for the given publication.
Since:
jcms-6.0.0

getReaderTrackerList

public List getReaderTrackerList(Publication pub)
Returns the reader list for the given publication.

Parameters:
pub - the publication
Returns:
the reader list for the given publication.
Since:
jcms-6.0.0

getReaderTrackerList

public List getReaderTrackerList(Publication pub,
                                 String orderBy,
                                 boolean reverse)
Parameters:
pub - the Publication
orderBy - the orderby of the query
reverse - to defines the order of the query
Returns:
the list of ReaderTracker for given access type and for given parameters
Since:
jcms-8.0.0

getMergedReaderTrackerSet

public Set<ReaderTrackerEntry> getMergedReaderTrackerSet(Publication pub,
                                                         ReaderTrackerEntry.Sort Sort,
                                                         boolean isReverse)
Parameters:
pub - the tracked Publication
Sort - the ReaderTrackerEntry.Sort of the query
isReverse - true to sort results reversed
Returns:
a List of ReaderTrackerEntry which merges a ReaderTracker List to avoid duplicates
Since:
jcms-7.1.3

getMergedReaderTrackerSet

public Set<ReaderTrackerEntry> getMergedReaderTrackerSet(List<ReaderTracker> readerList,
                                                         ReaderTrackerEntry.Sort Sort,
                                                         boolean isReverse)
Returns a List of ReaderTrackerEntry which merges a ReaderTracker List to avoid duplicates

Parameters:
readerList - the list of ReaderTracker
Sort - the ReaderTrackerEntry.Sort of the query
isReverse - true to sort results reversed
Returns:
a List of ReaderTrackerEntry which merges a ReaderTracker List to avoid duplicates
Since:
jcms-7.1.3

getReaderTracker

public ReaderTracker getReaderTracker(Publication pub,
                                      Member mbr)
Returns the ReaderTracker for the given Publication and the given Member.

Parameters:
pub - the publication
mbr - the member
Returns:
the ReaderTracker for the given Publication and the given Member.
Since:
jcms-6.0.0

getAccessCount

public int getAccessCount(Publication pub)
Returns the sum of access count for the given publication.

Parameters:
pub - the publication.
Returns:
the sum of access count for the given publication.
Since:
jcms-6.0.0

getAccessCount

public int getAccessCount(List<ReaderTracker> list)
Returns the sum of access count for the list of ReaderTracker.

Parameters:
list - a list of ReaderTracker
Returns:
the sum of access count for the list of ReaderTracker.
Since:
jcms-6.0.0

isReader

public boolean isReader(Publication pub,
                        Member mbr)
Returns true if the given publication has been read by the given member.

Parameters:
pub - the publication
mbr - the member
Returns:
true if the given publication has been read by the given member.
Since:
jcms-6.0.0

track

public void track(Publication pub,
                  Member mbr)
Tracks the given member for the given publication.

Parameters:
pub - the publication
mbr - the reader to be tracked (may be null)
Since:
jcms-6.0.0

removeAllReaderTracker

public void removeAllReaderTracker(Publication pub)
Removes all the ReaderTracker bound to the given publication.

Parameters:
pub - the publication
Since:
jcms-6.0.0

removeAllReaderTracker

public void removeAllReaderTracker(Member mbr,
                                   boolean anonymize)
Removes all the ReaderTracekr bound to the given member ; and optionally report all the access of this member as anonymous access.

Parameters:
mbr - the member
anonymize - if true report all the access of this member as anonymous access.
Since:
jcms-6.0.0

anonymizeAllReaderTracker

public void anonymizeAllReaderTracker(Member mbr)

invalidateCacheEntry

public void invalidateCacheEntry(Publication pub)
Invalidate the cache entries for the given publication

Parameters:
pub - the publication id
Since:
jcms-6.1.2

invalidateAllCacheEntries

public void invalidateAllCacheEntries()
Invalidate all the cache entries.

Since:
jcms-6.1.2

onPostInsert

public void onPostInsert(DBData data,
                         org.hibernate.event.PostInsertEvent event,
                         boolean firstTime)
Specified by:
onPostInsert in interface DBListener
Overrides:
onPostInsert in class BasicDBListener
See Also:
DBListener.onPostInsert(DBData, PostInsertEvent, boolean)

onPostUpdate

public void onPostUpdate(DBData data,
                         org.hibernate.event.PostUpdateEvent event,
                         boolean firstTime)
Specified by:
onPostUpdate in interface DBListener
Overrides:
onPostUpdate in class BasicDBListener
See Also:
DBListener.onPostUpdate(DBData, PostUpdateEvent, boolean)

onPostDelete

public void onPostDelete(DBData data,
                         org.hibernate.event.PostDeleteEvent event,
                         boolean firstTime)
Specified by:
onPostDelete in interface DBListener
Overrides:
onPostDelete in class BasicDBListener
See Also:
DBListener.onPostDelete(DBData, PostDeleteEvent, boolean)


Copyright © 2001-2010 Jalios SA. All Rights Reserved.