Java Code Examples for com.hazelcast.core.IMap#aggregate()

The following examples show how to use com.hazelcast.core.IMap#aggregate() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CallOutQuene.java    From youkefu with Apache License 2.0 6 votes vote down vote up
/**
 * 获得 当前服务状态
 * @param orgi
 * @return
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public static AgentReport getCallCenterAgentReport(String orgi){
	/**
	 * 统计当前在线的坐席数量
	 */
	AgentReport report = new AgentReport() ;
	IMap callCenterAgentMap = (IMap<String, Object>) CacheHelper.getCallCenterAgentCacheBean().getCache() ;
	Long agents = (Long) callCenterAgentMap.aggregate(Aggregators.<Map.Entry<String, CallCenterAgent>>count(), new CallCenterAgentOrgiFilterPredicate(orgi)) ;
	report.setAgents(agents.intValue());
	
	Long readyAgent = (Long) callCenterAgentMap.aggregate(Aggregators.<Map.Entry<String, CallCenterAgent>>count(), new CallCenterAgentReadyOrgiFilterPredicate(orgi)) ;
	report.setReadyagents(readyAgent.intValue());
	
	Long inCallAgent = (Long) callCenterAgentMap.aggregate(Aggregators.<Map.Entry<String, CallCenterAgent>>count(), new CallCenterInCallOrgiFilterPredicate(orgi)) ;
	report.setIncall(inCallAgent.intValue());
	
	report.setOrgi(orgi);
	return report;
}
 
Example 2
Source File: ServiceQuene.java    From youkefu with Apache License 2.0 5 votes vote down vote up
/**
 * 获得 当前服务状态
 * @param orgi
 * @return
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public static AgentReport getAgentReport(String orgi){
	/**
	 * 统计当前在线的坐席数量
	 */
	AgentReport report = new AgentReport() ;
	IMap agentStatusMap = (IMap<String, Object>) CacheHelper.getAgentStatusCacheBean().getCache() ;
	Long agents = (Long) agentStatusMap.aggregate(Aggregators.<Map.Entry<String, AgentStatus>>count(), new AgentStatusOrgiFilterPredicate(orgi)) ;
	report.setAgents(agents.intValue());
	
	Long busyAgent = (Long) agentStatusMap.aggregate(Aggregators.<Map.Entry<String, AgentStatus>>count(), new AgentStatusBusyOrgiFilterPredicate(orgi)) ;
	report.setBusy(busyAgent.intValue());
	report.setOrgi(orgi);
	
	/**
	 * 统计当前服务中的用户数量
	 */
	IMap agentUserMap = (IMap<String, Object>) CacheHelper.getAgentUserCacheBean().getCache() ;
	Long users = (Long) agentUserMap.aggregate(Aggregators.<Map.Entry<String, AgentUser>>count(), new AgentUserOrgiFilterPredicate(orgi,UKDataContext.AgentUserStatusEnum.INSERVICE.toString())) ;
	report.setUsers(users.intValue());
	
	Long queneUsers = (Long) agentUserMap.aggregate(Aggregators.<Map.Entry<String, AgentUser>>count(), new AgentUserOrgiFilterPredicate(orgi,UKDataContext.AgentUserStatusEnum.INQUENE.toString())) ;
	report.setInquene(queneUsers.intValue());
	
	return report;
}
 
Example 3
Source File: CallOutQuene.java    From youkefu with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({ "unchecked", "rawtypes" })
public static int countAiCallOut(String orgi) {
	/**
	 * 统计当前在线的坐席数量
	 */
	IMap callOutMap = (IMap<String, Object>) CacheHelper.getCallOutCacheBean().getCache() ;
	Long names = (Long) callOutMap.aggregate(Aggregators.<Map.Entry<String, CallOutNames>>count(), new AiCallOutFilterPredicate(orgi)) ;
	return names!=null ? names.intValue() : 0 ;
}
 
Example 4
Source File: CallOutQuene.java    From youkefu with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({ "unchecked", "rawtypes" })
public static int countAiCallOut(String orgi,String ownerai) {
	/**
	 * 统计当前在线的坐席数量
	 */
	IMap callOutMap = (IMap<String, Object>) CacheHelper.getCallOutCacheBean().getCache() ;
	Long names = (Long) callOutMap.aggregate(Aggregators.<Map.Entry<String, CallOutNames>>count(), new AiCallOutFilterPredicate(orgi,ownerai)) ;
	return names!=null ? names.intValue() : 0 ;
}
 
Example 5
Source File: CallOutQuene.java    From youkefu with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({ "unchecked", "rawtypes" })
public static int countAgentCallOut(String orgi) {
	/**
	 * 统计当前在线的坐席数量
	 */
	IMap callOutMap = (IMap<String, Object>) CacheHelper.getCallOutCacheBean().getCache() ;
	Long names = (Long) callOutMap.aggregate(Aggregators.<Map.Entry<String, CallOutNames>>count(), new AgentCallOutFilterPredicate(orgi)) ;
	return names!=null ? names.intValue() : 0 ;
}
 
Example 6
Source File: CallOutQuene.java    From youkefu with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({ "unchecked", "rawtypes" })
public static int countForecastCallOut(String orgi) {
	/**
	 * 统计当前在线的坐席数量
	 */
	IMap callOutMap = (IMap<String, Object>) CacheHelper.getCallOutCacheBean().getCache() ;
	Long names = (Long) callOutMap.aggregate(Aggregators.<Map.Entry<String, CallOutNames>>count(), new ForecastCallOutFilterPredicate(orgi)) ;
	return names!=null ? names.intValue() : 0 ;
}
 
Example 7
Source File: CallOutQuene.java    From youkefu with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({ "unchecked", "rawtypes" })
public static int countForecastCallOut(String orgi,String ownerforecast) {
	/**
	 * 统计当前在线的坐席数量
	 */
	IMap callOutMap = (IMap<String, Object>) CacheHelper.getCallOutCacheBean().getCache() ;
	Long names = (Long) callOutMap.aggregate(Aggregators.<Map.Entry<String, CallOutNames>>count(), new ForecastCallOutFilterPredicate(orgi,ownerforecast)) ;
	return names!=null ? names.intValue() : 0 ;
}
 
Example 8
Source File: CallOutQuene.java    From youkefu with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({ "unchecked", "rawtypes" })
public static int countForecastAgent(String orgi,String ownerforecast) {
	/**
	 * 统计当前在线的坐席数量
	 */
	IMap agentMap = (IMap<String, Object>) CacheHelper.getCallCenterAgentCacheBean().getCache() ;
	Long agents = (Long) agentMap .aggregate(Aggregators.<Map.Entry<String, CallCenterAgent>>count(), new ForecastAgentFilterPredicate(orgi,ownerforecast)) ;
	return agents !=null ? agents.intValue() : 0 ;
}