public class KudosService extends Object implements ExoKudosStatisticService, org.picocontainer.Startable
| Constructor and Description |
|---|
KudosService(KudosStorage kudosStorage,
org.exoplatform.commons.api.settings.SettingService settingService,
org.exoplatform.social.core.space.spi.SpaceService spaceService,
org.exoplatform.social.core.manager.IdentityManager identityManager,
org.exoplatform.services.listener.ListenerService listenerService,
org.exoplatform.container.xml.InitParams params) |
| Modifier and Type | Method and Description |
|---|---|
long |
countKudosByEntity(String entityType,
String entityId) |
long |
countKudosByEntityAndSender(String entityType,
String entityId,
String senderIdentityId)
Count kudos sent by an identity using a dedicated entity (activity, comment,
profile header, tiptip...)
|
long |
countKudosByPeriodAndReceiver(long identityId,
long startDateInSeconds,
long endDateInSeconds)
Count kudos received by an identity in a period of time
|
long |
countKudosByPeriodAndSender(long senderIdentityId,
long startDateInSeconds,
long endDateInSeconds)
Count kudos sent by an identity in a period of time
|
Kudos |
createKudos(Kudos kudos,
String currentUser)
Create a new Kudos sent by current user
|
AccountSettings |
getAccountSettings(String username) |
KudosPeriod |
getCurrentKudosPeriod() |
KudosPeriodType |
getDefaultKudosPeriodType() |
GlobalSettings |
getGlobalSettings() |
List<Kudos> |
getKudosByEntity(String entityType,
String entityId,
int limit)
Retrieves a list of kudos sent using a dedicated entity (activity, comment,
profile header, tiptip...)
|
List<Kudos> |
getKudosByPeriod(long dateInSeconds,
KudosPeriodType periodType,
int limit)
Retrieves the list of kudos sent in a period of time.
|
List<Kudos> |
getKudosByPeriod(long startDateInSeconds,
long endDateInSeconds,
int limit)
Retrieves the list of kudos sent in a period of time.
|
List<Kudos> |
getKudosByPeriodAndReceiver(long identityId,
long startDateInSeconds,
long endDateInSeconds,
int limit)
Retrieves kudos received by an identity in a period of time
|
List<Kudos> |
getKudosByPeriodAndSender(long senderIdentityId,
long startDateInSeconds,
long endDateInSeconds,
int limit)
Retrieves Kudos list by sender identity Id
|
List<Kudos> |
getKudosByPeriodOfDate(long dateInSeconds,
int limit)
Retrieves the list of kudos sent in a period of time.
|
KudosPeriod |
getKudosPeriodOfTime(KudosPeriodType periodType,
long dateInSeconds) |
KudosPeriod |
getKudosPeriodOfTime(long dateInSeconds) |
Map<String,Object> |
getStatisticParameters(String operation,
Object result,
Object... methodArgs)
Retrieve statistic log parameters
|
boolean |
isAuthorizedOnKudosModule(String username)
Check if user is authorized to send/receive Kudos
|
void |
saveGlobalSettings(GlobalSettings settings)
Stores new parameters of Kudos module
|
void |
start() |
void |
stop() |
void |
updateKudosGeneratedActivityId(long kudosId,
long activityId)
Stores generated activity for created
Kudos |
public KudosService(KudosStorage kudosStorage, org.exoplatform.commons.api.settings.SettingService settingService, org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.services.listener.ListenerService listenerService, org.exoplatform.container.xml.InitParams params)
public void start()
start in interface org.picocontainer.Startablepublic void stop()
stop in interface org.picocontainer.Startablepublic GlobalSettings getGlobalSettings()
GlobalSettings of Kudos modulepublic void saveGlobalSettings(GlobalSettings settings)
settings - GlobalSettingspublic AccountSettings getAccountSettings(String username)
username - username to get its settingspublic Kudos createKudos(Kudos kudos, String currentUser) throws Exception
public void updateKudosGeneratedActivityId(long kudosId,
long activityId)
throws Exception
Kudospublic List<Kudos> getKudosByPeriod(long startDateInSeconds, long endDateInSeconds, int limit)
public List<Kudos> getKudosByPeriod(long dateInSeconds, KudosPeriodType periodType, int limit)
dateInSeconds - timestamp in secondsperiodType - KudosPeriodType used to compute real start and
end dates of periodlimit - limit of results size to retrieveList of Kudospublic List<Kudos> getKudosByPeriodOfDate(long dateInSeconds, int limit)
GlobalSettingspublic List<Kudos> getKudosByEntity(String entityType, String entityId, int limit)
entityType - entity type of type KudosEntityTypeentityId - entity technical idlimit - limit of results size to retrieveList of Kudospublic long countKudosByEntityAndSender(String entityType, String entityId, String senderIdentityId)
entityType - entity type of type KudosEntityTypeentityId - entity technical idsenderIdentityId - Identity technical idpublic long countKudosByPeriodAndSender(long senderIdentityId,
long startDateInSeconds,
long endDateInSeconds)
senderIdentityId - Identity technical idstartDateInSeconds - timestamp in secondsendDateInSeconds - timestamp in secondspublic List<Kudos> getKudosByPeriodAndSender(long senderIdentityId, long startDateInSeconds, long endDateInSeconds, int limit)
public long countKudosByPeriodAndReceiver(long identityId,
long startDateInSeconds,
long endDateInSeconds)
identityId - Identity technical idstartDateInSeconds - timestamp in secondsendDateInSeconds - timestamp in secondspublic List<Kudos> getKudosByPeriodAndReceiver(long identityId, long startDateInSeconds, long endDateInSeconds, int limit)
public boolean isAuthorizedOnKudosModule(String username)
username - username to checkpublic Map<String,Object> getStatisticParameters(String operation, Object result, Object... methodArgs)
ExoKudosStatisticServicegetStatisticParameters in interface ExoKudosStatisticServiceMap of parameters to include in statistic logpublic KudosPeriodType getDefaultKudosPeriodType()
public KudosPeriod getCurrentKudosPeriod()
public KudosPeriod getKudosPeriodOfTime(long dateInSeconds)
public KudosPeriod getKudosPeriodOfTime(KudosPeriodType periodType, long dateInSeconds)
Copyright © 2003–2020 eXo Platform SAS. All rights reserved.