Class MdxEventFormatter
- java.lang.Object
-
- com.activeviam.risk.ref.activepivot.mdx.impl.MdxEventFormatter
-
public class MdxEventFormatter extends Object
An utility which help to retrieve Mdx based information from a monitor and an event. This can work only for KPI type monitors. TODO: Reuse those constants from AP/MDx Classes- Author:
- QuartetFS
-
-
Field Summary
Fields Modifier and Type Field Description protected static Pattern
AGENT_PATTERN
protected com.qfs.snl.agent.IAgentService
agentService
The service that enables us to retrieve agents associated to a monitorprotected static String
ALLMember
protected static String
EPOCH
protected static String
EPOCH_ID
protected static String
MEMBER_SEPARATOR
-
Constructor Summary
Constructors Constructor Description MdxEventFormatter(com.qfs.snl.agent.IAgentService agentService)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
escapeMdxQuery(String query)
Escapes a MDX query for inclusion in Angular.String
formatMember(String levelPath, String memberPath)
com.qfs.snl.agent.IAgentDescription
getAgent(com.qfs.snl.monitors.IMonitor monitor)
Retrieve the agent description on which the given monitor is registered.Map<String,String>
getContextValues(com.qfs.snl.monitors.IMonitor monitor, com.qfs.snl.data.ISentinelEvent event)
Retrieve the actual context values from the given monitor and event.String
getLiveUrl(com.qfs.snl.monitors.IMonitor monitor)
Retrieve the live url that can connect to the site on which the given monitor is registered.String
getMdxQuery(com.qfs.snl.monitors.IMonitor monitor, com.qfs.snl.data.ISentinelEvent event)
Creates a MDX query displaying the given event.boolean
isEpoch(com.qfs.snl.data.ISentinelState state)
String
monitorPath(String site, long id)
Get the monitor path from its site and its id.
-
-
-
Field Detail
-
AGENT_PATTERN
protected static final Pattern AGENT_PATTERN
-
ALLMember
protected static final String ALLMember
- See Also:
- Constant Field Values
-
MEMBER_SEPARATOR
protected static final String MEMBER_SEPARATOR
- See Also:
- Constant Field Values
-
EPOCH
protected static final String EPOCH
- See Also:
- Constant Field Values
-
EPOCH_ID
protected static final String EPOCH_ID
- See Also:
- Constant Field Values
-
agentService
protected com.qfs.snl.agent.IAgentService agentService
The service that enables us to retrieve agents associated to a monitor
-
-
Method Detail
-
getMdxQuery
public String getMdxQuery(com.qfs.snl.monitors.IMonitor monitor, com.qfs.snl.data.ISentinelEvent event)
Creates a MDX query displaying the given event.- Parameters:
monitor
- the monitor owning the eventevent
- the event to explore- Returns:
- the MDX query displaying the event
-
escapeMdxQuery
public String escapeMdxQuery(String query)
Escapes a MDX query for inclusion in Angular.This prepares the query to be embedded into an HTML attribute. It also modify the query not to conflict with Angular processing, particularly {{...}}.
- Parameters:
query
- query to escape- Returns:
- escaped value
-
getAgent
public com.qfs.snl.agent.IAgentDescription getAgent(com.qfs.snl.monitors.IMonitor monitor) throws com.quartetfs.fwk.QuartetRuntimeException
Retrieve the agent description on which the given monitor is registered.- Parameters:
monitor
- monitor to inspect- Returns:
- the description of the agent
- Throws:
com.quartetfs.fwk.QuartetRuntimeException
- if the agent can not be retrieved
-
getLiveUrl
public String getLiveUrl(com.qfs.snl.monitors.IMonitor monitor)
Retrieve the live url that can connect to the site on which the given monitor is registered.- Parameters:
monitor
- monitor to inspect- Returns:
- the live url or null if none is configured for this monitor site
-
formatMember
public String formatMember(String levelPath, String memberPath)
- Parameters:
levelPath
- the level unique name as [dim].[hier].[level]memberPath
- the member unique name- Returns:
- short name of the member without repeating the hierarchy and level information
-
monitorPath
public String monitorPath(String site, long id)
Get the monitor path from its site and its id.- Parameters:
site
- on which the monitor appliesid
- of the monitor- Returns:
- url path to the monitor
-
getContextValues
public Map<String,String> getContextValues(com.qfs.snl.monitors.IMonitor monitor, com.qfs.snl.data.ISentinelEvent event)
Retrieve the actual context values from the given monitor and event. We handle only KPI type monitor- Parameters:
monitor
- the monitorevent
- the ActiveMonitor event- Returns:
- map of context values
-
isEpoch
public boolean isEpoch(com.qfs.snl.data.ISentinelState state)
-
-