|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hyperic.hq.measurement.server.session.SessionEJB
org.hyperic.hq.measurement.server.session.DataManagerEJBImpl
public class DataManagerEJBImpl
The DataManagerEJB class is a stateless session bean that can be used to retrieve measurement data points
Field Summary | |
---|---|
java.lang.String |
ALL_EVENTS_INTERESTING_PROP
|
Fields inherited from class org.hyperic.hq.measurement.server.session.SessionEJB |
---|
_mpm, DATASOURCE_NAME |
Constructor Summary | |
---|---|
DataManagerEJBImpl()
|
Method Summary | |
---|---|
void |
addData(java.lang.Integer mid,
MetricValue mv,
boolean overwrite)
Save the new MetricValue to the database |
boolean |
addData(java.util.List data)
Write metric data points to the DB with transaction |
void |
addData(java.util.List data,
boolean overwrite)
Write metric datapoints to the DB without transaction |
void |
ejbActivate()
|
void |
ejbCreate()
|
void |
ejbPassivate()
|
void |
ejbPostCreate()
|
void |
ejbRemove()
|
double[] |
getAggregateData(java.util.List measurements,
long begin,
long end)
Aggregate data across the given metric IDs, returning max, min, avg, and count of number of unique metric IDs |
java.util.Map |
getAggregateDataByMetric(java.lang.Integer[] tids,
java.lang.Integer[] iids,
long begin,
long end,
boolean useAggressiveRollup)
Fetch a map of aggregate data values keyed by metrics given a start and stop time range |
java.util.Map |
getAggregateDataByMetric(java.util.List measurements,
long begin,
long end,
boolean useAggressiveRollup)
Fetch a map of aggregate data values keyed by metrics given a start and stop time range |
java.util.Map |
getAggregateDataByTemplate(java.util.List measurements,
long begin,
long end)
Fetch the list of historical data points, grouped by template, given a begin and end time range. |
double[] |
getBaselineData(Measurement meas,
long begin,
long end)
Get a Baseline data. |
java.util.ArrayList |
getCachedDataPoints(java.lang.Integer[] ids,
java.util.Map data,
long timestamp)
Get data points from cache only |
PageList |
getHistoricalData(java.util.List measurements,
long begin,
long end,
long interval,
int type,
boolean returnMetricNulls,
PageControl pc)
Fetch the list of historical data points given a start and stop time range and interval |
PageList |
getHistoricalData(Measurement m,
long begin,
long end,
PageControl pc)
Fetch the list of historical data points given a begin and end time range. |
PageList |
getHistoricalData(Measurement m,
long begin,
long end,
PageControl pc,
boolean prependAvailUnknowns)
Fetch the list of historical data points given a begin and end time range. |
java.util.Map |
getLastDataPoints(java.util.List measurements,
long timestamp)
Fetch the most recent data point for particular Measurements. |
MetricValue |
getLastHistoricalData(Measurement m)
Get the last MetricValue for the given Measurement. |
static org.hyperic.hq.measurement.shared.DataManagerLocal |
getOne()
|
java.util.Collection |
getRawData(Measurement m,
long begin,
long end,
java.util.concurrent.atomic.AtomicLong publishedInterval)
|
void |
setSessionContext(javax.ejb.SessionContext ctx)
|
Methods inherited from class org.hyperic.hq.measurement.server.session.SessionEJB |
---|
checkDeletePermission, checkModifyPermission, checkTimeArguments, deleteMetricProblems, getAgent, getAgent, getAgentMan, getAuthzSubjectManager, getAvailabilityDataDAO, getBaselineDAO, getCategoryDAO, getDataMan, getInitialContext, getMeasurementDAO, getMeasurementTemplateDAO, getMetricProblemDAO, getMonitorableTypeDAO, getMPM, getProductMan, getResource, getScheduleRevNumDAO, getSRNManager, getTemplateMan |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final java.lang.String ALL_EVENTS_INTERESTING_PROP
Constructor Detail |
---|
public DataManagerEJBImpl()
Method Detail |
---|
public void addData(java.lang.Integer mid, MetricValue mv, boolean overwrite)
dp
- the new MetricValue
java.lang.NumberFormatException
- if the value from the
DataPoint.getMetricValue() cannot instantiate a BigDecimalpublic boolean addData(java.util.List data)
data
- a list of DataPoint
s
java.lang.NumberFormatException
- if the value from the
DataPoint.getMetricValue() cannot instantiate a BigDecimalpublic void addData(java.util.List data, boolean overwrite)
data
- a list of DataPoint
soverwrite
- If true, attempt to over-write values when an insert
of the data fails (i.e. it already exists). You may
not want to over-write values when, for instance, the
back filler is inserting data.
java.lang.NumberFormatException
- if the value from the
DataPoint.getMetricValue() cannot instantiate a BigDecimalpublic PageList getHistoricalData(Measurement m, long begin, long end, PageControl pc, boolean prependAvailUnknowns)
m
- The Measurementbegin
- the start of the time rangeend
- the end of the time rangeprependUnknowns
- determines whether to prepend AVAIL_UNKNOWN if the
corresponding time window is not accounted for in the database. Since
availability is contiguous this will not occur unless the time range
precedes the first availability point.
public PageList getHistoricalData(Measurement m, long begin, long end, PageControl pc)
m
- The Measurementbegin
- the start of the time rangeend
- the end of the time range
public java.util.Collection getRawData(Measurement m, long begin, long end, java.util.concurrent.atomic.AtomicLong publishedInterval)
publishedInterval
- AtomicLong
interval, in millis, of the dataset which is
returned from the api. For example for queries that are a month long HQ will use a daily
rollup table to retrieve the data from. In this case publishedInterval would be set with an
interval that represents one day.
MetricValue
representing the raw metric data collected. Since
Availability just keeps state changes this does not apply, therefore one MetricValue
will be returned per interval.public double[] getAggregateData(java.util.List measurements, long begin, long end)
measurements
- List
of Measurement
sbegin
- The start of the time rangeend
- The end of the time range
public java.util.Map getAggregateDataByTemplate(java.util.List measurements, long begin, long end)
MeasurementConstants.IND_LAST_TIME
index in the
double[]
part of the returned map does not contain the real last
value. Instead it is an averaged value calculated from the last 1/60 of
the specified time range. If this becomes an issue the best way I can
think of to solve is to pass in a boolean "getRealLastTime" and issue
another query to get the last value if this is set. It is much
better than the alternative of always querying the last metric time
because not all pages require this value.
measurements
- The List of Measurement
s to querybegin
- The start of the time rangeend
- The end of the time range
Map
of Integer
to double[]
which
represents templateId to data pointsorg.hyperic.hq.measurement.server.session.AvailabilityManagerEJBImpl#getHistoricalData()
public PageList getHistoricalData(java.util.List measurements, long begin, long end, long interval, int type, boolean returnMetricNulls, PageControl pc)
measurements
- The List of Measurements to querybegin
- The start of the time rangeend
- The end of the time rangeinterval
- Interval for the time rangetype
- Collection type for the metricreturnMetricNulls
- Specifies whether intervals with no data should
be return as HighLowMetricValue
with the value set as Double.NaN
org.hyperic.hq.measurement.server.session.AvailabilityManagerEJBImpl#getHistoricalData()
public MetricValue getLastHistoricalData(Measurement m)
m
- The Measurement
public java.util.Map getLastDataPoints(java.util.List measurements, long timestamp)
measurements
- The List of Measurements to query. In the list of
Measurements null values are allowed as placeholders.timestamp
- Only use data points with collection times greater
than the given timestamp.
public java.util.ArrayList getCachedDataPoints(java.lang.Integer[] ids, java.util.Map data, long timestamp)
public double[] getBaselineData(Measurement meas, long begin, long end)
public java.util.Map getAggregateDataByMetric(java.lang.Integer[] tids, java.lang.Integer[] iids, long begin, long end, boolean useAggressiveRollup)
tids
- The template id's of the Measurementiids
- The instance id's of the Measurementbegin
- The start of the time rangeend
- The end of the time rangeuseAggressiveRollup
- uses a measurement rollup table to fetch the
data if the time range spans more than one data table's max timerange
public java.util.Map getAggregateDataByMetric(java.util.List measurements, long begin, long end, boolean useAggressiveRollup)
measurements
- The id's of the Measurementbegin
- The start of the time rangeend
- The end of the time rangeuseAggressiveRollup
- uses a measurement rollup table to fetch the
data if the time range spans more than one data table's max timerange
public static org.hyperic.hq.measurement.shared.DataManagerLocal getOne()
public void ejbCreate() throws javax.ejb.CreateException
javax.ejb.CreateException
public void ejbPostCreate()
public void ejbActivate()
ejbActivate
in interface javax.ejb.SessionBean
public void ejbPassivate()
ejbPassivate
in interface javax.ejb.SessionBean
public void ejbRemove()
ejbRemove
in interface javax.ejb.SessionBean
public void setSessionContext(javax.ejb.SessionContext ctx)
setSessionContext
in interface javax.ejb.SessionBean
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |