public class ReaderTrackerManager extends BasicDBListener implements JaliosConstants, DBConstants, JPropertiesListener
Modifier and Type | Class and Description |
---|---|
class |
ReaderTrackerManager.CacheEntry |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
READER_TRACKER_ANONYMIZE_PROP |
static java.lang.String |
READER_TRACKER_ENABLED_PROP |
static java.lang.String |
READER_TRACKER_TYPES_PROP |
static java.lang.String |
REVISION |
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
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
Modifier and Type | Method and Description |
---|---|
void |
anonymizeAllReaderTracker(Member mbr) |
boolean |
canAccessReaderTracker(Publication pub,
Member mbr) |
boolean |
canDeleteReaderTracker(Publication pub,
Member mbr) |
int |
getAccessCount(java.util.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.
|
int |
getAnonymousReaderAccessCount(Publication pub) |
int |
getAnonymousReaderDownloadCount(Publication pub) |
int |
getAuthentifiedReaderAccessCount(Publication pub) |
int |
getAuthentifiedReaderDownloadCount(Publication pub) |
int |
getAuthentifiedReaderUniqueAccessCount(Publication pub) |
int |
getAuthentifiedReaderUniqueDownloadCount(Publication pub) |
int |
getDownloadCount(Publication pub)
Returns the download count for the given publication for authentified users.
|
static ReaderTrackerManager |
getInstance() |
java.util.List<ReaderTrackerEntry> |
getMergedReaderTrackerList(java.util.List<ReaderTracker> readerList,
ReaderTrackerEntry.Sort Sort,
boolean isReverse) |
java.util.List<ReaderTrackerEntry> |
getMergedReaderTrackerList(Publication pub,
ReaderTrackerEntry.Sort Sort,
boolean isReverse) |
int |
getReaderAccessCount(Publication pub) |
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.
|
ReaderTracker |
getReaderTracker(Publication pub,
Member mbr,
int accessType)
Returns the ReaderTracker for the given Publication and the given Member.
|
java.util.List |
getReaderTrackerList(Publication pub)
Returns the reader list for the given publication.
|
java.util.List |
getReaderTrackerList(Publication pub,
int accessType) |
java.util.List |
getReaderTrackerList(Publication pub,
java.lang.String orderBy,
boolean reverse,
int accessType) |
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.
|
boolean |
isReaderTrackerAnonymized() |
boolean |
isReaderTrackerEnabled() |
boolean |
isTracked(Publication pub) |
boolean |
isTypeReaderTracked(java.lang.Class clazz)
Returns true if the given class is reader tracked
|
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 |
propertiesChange(JProperties properties)
Invoked after properties have been modified in JCMS and save on disk.
|
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.
|
void |
track(Publication pub,
Member mbr,
int accessType)
Tracks the given member for the given publication and for given access Type.
|
getAdateFromState, getAuthorIdFromState, getCdateFromState, getEdateFromState, getMdateFromState, getPdateFromState, getPrePstatus, getPrePstatus, getPstatusFromState, hasNoChange, hasNoChange, init, onPreUpdate
public static final java.lang.String READER_TRACKER_ANONYMIZE_PROP
public static final java.lang.String READER_TRACKER_TYPES_PROP
public static final java.lang.String READER_TRACKER_ENABLED_PROP
public static final java.lang.String REVISION
public static ReaderTrackerManager getInstance()
public void propertiesChange(JProperties properties)
JPropertiesListener
You cannot alter the value received in parameters.
propertiesChange
in interface JPropertiesListener
properties
- the properties which have been modified (may not contain all JCMS properties)public boolean isReaderTrackerEnabled()
public boolean isReaderTrackerAnonymized()
public boolean isTypeReaderTracked(java.lang.Class clazz)
clazz
- the class to checkpublic boolean isTracked(Publication pub)
pub
- the Publication
public int getReaderCount(Publication pub)
pub
- the publicationpublic int getReaderAccessCount(Publication pub)
pub
- the Publication
public int getAuthentifiedReaderUniqueAccessCount(Publication pub)
pub
- the Publication
public int getAuthentifiedReaderAccessCount(Publication pub)
pub
- the Publication
public int getAnonymousReaderAccessCount(Publication pub)
pub
- the Publication
public java.util.List getReaderTrackerList(Publication pub)
pub
- the publicationpublic java.util.List getReaderTrackerList(Publication pub, int accessType)
pub
- accessType
- public java.util.List getReaderTrackerList(Publication pub, java.lang.String orderBy, boolean reverse, int accessType)
pub
- the Publication
orderBy
- the orderby of the queryreverse
- to defines the order of the queryaccessType
- the type of accesspublic java.util.List<ReaderTrackerEntry> getMergedReaderTrackerList(Publication pub, ReaderTrackerEntry.Sort Sort, boolean isReverse)
pub
- the tracked Publication
Sort
- the ReaderTrackerEntry.Sort
of the queryisReverse
- true to sort results reversedReaderTrackerEntry
which merges a ReaderTracker
List to avoid duplicatespublic java.util.List<ReaderTrackerEntry> getMergedReaderTrackerList(java.util.List<ReaderTracker> readerList, ReaderTrackerEntry.Sort Sort, boolean isReverse)
readerList
- the list of ReaderTracker
Sort
- the ReaderTrackerEntry.Sort
of the queryisReverse
- true to sort results reversedReaderTrackerEntry
which merges a ReaderTracker
List to avoid duplicatespublic ReaderTracker getReaderTracker(Publication pub, Member mbr)
pub
- the publicationmbr
- the memberpublic ReaderTracker getReaderTracker(Publication pub, Member mbr, int accessType)
pub
- the publicationmbr
- the memberpublic int getDownloadCount(Publication pub)
pub
- the publicationpublic int getAuthentifiedReaderUniqueDownloadCount(Publication pub)
pub
- the Publication
public int getAuthentifiedReaderDownloadCount(Publication pub)
pub
- the Publication
public int getAnonymousReaderDownloadCount(Publication pub)
pub
- the Publication
public int getAccessCount(Publication pub)
pub
- the publication.public int getAccessCount(java.util.List<ReaderTracker> list)
list
- a list of ReaderTrackerpublic boolean isReader(Publication pub, Member mbr)
pub
- the publicationmbr
- the memberpublic void track(Publication pub, Member mbr)
pub
- the publicationmbr
- the reader to be tracked (may be null)public void track(Publication pub, Member mbr, int accessType)
pub
- the publicationmbr
- the reader to be tracked (may be null)accessType
- the type of accesspublic void removeAllReaderTracker(Publication pub)
pub
- the publicationpublic void removeAllReaderTracker(Member mbr, boolean anonymize)
mbr
- the memberanonymize
- if true report all the access of this member as anonymous access.public void anonymizeAllReaderTracker(Member mbr)
public boolean canAccessReaderTracker(Publication pub, Member mbr)
pub
- the Publication
mbr
- the Member
public boolean canDeleteReaderTracker(Publication pub, Member mbr)
pub
- the Publication
mbr
- the Member
public void invalidateCacheEntry(Publication pub)
pub
- the publication idpublic void invalidateAllCacheEntries()
public void onPostInsert(DBData data, org.hibernate.event.PostInsertEvent event, boolean firstTime)
onPostInsert
in interface DBListener
onPostInsert
in class BasicDBListener
DBListener.onPostInsert(DBData, PostInsertEvent, boolean)
public void onPostUpdate(DBData data, org.hibernate.event.PostUpdateEvent event, boolean firstTime)
onPostUpdate
in interface DBListener
onPostUpdate
in class BasicDBListener
DBListener.onPostUpdate(DBData, PostUpdateEvent, boolean)
public void onPostDelete(DBData data, org.hibernate.event.PostDeleteEvent event, boolean firstTime)
onPostDelete
in interface DBListener
onPostDelete
in class BasicDBListener
DBListener.onPostDelete(DBData, PostDeleteEvent, boolean)
Copyright © 2001-2010 Jalios SA. All Rights Reserved.